blob: 7706d49edbe482a89604c8c3df02a808f6f11589 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<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_v1.html">Compute Engine API</a> . <a href="compute_v1.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, maxResults=None, pageToken=None, filter=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080082<p class="firstline">Retrieves aggregated list of instances.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<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>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +000088<p class="firstline">Attaches a Disk resource to an instance.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
90 <code><a href="#delete">delete(project, zone, instance)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080091<p class="firstline">Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<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>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700100<p class="firstline">Returns the specified Instance resource. Get a list of available instances by making a list() request.</p>
John Asmuth614db982014-04-24 15:46:26 -0400101<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000102 <code><a href="#getSerialPortOutput">getSerialPortOutput(project, zone, instance, port=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400103<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, maxResults=None, pageToken=None, filter=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800109<p class="firstline">Retrieves the list of instances contained within the specified zone.</p>
John Asmuth614db982014-04-24 15:46:26 -0400110<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>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000118<p class="firstline">Sets the auto-delete flag for a disk attached to an instance.</p>
John Asmuth614db982014-04-24 15:46:26 -0400119<p class="toc_element">
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800120 <code><a href="#setMachineType">setMachineType(project, zone, instance, body)</a></code></p>
121<p class="firstline">Changes the machine type for a stopped instance to the machine type specified in the request.</p>
122<p class="toc_element">
John Asmuth614db982014-04-24 15:46:26 -0400123 <code><a href="#setMetadata">setMetadata(project, zone, instance, body)</a></code></p>
124<p class="firstline">Sets metadata for the specified instance to the data included in the request.</p>
125<p class="toc_element">
126 <code><a href="#setScheduling">setScheduling(project, zone, instance, body)</a></code></p>
127<p class="firstline">Sets an instance's scheduling options.</p>
128<p class="toc_element">
129 <code><a href="#setTags">setTags(project, zone, instance, body)</a></code></p>
130<p class="firstline">Sets tags for the specified instance to the data included in the request.</p>
Craig Citroe633be12015-03-02 13:40:36 -0800131<p class="toc_element">
132 <code><a href="#start">start(project, zone, instance)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800133<p class="firstline">Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -0800134<p class="toc_element">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700135 <code><a href="#startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</a></code></p>
136<p class="firstline">Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.</p>
137<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -0800138 <code><a href="#stop">stop(project, zone, instance)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800139<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>
John Asmuth614db982014-04-24 15:46:26 -0400140<h3>Method Details</h3>
141<div class="method">
142 <code class="details" id="addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body)</code>
143 <pre>Adds an access config to an instance's network interface.
144
145Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000146 project: string, Project ID for this request. (required)
147 zone: string, The name of the zone for this request. (required)
148 instance: string, The instance name for this request. (required)
149 networkInterface: string, The name of the network interface to add to this instance. (required)
John Asmuth614db982014-04-24 15:46:26 -0400150 body: object, The request body. (required)
151 The object takes the form of:
152
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700153{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000154 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
155 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
John Asmuth614db982014-04-24 15:46:26 -0400156 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000157 "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.
John Asmuth614db982014-04-24 15:46:26 -0400158}
159
160
161Returns:
162 An object of the form:
163
Takashi Matsuo06694102015-09-11 13:55:40 -0700164 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800165 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
166 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000167 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800168 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
169 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
170 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
171 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000172 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800173 "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.
174 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800175 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800176 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
177 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000178 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400179 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800180 "message": "A String", # [Output Only] A human-readable description of the warning code.
181 "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.
182 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
183 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400184 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000185 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700186 "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).
John Asmuth614db982014-04-24 15:46:26 -0400187 },
188 ],
189 },
190 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000191 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800192 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
193 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000194 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800195 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000196 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800197 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400198 {
Craig Citroe633be12015-03-02 13:40:36 -0800199 "message": "A String", # [Output Only] An optional, human-readable error message.
200 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700201 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400202 },
203 ],
204 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800205 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700206 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800207 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400208 }</pre>
209</div>
210
211<div class="method">
212 <code class="details" id="aggregatedList">aggregatedList(project, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800213 <pre>Retrieves aggregated list of instances.
John Asmuth614db982014-04-24 15:46:26 -0400214
215Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000216 project: string, Project ID for this request. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800217 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.
218 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.
219 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700220
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800221The 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700222
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700223For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800224
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700225You 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800226
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700227To 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.
John Asmuth614db982014-04-24 15:46:26 -0400228
229Returns:
230 An object of the form:
231
232 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800233 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000234 "items": { # [Output Only] A map of scoped instance lists.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800235 "a_key": { # [Output Only] Name of the scope containing this set of instances.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000236 "instances": [ # [Output Only] List of instances contained in this scope.
237 { # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000238 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700239 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDED, SUSPENDING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000240 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
241 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800242 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000243 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700244 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700245 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
246 "A String",
247 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000248 "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.
249 #
250 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700251 },
John Asmuth614db982014-04-24 15:46:26 -0400252 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
253 { # An instance-attached disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700254 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
255 #
256 # 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.
257 #
258 # 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.
259 #
260 # 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.
261 #
262 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
263 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
264 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
265 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700266 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000267 #
268 # 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.
269 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
270 "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.
271 #
272 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
273 #
274 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700275 "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.
276 #
277 # 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.
278 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
279 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
280 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000281 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
282 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700283 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
284 #
285 # 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:
286 #
287 # projects/debian-cloud/global/images/family/debian-8
288 #
289 # Alternatively, use a specific version of a public operating system image:
290 #
291 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
292 #
293 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000294 #
295 # global/images/my-private-image
296 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700297 # 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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000298 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700299 # global/images/family/my-private-family
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000300 "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:
301 #
302 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
303 #
304 # 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:
305 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
306 # - projects/project/zones/zone/diskTypes/diskType
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700307 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
John Asmuth614db982014-04-24 15:46:26 -0400308 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000309 "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).
310 "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.
311 "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.
312 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700313 "A String",
314 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000315 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800316 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000317 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700318 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. Note that for InstanceTemplate, it is just disk name, not URL for the disk.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700319 },
John Asmuth614db982014-04-24 15:46:26 -0400320 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800321 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000322 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
323 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700324 "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.
325 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800326 "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.
John Asmuth614db982014-04-24 15:46:26 -0400327 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800328 "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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000329 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800330 # zones/us-central1-f/machineTypes/n1-standard-1
331 #
332 # 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):
333 #
334 # zones/zone/machineTypes/custom-CPUS-MEMORY
335 #
336 # For example: zones/us-central1-f/machineTypes/custom-4-5120
337 #
338 # For a full list of restrictions, read the Specifications for custom machine types.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700339 "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.
John Asmuth614db982014-04-24 15:46:26 -0400340 { # A service account.
341 "scopes": [ # The list of scopes to be made available for this service account.
342 "A String",
343 ],
344 "email": "A String", # Email address of the service account.
345 },
346 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700347 "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.
John Asmuth614db982014-04-24 15:46:26 -0400348 { # A network interface resource attached to an instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700349 "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.
350 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000351 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
352 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
John Asmuth614db982014-04-24 15:46:26 -0400353 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000354 "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.
John Asmuth614db982014-04-24 15:46:26 -0400355 },
356 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700357 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000358 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800359 "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:
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700360 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
361 # - regions/region/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000362 "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:
363 #
364 # global/networks/default
365 #
366 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
367 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
368 # - projects/project/global/networks/network
369 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -0400370 },
371 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000372 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800373 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
374 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000375 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
John Asmuth614db982014-04-24 15:46:26 -0400376 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
377 {
378 "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.
379 "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.
380 },
381 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000382 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
383 "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.
John Asmuth614db982014-04-24 15:46:26 -0400384 },
385 },
386 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000387 "warning": { # [Output Only] Informational warning which replaces the list of instances when the list is empty.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800388 "message": "A String", # [Output Only] A human-readable description of the warning code.
389 "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.
390 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
391 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400392 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000393 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700394 "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).
John Asmuth614db982014-04-24 15:46:26 -0400395 },
396 ],
397 },
398 },
399 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000400 "kind": "compute#instanceAggregatedList", # [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800401 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
402 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400403 }</pre>
404</div>
405
406<div class="method">
407 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
408 <pre>Retrieves the next page of results.
409
410Args:
411 previous_request: The request for the previous page. (required)
412 previous_response: The response from the request for the previous page. (required)
413
414Returns:
415 A request object that you can call 'execute()' on to request the next
416 page. Returns None if there are no more items in the collection.
417 </pre>
418</div>
419
420<div class="method">
421 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body)</code>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000422 <pre>Attaches a Disk resource to an instance.
John Asmuth614db982014-04-24 15:46:26 -0400423
424Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000425 project: string, Project ID for this request. (required)
426 zone: string, The name of the zone for this request. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800427 instance: string, The instance name for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400428 body: object, The request body. (required)
429 The object takes the form of:
430
431{ # An instance-attached disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700432 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
433 #
434 # 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.
435 #
436 # 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.
437 #
438 # 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.
439 #
440 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
441 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
442 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
443 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700444 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000445 #
446 # 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.
447 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
448 "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.
449 #
450 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
451 #
452 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700453 "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.
454 #
455 # 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.
456 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
457 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
458 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000459 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
460 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700461 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
462 #
463 # 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:
464 #
465 # projects/debian-cloud/global/images/family/debian-8
466 #
467 # Alternatively, use a specific version of a public operating system image:
468 #
469 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
470 #
471 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000472 #
473 # global/images/my-private-image
474 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700475 # 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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000476 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700477 # global/images/family/my-private-family
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000478 "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:
479 #
480 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
481 #
482 # 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:
483 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
484 # - projects/project/zones/zone/diskTypes/diskType
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700485 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700486 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000487 "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).
488 "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.
489 "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.
490 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700491 "A String",
492 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000493 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800494 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000495 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700496 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. Note that for InstanceTemplate, it is just disk name, not URL for the disk.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700497}
John Asmuth614db982014-04-24 15:46:26 -0400498
499
500Returns:
501 An object of the form:
502
Takashi Matsuo06694102015-09-11 13:55:40 -0700503 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800504 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
505 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000506 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800507 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
508 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
509 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
510 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000511 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800512 "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.
513 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800514 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800515 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
516 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000517 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400518 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800519 "message": "A String", # [Output Only] A human-readable description of the warning code.
520 "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.
521 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
522 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400523 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000524 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700525 "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).
John Asmuth614db982014-04-24 15:46:26 -0400526 },
527 ],
528 },
529 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000530 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800531 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
532 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000533 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800534 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000535 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800536 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400537 {
Craig Citroe633be12015-03-02 13:40:36 -0800538 "message": "A String", # [Output Only] An optional, human-readable error message.
539 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700540 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400541 },
542 ],
543 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800544 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700545 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800546 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400547 }</pre>
548</div>
549
550<div class="method">
551 <code class="details" id="delete">delete(project, zone, instance)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800552 <pre>Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
John Asmuth614db982014-04-24 15:46:26 -0400553
554Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000555 project: string, Project ID for this request. (required)
556 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400557 instance: string, Name of the instance resource to delete. (required)
558
559Returns:
560 An object of the form:
561
Takashi Matsuo06694102015-09-11 13:55:40 -0700562 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800563 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
564 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000565 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800566 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
567 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
568 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
569 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000570 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800571 "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.
572 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800573 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800574 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
575 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000576 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400577 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800578 "message": "A String", # [Output Only] A human-readable description of the warning code.
579 "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.
580 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
581 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400582 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000583 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700584 "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).
John Asmuth614db982014-04-24 15:46:26 -0400585 },
586 ],
587 },
588 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000589 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800590 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
591 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000592 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800593 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000594 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800595 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400596 {
Craig Citroe633be12015-03-02 13:40:36 -0800597 "message": "A String", # [Output Only] An optional, human-readable error message.
598 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700599 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400600 },
601 ],
602 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800603 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700604 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800605 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400606 }</pre>
607</div>
608
609<div class="method">
610 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</code>
611 <pre>Deletes an access config from an instance's network interface.
612
613Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000614 project: string, Project ID for this request. (required)
615 zone: string, The name of the zone for this request. (required)
616 instance: string, The instance name for this request. (required)
617 accessConfig: string, The name of the access config to delete. (required)
618 networkInterface: string, The name of the network interface. (required)
John Asmuth614db982014-04-24 15:46:26 -0400619
620Returns:
621 An object of the form:
622
Takashi Matsuo06694102015-09-11 13:55:40 -0700623 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800624 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
625 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000626 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800627 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
628 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
629 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
630 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000631 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800632 "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.
633 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800634 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800635 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
636 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000637 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400638 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800639 "message": "A String", # [Output Only] A human-readable description of the warning code.
640 "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.
641 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
642 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400643 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000644 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700645 "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).
John Asmuth614db982014-04-24 15:46:26 -0400646 },
647 ],
648 },
649 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000650 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800651 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
652 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000653 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800654 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000655 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800656 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400657 {
Craig Citroe633be12015-03-02 13:40:36 -0800658 "message": "A String", # [Output Only] An optional, human-readable error message.
659 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700660 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400661 },
662 ],
663 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800664 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700665 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800666 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400667 }</pre>
668</div>
669
670<div class="method">
671 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName)</code>
672 <pre>Detaches a disk from an instance.
673
674Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000675 project: string, Project ID for this request. (required)
676 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400677 instance: string, Instance name. (required)
678 deviceName: string, Disk device name to detach. (required)
679
680Returns:
681 An object of the form:
682
Takashi Matsuo06694102015-09-11 13:55:40 -0700683 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800684 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
685 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000686 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800687 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
688 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
689 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
690 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000691 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800692 "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.
693 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800694 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800695 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
696 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000697 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400698 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800699 "message": "A String", # [Output Only] A human-readable description of the warning code.
700 "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.
701 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
702 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400703 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000704 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700705 "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).
John Asmuth614db982014-04-24 15:46:26 -0400706 },
707 ],
708 },
709 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000710 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800711 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
712 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000713 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800714 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000715 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800716 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400717 {
Craig Citroe633be12015-03-02 13:40:36 -0800718 "message": "A String", # [Output Only] An optional, human-readable error message.
719 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700720 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400721 },
722 ],
723 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800724 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700725 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800726 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400727 }</pre>
728</div>
729
730<div class="method">
731 <code class="details" id="get">get(project, zone, instance)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700732 <pre>Returns the specified Instance resource. Get a list of available instances by making a list() request.
John Asmuth614db982014-04-24 15:46:26 -0400733
734Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000735 project: string, Project ID for this request. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700736 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400737 instance: string, Name of the instance resource to return. (required)
738
739Returns:
740 An object of the form:
741
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000742 { # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000743 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700744 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDED, SUSPENDING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000745 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
746 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800747 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000748 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700749 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700750 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
751 "A String",
752 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000753 "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.
754 #
755 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700756 },
John Asmuth614db982014-04-24 15:46:26 -0400757 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
758 { # An instance-attached disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700759 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
760 #
761 # 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.
762 #
763 # 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.
764 #
765 # 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.
766 #
767 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
768 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
769 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
770 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700771 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000772 #
773 # 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.
774 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
775 "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.
776 #
777 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
778 #
779 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700780 "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.
781 #
782 # 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.
783 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
784 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
785 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000786 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
787 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700788 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
789 #
790 # 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:
791 #
792 # projects/debian-cloud/global/images/family/debian-8
793 #
794 # Alternatively, use a specific version of a public operating system image:
795 #
796 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
797 #
798 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000799 #
800 # global/images/my-private-image
801 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700802 # 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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000803 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700804 # global/images/family/my-private-family
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000805 "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:
806 #
807 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
808 #
809 # 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:
810 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
811 # - projects/project/zones/zone/diskTypes/diskType
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700812 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
John Asmuth614db982014-04-24 15:46:26 -0400813 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000814 "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).
815 "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.
816 "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.
817 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700818 "A String",
819 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000820 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800821 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000822 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700823 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. Note that for InstanceTemplate, it is just disk name, not URL for the disk.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700824 },
John Asmuth614db982014-04-24 15:46:26 -0400825 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800826 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000827 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
828 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700829 "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.
830 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800831 "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.
John Asmuth614db982014-04-24 15:46:26 -0400832 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800833 "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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000834 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800835 # zones/us-central1-f/machineTypes/n1-standard-1
836 #
837 # 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):
838 #
839 # zones/zone/machineTypes/custom-CPUS-MEMORY
840 #
841 # For example: zones/us-central1-f/machineTypes/custom-4-5120
842 #
843 # For a full list of restrictions, read the Specifications for custom machine types.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700844 "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.
John Asmuth614db982014-04-24 15:46:26 -0400845 { # A service account.
846 "scopes": [ # The list of scopes to be made available for this service account.
847 "A String",
848 ],
849 "email": "A String", # Email address of the service account.
850 },
851 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700852 "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.
John Asmuth614db982014-04-24 15:46:26 -0400853 { # A network interface resource attached to an instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700854 "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.
855 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000856 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
857 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
John Asmuth614db982014-04-24 15:46:26 -0400858 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000859 "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.
John Asmuth614db982014-04-24 15:46:26 -0400860 },
861 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700862 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000863 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800864 "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:
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700865 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
866 # - regions/region/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000867 "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:
868 #
869 # global/networks/default
870 #
871 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
872 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
873 # - projects/project/global/networks/network
874 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -0400875 },
876 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000877 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800878 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
879 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000880 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
John Asmuth614db982014-04-24 15:46:26 -0400881 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
882 {
883 "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.
884 "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.
885 },
886 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000887 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
888 "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.
John Asmuth614db982014-04-24 15:46:26 -0400889 },
890 }</pre>
891</div>
892
893<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000894 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance, port=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400895 <pre>Returns the specified instance's serial port output.
896
897Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000898 project: string, Project ID for this request. (required)
899 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400900 instance: string, Name of the instance scoping this request. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700901 port: integer, Specifies which COM or serial port to retrieve data from.
John Asmuth614db982014-04-24 15:46:26 -0400902
903Returns:
904 An object of the form:
905
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000906 { # An instance's serial console output.
907 "kind": "compute#serialPortOutput", # [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800908 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000909 "contents": "A String", # [Output Only] The contents of the console output.
John Asmuth614db982014-04-24 15:46:26 -0400910 }</pre>
911</div>
912
913<div class="method">
914 <code class="details" id="insert">insert(project, zone, body)</code>
915 <pre>Creates an instance resource in the specified project using the data included in the request.
916
917Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000918 project: string, Project ID for this request. (required)
919 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400920 body: object, The request body. (required)
921 The object takes the form of:
922
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000923{ # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000924 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700925 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDED, SUSPENDING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000926 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
927 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800928 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000929 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700930 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700931 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
932 "A String",
933 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000934 "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.
935 #
936 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700937 },
John Asmuth614db982014-04-24 15:46:26 -0400938 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
939 { # An instance-attached disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700940 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
941 #
942 # 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.
943 #
944 # 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.
945 #
946 # 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.
947 #
948 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
949 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
950 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
951 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700952 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000953 #
954 # 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.
955 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
956 "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.
957 #
958 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
959 #
960 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700961 "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.
962 #
963 # 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.
964 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
965 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
966 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000967 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
968 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700969 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
970 #
971 # 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:
972 #
973 # projects/debian-cloud/global/images/family/debian-8
974 #
975 # Alternatively, use a specific version of a public operating system image:
976 #
977 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
978 #
979 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000980 #
981 # global/images/my-private-image
982 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700983 # 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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000984 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700985 # global/images/family/my-private-family
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000986 "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:
987 #
988 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
989 #
990 # 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:
991 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
992 # - projects/project/zones/zone/diskTypes/diskType
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700993 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
John Asmuth614db982014-04-24 15:46:26 -0400994 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000995 "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).
996 "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.
997 "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.
998 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700999 "A String",
1000 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001001 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001002 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001003 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001004 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. Note that for InstanceTemplate, it is just disk name, not URL for the disk.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001005 },
John Asmuth614db982014-04-24 15:46:26 -04001006 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001007 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001008 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1009 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -07001010 "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.
1011 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001012 "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.
John Asmuth614db982014-04-24 15:46:26 -04001013 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001014 "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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001015 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001016 # zones/us-central1-f/machineTypes/n1-standard-1
1017 #
1018 # 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):
1019 #
1020 # zones/zone/machineTypes/custom-CPUS-MEMORY
1021 #
1022 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1023 #
1024 # For a full list of restrictions, read the Specifications for custom machine types.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001025 "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.
John Asmuth614db982014-04-24 15:46:26 -04001026 { # A service account.
1027 "scopes": [ # The list of scopes to be made available for this service account.
1028 "A String",
1029 ],
1030 "email": "A String", # Email address of the service account.
1031 },
1032 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001033 "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.
John Asmuth614db982014-04-24 15:46:26 -04001034 { # A network interface resource attached to an instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001035 "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.
1036 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001037 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1038 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
John Asmuth614db982014-04-24 15:46:26 -04001039 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001040 "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.
John Asmuth614db982014-04-24 15:46:26 -04001041 },
1042 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001043 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001044 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001045 "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:
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001046 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1047 # - regions/region/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001048 "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:
1049 #
1050 # global/networks/default
1051 #
1052 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1053 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1054 # - projects/project/global/networks/network
1055 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -04001056 },
1057 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001058 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001059 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1060 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001061 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
John Asmuth614db982014-04-24 15:46:26 -04001062 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1063 {
1064 "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.
1065 "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.
1066 },
1067 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001068 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1069 "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.
John Asmuth614db982014-04-24 15:46:26 -04001070 },
1071}
1072
1073
1074Returns:
1075 An object of the form:
1076
Takashi Matsuo06694102015-09-11 13:55:40 -07001077 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001078 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1079 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001080 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001081 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1082 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1083 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1084 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001085 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001086 "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.
1087 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001088 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001089 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1090 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001091 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -04001092 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001093 "message": "A String", # [Output Only] A human-readable description of the warning code.
1094 "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.
1095 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1096 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001097 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001098 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001099 "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).
John Asmuth614db982014-04-24 15:46:26 -04001100 },
1101 ],
1102 },
1103 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001104 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001105 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1106 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001107 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001108 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001109 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001110 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001111 {
Craig Citroe633be12015-03-02 13:40:36 -08001112 "message": "A String", # [Output Only] An optional, human-readable error message.
1113 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001114 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001115 },
1116 ],
1117 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001118 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001119 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001120 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001121 }</pre>
1122</div>
1123
1124<div class="method">
1125 <code class="details" id="list">list(project, zone, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001126 <pre>Retrieves the list of instances contained within the specified zone.
John Asmuth614db982014-04-24 15:46:26 -04001127
1128Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001129 project: string, Project ID for this request. (required)
1130 zone: string, The name of the zone for this request. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001131 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.
1132 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.
1133 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.
Takashi Matsuo06694102015-09-11 13:55:40 -07001134
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001135The 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.
Takashi Matsuo06694102015-09-11 13:55:40 -07001136
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001137For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001138
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001139You 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001140
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001141To 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.
John Asmuth614db982014-04-24 15:46:26 -04001142
1143Returns:
1144 An object of the form:
1145
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001146 { # Contains a list of instances.
1147 "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.
1148 "items": [ # [Output Only] A list of instances.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001149 { # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001150 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001151 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDED, SUSPENDING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001152 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1153 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001154 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001155 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001156 "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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001157 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1158 "A String",
1159 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001160 "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.
1161 #
1162 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001163 },
John Asmuth614db982014-04-24 15:46:26 -04001164 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1165 { # An instance-attached disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001166 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1167 #
1168 # 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.
1169 #
1170 # 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.
1171 #
1172 # 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.
1173 #
1174 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1175 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1176 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1177 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001178 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001179 #
1180 # 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.
1181 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1182 "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.
1183 #
1184 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1185 #
1186 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001187 "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.
1188 #
1189 # 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.
1190 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1191 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1192 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001193 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
1194 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001195 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
1196 #
1197 # 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:
1198 #
1199 # projects/debian-cloud/global/images/family/debian-8
1200 #
1201 # Alternatively, use a specific version of a public operating system image:
1202 #
1203 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1204 #
1205 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001206 #
1207 # global/images/my-private-image
1208 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001209 # 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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001210 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001211 # global/images/family/my-private-family
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001212 "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:
1213 #
1214 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1215 #
1216 # 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:
1217 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1218 # - projects/project/zones/zone/diskTypes/diskType
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001219 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
John Asmuth614db982014-04-24 15:46:26 -04001220 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001221 "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).
1222 "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.
1223 "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.
1224 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001225 "A String",
1226 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001227 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001228 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001229 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001230 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. Note that for InstanceTemplate, it is just disk name, not URL for the disk.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001231 },
John Asmuth614db982014-04-24 15:46:26 -04001232 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001233 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001234 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1235 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -07001236 "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.
1237 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001238 "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.
John Asmuth614db982014-04-24 15:46:26 -04001239 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001240 "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:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001241 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001242 # zones/us-central1-f/machineTypes/n1-standard-1
1243 #
1244 # 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):
1245 #
1246 # zones/zone/machineTypes/custom-CPUS-MEMORY
1247 #
1248 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1249 #
1250 # For a full list of restrictions, read the Specifications for custom machine types.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001251 "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.
John Asmuth614db982014-04-24 15:46:26 -04001252 { # A service account.
1253 "scopes": [ # The list of scopes to be made available for this service account.
1254 "A String",
1255 ],
1256 "email": "A String", # Email address of the service account.
1257 },
1258 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001259 "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.
John Asmuth614db982014-04-24 15:46:26 -04001260 { # A network interface resource attached to an instance.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001261 "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.
1262 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001263 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1264 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
John Asmuth614db982014-04-24 15:46:26 -04001265 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001266 "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.
John Asmuth614db982014-04-24 15:46:26 -04001267 },
1268 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001269 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001270 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001271 "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:
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001272 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1273 # - regions/region/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001274 "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:
1275 #
1276 # global/networks/default
1277 #
1278 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1279 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1280 # - projects/project/global/networks/network
1281 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -04001282 },
1283 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001284 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001285 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1286 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001287 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
John Asmuth614db982014-04-24 15:46:26 -04001288 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1289 {
1290 "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.
1291 "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.
1292 },
1293 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001294 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1295 "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.
John Asmuth614db982014-04-24 15:46:26 -04001296 },
1297 },
1298 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001299 "kind": "compute#instanceList", # [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001300 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1301 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -04001302 }</pre>
1303</div>
1304
1305<div class="method">
1306 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1307 <pre>Retrieves the next page of results.
1308
1309Args:
1310 previous_request: The request for the previous page. (required)
1311 previous_response: The response from the request for the previous page. (required)
1312
1313Returns:
1314 A request object that you can call 'execute()' on to request the next
1315 page. Returns None if there are no more items in the collection.
1316 </pre>
1317</div>
1318
1319<div class="method">
1320 <code class="details" id="reset">reset(project, zone, instance)</code>
1321 <pre>Performs a hard reset on the instance.
1322
1323Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001324 project: string, Project ID for this request. (required)
1325 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001326 instance: string, Name of the instance scoping this request. (required)
1327
1328Returns:
1329 An object of the form:
1330
Takashi Matsuo06694102015-09-11 13:55:40 -07001331 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001332 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1333 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001334 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001335 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1336 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1337 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1338 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001339 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001340 "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.
1341 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001342 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001343 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1344 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001345 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -04001346 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001347 "message": "A String", # [Output Only] A human-readable description of the warning code.
1348 "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.
1349 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1350 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001351 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001352 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001353 "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).
John Asmuth614db982014-04-24 15:46:26 -04001354 },
1355 ],
1356 },
1357 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001358 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001359 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1360 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001361 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001362 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001363 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001364 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001365 {
Craig Citroe633be12015-03-02 13:40:36 -08001366 "message": "A String", # [Output Only] An optional, human-readable error message.
1367 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001368 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001369 },
1370 ],
1371 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001372 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001373 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001374 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001375 }</pre>
1376</div>
1377
1378<div class="method">
1379 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</code>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001380 <pre>Sets the auto-delete flag for a disk attached to an instance.
John Asmuth614db982014-04-24 15:46:26 -04001381
1382Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001383 project: string, Project ID for this request. (required)
1384 zone: string, The name of the zone for this request. (required)
1385 instance: string, The instance name. (required)
John Asmuth614db982014-04-24 15:46:26 -04001386 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required)
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001387 deviceName: string, The device name of the disk to modify. (required)
John Asmuth614db982014-04-24 15:46:26 -04001388
1389Returns:
1390 An object of the form:
1391
Takashi Matsuo06694102015-09-11 13:55:40 -07001392 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001393 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1394 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001395 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001396 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1397 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1398 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1399 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001400 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001401 "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.
1402 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001403 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001404 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1405 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001406 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -04001407 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001408 "message": "A String", # [Output Only] A human-readable description of the warning code.
1409 "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.
1410 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1411 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001412 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001413 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001414 "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).
John Asmuth614db982014-04-24 15:46:26 -04001415 },
1416 ],
1417 },
1418 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001419 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001420 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1421 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001422 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001423 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001424 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001425 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001426 {
Craig Citroe633be12015-03-02 13:40:36 -08001427 "message": "A String", # [Output Only] An optional, human-readable error message.
1428 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001429 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001430 },
1431 ],
1432 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001433 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001434 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001435 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
1436 }</pre>
1437</div>
1438
1439<div class="method">
1440 <code class="details" id="setMachineType">setMachineType(project, zone, instance, body)</code>
1441 <pre>Changes the machine type for a stopped instance to the machine type specified in the request.
1442
1443Args:
1444 project: string, Project ID for this request. (required)
1445 zone: string, The name of the zone for this request. (required)
1446 instance: string, Name of the instance scoping this request. (required)
1447 body: object, The request body. (required)
1448 The object takes the form of:
1449
1450{
1451 "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
1452 }
1453
1454
1455Returns:
1456 An object of the form:
1457
1458 { # An Operation resource, used to manage asynchronous API requests.
1459 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1460 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1461 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1462 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1463 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1464 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1465 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1466 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1467 "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.
1468 "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.
1469 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1470 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1471 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1472 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1473 {
1474 "message": "A String", # [Output Only] A human-readable description of the warning code.
1475 "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.
1476 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1477 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1478 {
1479 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001480 "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).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001481 },
1482 ],
1483 },
1484 ],
1485 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1486 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1487 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1488 "name": "A String", # [Output Only] Name of the resource.
1489 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1490 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1491 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1492 {
1493 "message": "A String", # [Output Only] An optional, human-readable error message.
1494 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001495 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001496 },
1497 ],
1498 },
1499 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1500 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1501 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001502 }</pre>
1503</div>
1504
1505<div class="method">
1506 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body)</code>
1507 <pre>Sets metadata for the specified instance to the data included in the request.
1508
1509Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001510 project: string, Project ID for this request. (required)
1511 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001512 instance: string, Name of the instance scoping this request. (required)
1513 body: object, The request body. (required)
1514 The object takes the form of:
1515
1516{ # A metadata key/value entry.
1517 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1518 {
1519 "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.
1520 "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.
1521 },
1522 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001523 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1524 "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.
John Asmuth614db982014-04-24 15:46:26 -04001525}
1526
1527
1528Returns:
1529 An object of the form:
1530
Takashi Matsuo06694102015-09-11 13:55:40 -07001531 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001532 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1533 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001534 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001535 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1536 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1537 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1538 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001539 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001540 "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.
1541 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001542 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001543 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1544 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001545 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -04001546 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001547 "message": "A String", # [Output Only] A human-readable description of the warning code.
1548 "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.
1549 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1550 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001551 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001552 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001553 "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).
John Asmuth614db982014-04-24 15:46:26 -04001554 },
1555 ],
1556 },
1557 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001558 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001559 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1560 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001561 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001562 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001563 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001564 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001565 {
Craig Citroe633be12015-03-02 13:40:36 -08001566 "message": "A String", # [Output Only] An optional, human-readable error message.
1567 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001568 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001569 },
1570 ],
1571 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001572 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001573 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001574 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001575 }</pre>
1576</div>
1577
1578<div class="method">
1579 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body)</code>
1580 <pre>Sets an instance's scheduling options.
1581
1582Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001583 project: string, Project ID for this request. (required)
1584 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001585 instance: string, Instance name. (required)
1586 body: object, The request body. (required)
1587 The object takes the form of:
1588
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001589{ # Sets the scheduling options for an Instance.
Takashi Matsuo06694102015-09-11 13:55:40 -07001590 "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.
1591 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001592 "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.
John Asmuth614db982014-04-24 15:46:26 -04001593}
1594
1595
1596Returns:
1597 An object of the form:
1598
Takashi Matsuo06694102015-09-11 13:55:40 -07001599 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001600 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1601 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001602 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001603 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1604 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1605 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1606 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001607 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001608 "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.
1609 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001610 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001611 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1612 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001613 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -04001614 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001615 "message": "A String", # [Output Only] A human-readable description of the warning code.
1616 "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.
1617 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1618 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001619 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001620 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001621 "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).
John Asmuth614db982014-04-24 15:46:26 -04001622 },
1623 ],
1624 },
1625 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001626 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001627 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1628 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001629 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001630 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001631 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001632 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001633 {
Craig Citroe633be12015-03-02 13:40:36 -08001634 "message": "A String", # [Output Only] An optional, human-readable error message.
1635 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001636 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001637 },
1638 ],
1639 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001640 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001641 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001642 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001643 }</pre>
1644</div>
1645
1646<div class="method">
1647 <code class="details" id="setTags">setTags(project, zone, instance, body)</code>
1648 <pre>Sets tags for the specified instance to the data included in the request.
1649
1650Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001651 project: string, Project ID for this request. (required)
1652 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001653 instance: string, Name of the instance scoping this request. (required)
1654 body: object, The request body. (required)
1655 The object takes the form of:
1656
1657{ # A set of instance tags.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001658 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1659 "A String",
1660 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001661 "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.
1662 #
1663 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001664}
John Asmuth614db982014-04-24 15:46:26 -04001665
1666
1667Returns:
1668 An object of the form:
1669
Takashi Matsuo06694102015-09-11 13:55:40 -07001670 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001671 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001673 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001674 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001678 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001679 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001681 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001682 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001684 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -04001685 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001686 "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" }
John Asmuth614db982014-04-24 15:46:26 -04001690 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001691 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001692 "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).
John Asmuth614db982014-04-24 15:46:26 -04001693 },
1694 ],
1695 },
1696 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001697 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001698 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001700 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001701 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001702 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001703 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001704 {
Craig Citroe633be12015-03-02 13:40:36 -08001705 "message": "A String", # [Output Only] An optional, human-readable error message.
1706 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001707 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001708 },
1709 ],
1710 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001711 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001712 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001713 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
Craig Citroe633be12015-03-02 13:40:36 -08001714 }</pre>
1715</div>
1716
1717<div class="method">
1718 <code class="details" id="start">start(project, zone, instance)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001719 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
Craig Citroe633be12015-03-02 13:40:36 -08001720
1721Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001722 project: string, Project ID for this request. (required)
1723 zone: string, The name of the zone for this request. (required)
Craig Citroe633be12015-03-02 13:40:36 -08001724 instance: string, Name of the instance resource to start. (required)
1725
1726Returns:
1727 An object of the form:
1728
Takashi Matsuo06694102015-09-11 13:55:40 -07001729 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001730 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1731 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001732 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001733 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1734 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1735 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1736 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001737 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001738 "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.
1739 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001740 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001741 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1742 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001743 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001744 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001745 "message": "A String", # [Output Only] A human-readable description of the warning code.
1746 "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.
1747 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1748 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Craig Citroe633be12015-03-02 13:40:36 -08001749 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001750 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001751 "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).
Craig Citroe633be12015-03-02 13:40:36 -08001752 },
1753 ],
1754 },
1755 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001756 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001757 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1758 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001759 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001760 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001761 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001762 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1763 {
1764 "message": "A String", # [Output Only] An optional, human-readable error message.
1765 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001766 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
Craig Citroe633be12015-03-02 13:40:36 -08001767 },
1768 ],
1769 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001770 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001771 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001772 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
Craig Citroe633be12015-03-02 13:40:36 -08001773 }</pre>
1774</div>
1775
1776<div class="method">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001777 <code class="details" id="startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</code>
1778 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
1779
1780Args:
1781 project: string, Project ID for this request. (required)
1782 zone: string, The name of the zone for this request. (required)
1783 instance: string, Name of the instance resource to start. (required)
1784 body: object, The request body. (required)
1785 The object takes the form of:
1786
1787{
1788 "disks": [ # Array of disks associated with this instance that are protected with a customer-supplied encryption key.
1789 #
1790 # In order to start the instance, the disk url and its corresponding key must be provided.
1791 #
1792 # If the disk is not protected with a customer-supplied encryption key it should not be specified.
1793 {
1794 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with the disk with a customer-supplied encryption key.
1795 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1796 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1797 },
1798 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
1799 },
1800 ],
1801 }
1802
1803
1804Returns:
1805 An object of the form:
1806
1807 { # An Operation resource, used to manage asynchronous API requests.
1808 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1809 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1810 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1811 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1812 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1813 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1814 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1815 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1816 "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.
1817 "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.
1818 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1819 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1820 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1821 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1822 {
1823 "message": "A String", # [Output Only] A human-readable description of the warning code.
1824 "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.
1825 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1826 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1827 {
1828 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1829 "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).
1830 },
1831 ],
1832 },
1833 ],
1834 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1835 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1836 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1837 "name": "A String", # [Output Only] Name of the resource.
1838 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1839 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1840 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1841 {
1842 "message": "A String", # [Output Only] An optional, human-readable error message.
1843 "code": "A String", # [Output Only] The error type identifier for this error.
1844 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1845 },
1846 ],
1847 },
1848 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1849 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1850 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
1851 }</pre>
1852</div>
1853
1854<div class="method">
Craig Citroe633be12015-03-02 13:40:36 -08001855 <code class="details" id="stop">stop(project, zone, instance)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001856 <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.
Craig Citroe633be12015-03-02 13:40:36 -08001857
1858Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001859 project: string, Project ID for this request. (required)
1860 zone: string, The name of the zone for this request. (required)
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001861 instance: string, Name of the instance resource to stop. (required)
Craig Citroe633be12015-03-02 13:40:36 -08001862
1863Returns:
1864 An object of the form:
1865
Takashi Matsuo06694102015-09-11 13:55:40 -07001866 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001867 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1868 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001869 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001870 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1871 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1872 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1873 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001874 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001875 "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.
1876 "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.
Craig Citroe633be12015-03-02 13:40:36 -08001877 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001878 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1879 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001880 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001881 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001882 "message": "A String", # [Output Only] A human-readable description of the warning code.
1883 "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.
1884 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1885 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Craig Citroe633be12015-03-02 13:40:36 -08001886 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001887 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001888 "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).
Craig Citroe633be12015-03-02 13:40:36 -08001889 },
1890 ],
1891 },
1892 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001893 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001894 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1895 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001896 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001897 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001898 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001899 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1900 {
1901 "message": "A String", # [Output Only] An optional, human-readable error message.
1902 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001903 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
Craig Citroe633be12015-03-02 13:40:36 -08001904 },
1905 ],
1906 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001907 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -07001908 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001909 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001910 }</pre>
1911</div>
1912
1913</body></html>