blob: d162f52675107c6a17ba9fc653a69fd0f310f613 [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 Parrott36e41bc2016-02-19 16:02:29 -0800100<p class="firstline">Returns the specified Instance resource.</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">
135 <code><a href="#stop">stop(project, zone, instance)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800136<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 -0400137<h3>Method Details</h3>
138<div class="method">
139 <code class="details" id="addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body)</code>
140 <pre>Adds an access config to an instance's network interface.
141
142Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000143 project: string, Project ID for this request. (required)
144 zone: string, The name of the zone for this request. (required)
145 instance: string, The instance name for this request. (required)
146 networkInterface: string, The name of the network interface to add to this instance. (required)
John Asmuth614db982014-04-24 15:46:26 -0400147 body: object, The request body. (required)
148 The object takes the form of:
149
150{ # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000151 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
152 "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 -0400153 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000154 "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 -0400155}
156
157
158Returns:
159 An object of the form:
160
Takashi Matsuo06694102015-09-11 13:55:40 -0700161 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800162 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
163 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000164 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800165 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
166 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
167 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
168 "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 +0000169 "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 -0800170 "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.
171 "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 -0800172 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800173 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
174 "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 +0000175 "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 -0400176 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800177 "message": "A String", # [Output Only] A human-readable description of the warning code.
178 "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.
179 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
180 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400181 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000182 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800183 "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 -0400184 },
185 ],
186 },
187 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000188 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800189 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
190 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000191 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800192 "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 +0000193 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800194 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400195 {
Craig Citroe633be12015-03-02 13:40:36 -0800196 "message": "A String", # [Output Only] An optional, human-readable error message.
197 "code": "A String", # [Output Only] The error type identifier for this error.
198 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400199 },
200 ],
201 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800202 "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 -0700203 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800204 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400205 }</pre>
206</div>
207
208<div class="method">
209 <code class="details" id="aggregatedList">aggregatedList(project, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800210 <pre>Retrieves aggregated list of instances.
John Asmuth614db982014-04-24 15:46:26 -0400211
212Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000213 project: string, Project ID for this request. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800214 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.
215 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.
216 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 -0700217
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800218The 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 -0700219
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800220For example, to filter for instances whose name is not equal to example-instance, you would use filter=name ne example-instance.
221
222Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.
223
224The Beta API also supports filtering on multiple expressions by providing 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 -0400225
226Returns:
227 An object of the form:
228
229 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800230 "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 +0000231 "items": { # [Output Only] A map of scoped instance lists.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800232 "a_key": { # [Output Only] Name of the scope containing this set of instances.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000233 "instances": [ # [Output Only] List of instances contained in this scope.
234 { # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000235 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
236 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000237 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
238 "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 -0800239 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000240 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
241 "tags": { # A set of instance tags. # A list of tags to appy 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 -0700242 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
243 "A String",
244 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000245 "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.
246 #
247 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700248 },
John Asmuth614db982014-04-24 15:46:26 -0400249 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
250 { # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700251 "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 +0000252 #
253 # 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.
254 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
255 "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.
256 #
257 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
258 #
259 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
260 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
261 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
262 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
263 #
264 # global/images/my-private-image
265 #
266 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
267 #
268 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
269 #
270 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
271 "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:
272 #
273 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
274 #
275 # 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:
276 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
277 # - projects/project/zones/zone/diskTypes/diskType
278 # - zones/zone/diskTypes/diskType
John Asmuth614db982014-04-24 15:46:26 -0400279 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000280 "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).
281 "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.
282 "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.
283 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700284 "A String",
285 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000286 "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 -0800287 "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 +0000288 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
289 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700290 },
John Asmuth614db982014-04-24 15:46:26 -0400291 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800292 "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 +0000293 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
294 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700295 "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.
296 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800297 "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 -0400298 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800299 "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 +0000300 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800301 # zones/us-central1-f/machineTypes/n1-standard-1
302 #
303 # 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):
304 #
305 # zones/zone/machineTypes/custom-CPUS-MEMORY
306 #
307 # For example: zones/us-central1-f/machineTypes/custom-4-5120
308 #
309 # For a full list of restrictions, read the Specifications for custom machine types.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000310 "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 Authenticating from Google Compute Engine for more information.
John Asmuth614db982014-04-24 15:46:26 -0400311 { # A service account.
312 "scopes": [ # The list of scopes to be made available for this service account.
313 "A String",
314 ],
315 "email": "A String", # Email address of the service account.
316 },
317 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000318 "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.
John Asmuth614db982014-04-24 15:46:26 -0400319 { # A network interface resource attached to an instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700320 "accessConfigs": [ # An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.
John Asmuth614db982014-04-24 15:46:26 -0400321 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000322 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
323 "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 -0400324 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000325 "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 -0400326 },
327 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000328 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
329 "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 -0800330 "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:
331 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
332 # - zones/zone/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000333 "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:
334 #
335 # global/networks/default
336 #
337 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
338 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
339 # - projects/project/global/networks/network
340 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -0400341 },
342 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000343 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800344 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
345 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000346 "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 -0400347 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
348 {
349 "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.
350 "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.
351 },
352 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000353 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
354 "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 -0400355 },
356 },
357 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000358 "warning": { # [Output Only] Informational warning which replaces the list of instances when the list is empty.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800359 "message": "A String", # [Output Only] A human-readable description of the warning code.
360 "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.
361 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
362 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400363 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000364 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800365 "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 -0400366 },
367 ],
368 },
369 },
370 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000371 "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 -0800372 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
373 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400374 }</pre>
375</div>
376
377<div class="method">
378 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
379 <pre>Retrieves the next page of results.
380
381Args:
382 previous_request: The request for the previous page. (required)
383 previous_response: The response from the request for the previous page. (required)
384
385Returns:
386 A request object that you can call 'execute()' on to request the next
387 page. Returns None if there are no more items in the collection.
388 </pre>
389</div>
390
391<div class="method">
392 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body)</code>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000393 <pre>Attaches a Disk resource to an instance.
John Asmuth614db982014-04-24 15:46:26 -0400394
395Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000396 project: string, Project ID for this request. (required)
397 zone: string, The name of the zone for this request. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800398 instance: string, The instance name for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400399 body: object, The request body. (required)
400 The object takes the form of:
401
402{ # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700403 "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 +0000404 #
405 # 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.
406 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
407 "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.
408 #
409 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
410 #
411 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
412 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
413 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
414 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
415 #
416 # global/images/my-private-image
417 #
418 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
419 #
420 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
421 #
422 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
423 "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:
424 #
425 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
426 #
427 # 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:
428 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
429 # - projects/project/zones/zone/diskTypes/diskType
430 # - zones/zone/diskTypes/diskType
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700431 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000432 "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).
433 "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.
434 "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.
435 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700436 "A String",
437 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000438 "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 -0800439 "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 +0000440 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
441 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700442}
John Asmuth614db982014-04-24 15:46:26 -0400443
444
445Returns:
446 An object of the form:
447
Takashi Matsuo06694102015-09-11 13:55:40 -0700448 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800449 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
450 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000451 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800452 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
453 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
454 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
455 "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 +0000456 "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 -0800457 "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.
458 "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 -0800459 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800460 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
461 "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 +0000462 "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 -0400463 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800464 "message": "A String", # [Output Only] A human-readable description of the warning code.
465 "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.
466 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
467 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400468 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000469 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800470 "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 -0400471 },
472 ],
473 },
474 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000475 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800476 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
477 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000478 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800479 "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 +0000480 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800481 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400482 {
Craig Citroe633be12015-03-02 13:40:36 -0800483 "message": "A String", # [Output Only] An optional, human-readable error message.
484 "code": "A String", # [Output Only] The error type identifier for this error.
485 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400486 },
487 ],
488 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800489 "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 -0700490 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800491 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400492 }</pre>
493</div>
494
495<div class="method">
496 <code class="details" id="delete">delete(project, zone, instance)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800497 <pre>Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
John Asmuth614db982014-04-24 15:46:26 -0400498
499Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000500 project: string, Project ID for this request. (required)
501 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400502 instance: string, Name of the instance resource to delete. (required)
503
504Returns:
505 An object of the form:
506
Takashi Matsuo06694102015-09-11 13:55:40 -0700507 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800508 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
509 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000510 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800511 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
512 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
513 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
514 "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 +0000515 "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 -0800516 "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.
517 "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 -0800518 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800519 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
520 "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 +0000521 "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 -0400522 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800523 "message": "A String", # [Output Only] A human-readable description of the warning code.
524 "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.
525 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
526 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400527 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000528 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800529 "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 -0400530 },
531 ],
532 },
533 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000534 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800535 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
536 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000537 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800538 "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 +0000539 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800540 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400541 {
Craig Citroe633be12015-03-02 13:40:36 -0800542 "message": "A String", # [Output Only] An optional, human-readable error message.
543 "code": "A String", # [Output Only] The error type identifier for this error.
544 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400545 },
546 ],
547 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800548 "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 -0700549 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800550 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400551 }</pre>
552</div>
553
554<div class="method">
555 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</code>
556 <pre>Deletes an access config from an instance's network interface.
557
558Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000559 project: string, Project ID for this request. (required)
560 zone: string, The name of the zone for this request. (required)
561 instance: string, The instance name for this request. (required)
562 accessConfig: string, The name of the access config to delete. (required)
563 networkInterface: string, The name of the network interface. (required)
John Asmuth614db982014-04-24 15:46:26 -0400564
565Returns:
566 An object of the form:
567
Takashi Matsuo06694102015-09-11 13:55:40 -0700568 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800569 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
570 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000571 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800572 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
573 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
574 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
575 "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 +0000576 "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 -0800577 "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.
578 "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 -0800579 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800580 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
581 "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 +0000582 "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 -0400583 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800584 "message": "A String", # [Output Only] A human-readable description of the warning code.
585 "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.
586 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
587 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400588 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000589 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800590 "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 -0400591 },
592 ],
593 },
594 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000595 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800596 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
597 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000598 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800599 "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 +0000600 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800601 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400602 {
Craig Citroe633be12015-03-02 13:40:36 -0800603 "message": "A String", # [Output Only] An optional, human-readable error message.
604 "code": "A String", # [Output Only] The error type identifier for this error.
605 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400606 },
607 ],
608 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800609 "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 -0700610 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800611 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400612 }</pre>
613</div>
614
615<div class="method">
616 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName)</code>
617 <pre>Detaches a disk from an instance.
618
619Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000620 project: string, Project ID for this request. (required)
621 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400622 instance: string, Instance name. (required)
623 deviceName: string, Disk device name to detach. (required)
624
625Returns:
626 An object of the form:
627
Takashi Matsuo06694102015-09-11 13:55:40 -0700628 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800629 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
630 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000631 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800632 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
633 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
634 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
635 "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 +0000636 "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 -0800637 "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.
638 "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 -0800639 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800640 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
641 "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 +0000642 "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 -0400643 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800644 "message": "A String", # [Output Only] A human-readable description of the warning code.
645 "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.
646 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
647 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400648 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000649 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800650 "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 -0400651 },
652 ],
653 },
654 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000655 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800656 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
657 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000658 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800659 "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 +0000660 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800661 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400662 {
Craig Citroe633be12015-03-02 13:40:36 -0800663 "message": "A String", # [Output Only] An optional, human-readable error message.
664 "code": "A String", # [Output Only] The error type identifier for this error.
665 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400666 },
667 ],
668 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800669 "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 -0700670 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800671 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400672 }</pre>
673</div>
674
675<div class="method">
676 <code class="details" id="get">get(project, zone, instance)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800677 <pre>Returns the specified Instance resource.
John Asmuth614db982014-04-24 15:46:26 -0400678
679Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000680 project: string, Project ID for this request. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700681 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400682 instance: string, Name of the instance resource to return. (required)
683
684Returns:
685 An object of the form:
686
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000687 { # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000688 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
689 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000690 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
691 "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 -0800692 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000693 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
694 "tags": { # A set of instance tags. # A list of tags to appy 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 -0700695 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
696 "A String",
697 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000698 "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.
699 #
700 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700701 },
John Asmuth614db982014-04-24 15:46:26 -0400702 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
703 { # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700704 "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 +0000705 #
706 # 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.
707 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
708 "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.
709 #
710 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
711 #
712 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
713 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
714 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
715 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
716 #
717 # global/images/my-private-image
718 #
719 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
720 #
721 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
722 #
723 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
724 "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:
725 #
726 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
727 #
728 # 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:
729 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
730 # - projects/project/zones/zone/diskTypes/diskType
731 # - zones/zone/diskTypes/diskType
John Asmuth614db982014-04-24 15:46:26 -0400732 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000733 "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).
734 "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.
735 "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.
736 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700737 "A String",
738 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000739 "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 -0800740 "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 +0000741 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
742 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700743 },
John Asmuth614db982014-04-24 15:46:26 -0400744 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800745 "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 +0000746 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
747 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700748 "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.
749 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800750 "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 -0400751 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800752 "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 +0000753 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800754 # zones/us-central1-f/machineTypes/n1-standard-1
755 #
756 # 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):
757 #
758 # zones/zone/machineTypes/custom-CPUS-MEMORY
759 #
760 # For example: zones/us-central1-f/machineTypes/custom-4-5120
761 #
762 # For a full list of restrictions, read the Specifications for custom machine types.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000763 "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 Authenticating from Google Compute Engine for more information.
John Asmuth614db982014-04-24 15:46:26 -0400764 { # A service account.
765 "scopes": [ # The list of scopes to be made available for this service account.
766 "A String",
767 ],
768 "email": "A String", # Email address of the service account.
769 },
770 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000771 "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.
John Asmuth614db982014-04-24 15:46:26 -0400772 { # A network interface resource attached to an instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700773 "accessConfigs": [ # An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.
John Asmuth614db982014-04-24 15:46:26 -0400774 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000775 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
776 "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 -0400777 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000778 "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 -0400779 },
780 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000781 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
782 "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 -0800783 "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:
784 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
785 # - zones/zone/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000786 "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:
787 #
788 # global/networks/default
789 #
790 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
791 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
792 # - projects/project/global/networks/network
793 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -0400794 },
795 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000796 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800797 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
798 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000799 "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 -0400800 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
801 {
802 "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.
803 "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.
804 },
805 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000806 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
807 "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 -0400808 },
809 }</pre>
810</div>
811
812<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000813 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance, port=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400814 <pre>Returns the specified instance's serial port output.
815
816Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000817 project: string, Project ID for this request. (required)
818 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400819 instance: string, Name of the instance scoping this request. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700820 port: integer, Specifies which COM or serial port to retrieve data from.
John Asmuth614db982014-04-24 15:46:26 -0400821
822Returns:
823 An object of the form:
824
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000825 { # An instance's serial console output.
826 "kind": "compute#serialPortOutput", # [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800827 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000828 "contents": "A String", # [Output Only] The contents of the console output.
John Asmuth614db982014-04-24 15:46:26 -0400829 }</pre>
830</div>
831
832<div class="method">
833 <code class="details" id="insert">insert(project, zone, body)</code>
834 <pre>Creates an instance resource in the specified project using the data included in the request.
835
836Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000837 project: string, Project ID for this request. (required)
838 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400839 body: object, The request body. (required)
840 The object takes the form of:
841
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000842{ # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000843 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
844 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000845 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
846 "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 -0800847 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000848 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
849 "tags": { # A set of instance tags. # A list of tags to appy 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 -0700850 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
851 "A String",
852 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000853 "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.
854 #
855 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700856 },
John Asmuth614db982014-04-24 15:46:26 -0400857 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
858 { # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -0700859 "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 +0000860 #
861 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
862 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
863 "initializeParams": { # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. # [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.
864 #
865 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
866 #
867 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
868 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
869 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
870 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
871 #
872 # global/images/my-private-image
873 #
874 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
875 #
876 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
877 #
878 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
879 "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:
880 #
881 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
882 #
883 # 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:
884 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
885 # - projects/project/zones/zone/diskTypes/diskType
886 # - zones/zone/diskTypes/diskType
John Asmuth614db982014-04-24 15:46:26 -0400887 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000888 "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).
889 "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.
890 "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.
891 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700892 "A String",
893 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000894 "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 -0800895 "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 +0000896 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
897 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700898 },
John Asmuth614db982014-04-24 15:46:26 -0400899 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800900 "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 +0000901 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
902 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700903 "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.
904 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800905 "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 -0400906 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800907 "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 +0000908 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800909 # zones/us-central1-f/machineTypes/n1-standard-1
910 #
911 # 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):
912 #
913 # zones/zone/machineTypes/custom-CPUS-MEMORY
914 #
915 # For example: zones/us-central1-f/machineTypes/custom-4-5120
916 #
917 # For a full list of restrictions, read the Specifications for custom machine types.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000918 "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 Authenticating from Google Compute Engine for more information.
John Asmuth614db982014-04-24 15:46:26 -0400919 { # A service account.
920 "scopes": [ # The list of scopes to be made available for this service account.
921 "A String",
922 ],
923 "email": "A String", # Email address of the service account.
924 },
925 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000926 "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.
John Asmuth614db982014-04-24 15:46:26 -0400927 { # A network interface resource attached to an instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700928 "accessConfigs": [ # An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.
John Asmuth614db982014-04-24 15:46:26 -0400929 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000930 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
931 "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 -0400932 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000933 "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 -0400934 },
935 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000936 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
937 "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 -0800938 "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:
939 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
940 # - zones/zone/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000941 "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:
942 #
943 # global/networks/default
944 #
945 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
946 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
947 # - projects/project/global/networks/network
948 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -0400949 },
950 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000951 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800952 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
953 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000954 "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 -0400955 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
956 {
957 "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.
958 "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.
959 },
960 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000961 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
962 "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 -0400963 },
964}
965
966
967Returns:
968 An object of the form:
969
Takashi Matsuo06694102015-09-11 13:55:40 -0700970 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800971 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
972 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000973 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800974 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
975 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
976 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
977 "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 +0000978 "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 -0800979 "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.
980 "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 -0800981 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800982 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
983 "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 +0000984 "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 -0400985 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800986 "message": "A String", # [Output Only] A human-readable description of the warning code.
987 "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.
988 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
989 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400990 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000991 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800992 "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 -0400993 },
994 ],
995 },
996 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000997 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800998 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
999 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001000 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001001 "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 +00001002 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001003 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001004 {
Craig Citroe633be12015-03-02 13:40:36 -08001005 "message": "A String", # [Output Only] An optional, human-readable error message.
1006 "code": "A String", # [Output Only] The error type identifier for this error.
1007 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001008 },
1009 ],
1010 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001011 "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 -07001012 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001013 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001014 }</pre>
1015</div>
1016
1017<div class="method">
1018 <code class="details" id="list">list(project, zone, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001019 <pre>Retrieves the list of instances contained within the specified zone.
John Asmuth614db982014-04-24 15:46:26 -04001020
1021Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001022 project: string, Project ID for this request. (required)
1023 zone: string, The name of the zone for this request. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001024 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.
1025 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.
1026 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 -07001027
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001028The 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 -07001029
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001030For example, to filter for instances whose name is not equal to example-instance, you would use filter=name ne example-instance.
1031
1032Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to organize and filter results based on label values.
1033
1034The Beta API also supports filtering on multiple expressions by providing 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 -04001035
1036Returns:
1037 An object of the form:
1038
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001039 { # Contains a list of instances.
1040 "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.
1041 "items": [ # [Output Only] A list of instances.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001042 { # An Instance resource.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001043 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1044 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001045 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1046 "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 -08001047 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001048 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1049 "tags": { # A set of instance tags. # A list of tags to appy 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 -07001050 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1051 "A String",
1052 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001053 "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.
1054 #
1055 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001056 },
John Asmuth614db982014-04-24 15:46:26 -04001057 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1058 { # An instance-attached disk resource.
Takashi Matsuo06694102015-09-11 13:55:40 -07001059 "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 +00001060 #
1061 # 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.
1062 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1063 "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.
1064 #
1065 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1066 #
1067 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1068 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
1069 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1070 "sourceImage": "A String", # A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:
1071 #
1072 # global/images/my-private-image
1073 #
1074 # Or you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:
1075 #
1076 # projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD
1077 #
1078 # where vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases.
1079 "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:
1080 #
1081 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1082 #
1083 # 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:
1084 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1085 # - projects/project/zones/zone/diskTypes/diskType
1086 # - zones/zone/diskTypes/diskType
John Asmuth614db982014-04-24 15:46:26 -04001087 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001088 "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).
1089 "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.
1090 "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.
1091 "licenses": [ # [Output Only] Any valid publicly visible licenses.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001092 "A String",
1093 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001094 "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 -08001095 "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 +00001096 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
1097 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001098 },
John Asmuth614db982014-04-24 15:46:26 -04001099 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001100 "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 +00001101 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1102 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
Takashi Matsuo06694102015-09-11 13:55:40 -07001103 "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.
1104 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001105 "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 -04001106 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001107 "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 +00001108 #
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001109 # zones/us-central1-f/machineTypes/n1-standard-1
1110 #
1111 # 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):
1112 #
1113 # zones/zone/machineTypes/custom-CPUS-MEMORY
1114 #
1115 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1116 #
1117 # For a full list of restrictions, read the Specifications for custom machine types.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001118 "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 Authenticating from Google Compute Engine for more information.
John Asmuth614db982014-04-24 15:46:26 -04001119 { # A service account.
1120 "scopes": [ # The list of scopes to be made available for this service account.
1121 "A String",
1122 ],
1123 "email": "A String", # Email address of the service account.
1124 },
1125 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001126 "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.
John Asmuth614db982014-04-24 15:46:26 -04001127 { # A network interface resource attached to an instance.
Takashi Matsuo06694102015-09-11 13:55:40 -07001128 "accessConfigs": [ # An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.
John Asmuth614db982014-04-24 15:46:26 -04001129 { # An access configuration attached to an instance's network interface.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001130 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1131 "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 -04001132 "name": "A String", # Name of this access configuration.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001133 "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 -04001134 },
1135 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001136 "networkIP": "A String", # [Output Only] An optional IPV4 internal network address assigned to the instance for this network interface.
1137 "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 -08001138 "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:
1139 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/subnetworks/subnetwork
1140 # - zones/zone/subnetworks/subnetwork
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001141 "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:
1142 #
1143 # global/networks/default
1144 #
1145 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1146 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1147 # - projects/project/global/networks/network
1148 # - global/networks/default
John Asmuth614db982014-04-24 15:46:26 -04001149 },
1150 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001151 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001152 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1153 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001154 "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 -04001155 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1156 {
1157 "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.
1158 "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.
1159 },
1160 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001161 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1162 "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 -04001163 },
1164 },
1165 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001166 "kind": "compute#instanceList", # [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001167 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1168 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -04001169 }</pre>
1170</div>
1171
1172<div class="method">
1173 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1174 <pre>Retrieves the next page of results.
1175
1176Args:
1177 previous_request: The request for the previous page. (required)
1178 previous_response: The response from the request for the previous page. (required)
1179
1180Returns:
1181 A request object that you can call 'execute()' on to request the next
1182 page. Returns None if there are no more items in the collection.
1183 </pre>
1184</div>
1185
1186<div class="method">
1187 <code class="details" id="reset">reset(project, zone, instance)</code>
1188 <pre>Performs a hard reset on the instance.
1189
1190Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001191 project: string, Project ID for this request. (required)
1192 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001193 instance: string, Name of the instance scoping this request. (required)
1194
1195Returns:
1196 An object of the form:
1197
Takashi Matsuo06694102015-09-11 13:55:40 -07001198 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001199 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1200 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001201 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001202 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1203 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1204 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1205 "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 +00001206 "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 -08001207 "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.
1208 "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 -08001209 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001210 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1211 "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 +00001212 "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 -04001213 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001214 "message": "A String", # [Output Only] A human-readable description of the warning code.
1215 "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.
1216 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1217 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001218 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001219 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001220 "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 -04001221 },
1222 ],
1223 },
1224 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001225 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001226 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1227 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001228 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001229 "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 +00001230 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001231 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001232 {
Craig Citroe633be12015-03-02 13:40:36 -08001233 "message": "A String", # [Output Only] An optional, human-readable error message.
1234 "code": "A String", # [Output Only] The error type identifier for this error.
1235 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001236 },
1237 ],
1238 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001239 "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 -07001240 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001241 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001242 }</pre>
1243</div>
1244
1245<div class="method">
1246 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</code>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001247 <pre>Sets the auto-delete flag for a disk attached to an instance.
John Asmuth614db982014-04-24 15:46:26 -04001248
1249Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001250 project: string, Project ID for this request. (required)
1251 zone: string, The name of the zone for this request. (required)
1252 instance: string, The instance name. (required)
John Asmuth614db982014-04-24 15:46:26 -04001253 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required)
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001254 deviceName: string, The device name of the disk to modify. (required)
John Asmuth614db982014-04-24 15:46:26 -04001255
1256Returns:
1257 An object of the form:
1258
Takashi Matsuo06694102015-09-11 13:55:40 -07001259 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001260 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1261 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001262 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001263 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1264 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1265 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1266 "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 +00001267 "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 -08001268 "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.
1269 "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 -08001270 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001271 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1272 "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 +00001273 "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 -04001274 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001275 "message": "A String", # [Output Only] A human-readable description of the warning code.
1276 "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.
1277 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1278 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001279 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001280 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001281 "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 -04001282 },
1283 ],
1284 },
1285 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001286 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001287 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1288 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001289 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001290 "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 +00001291 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001292 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001293 {
Craig Citroe633be12015-03-02 13:40:36 -08001294 "message": "A String", # [Output Only] An optional, human-readable error message.
1295 "code": "A String", # [Output Only] The error type identifier for this error.
1296 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001297 },
1298 ],
1299 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001300 "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 -07001301 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001302 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
1303 }</pre>
1304</div>
1305
1306<div class="method">
1307 <code class="details" id="setMachineType">setMachineType(project, zone, instance, body)</code>
1308 <pre>Changes the machine type for a stopped instance to the machine type specified in the request.
1309
1310Args:
1311 project: string, Project ID for this request. (required)
1312 zone: string, The name of the zone for this request. (required)
1313 instance: string, Name of the instance scoping this request. (required)
1314 body: object, The request body. (required)
1315 The object takes the form of:
1316
1317{
1318 "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
1319 }
1320
1321
1322Returns:
1323 An object of the form:
1324
1325 { # An Operation resource, used to manage asynchronous API requests.
1326 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1327 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1328 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1329 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1330 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1331 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1332 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1333 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1334 "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.
1335 "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.
1336 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1337 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1338 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1339 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1340 {
1341 "message": "A String", # [Output Only] A human-readable description of the warning code.
1342 "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.
1343 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1344 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1345 {
1346 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1347 "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).
1348 },
1349 ],
1350 },
1351 ],
1352 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1353 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1354 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1355 "name": "A String", # [Output Only] Name of the resource.
1356 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1357 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1358 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1359 {
1360 "message": "A String", # [Output Only] An optional, human-readable error message.
1361 "code": "A String", # [Output Only] The error type identifier for this error.
1362 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
1363 },
1364 ],
1365 },
1366 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1367 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1368 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001369 }</pre>
1370</div>
1371
1372<div class="method">
1373 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body)</code>
1374 <pre>Sets metadata for the specified instance to the data included in the request.
1375
1376Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001377 project: string, Project ID for this request. (required)
1378 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001379 instance: string, Name of the instance scoping this request. (required)
1380 body: object, The request body. (required)
1381 The object takes the form of:
1382
1383{ # A metadata key/value entry.
1384 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1385 {
1386 "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.
1387 "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.
1388 },
1389 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001390 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1391 "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 -04001392}
1393
1394
1395Returns:
1396 An object of the form:
1397
Takashi Matsuo06694102015-09-11 13:55:40 -07001398 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001399 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1400 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001401 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001402 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1403 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1404 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1405 "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 +00001406 "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 -08001407 "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.
1408 "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 -08001409 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001410 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1411 "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 +00001412 "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 -04001413 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001414 "message": "A String", # [Output Only] A human-readable description of the warning code.
1415 "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.
1416 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1417 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001418 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001419 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001420 "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 -04001421 },
1422 ],
1423 },
1424 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001425 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001426 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1427 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001428 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001429 "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 +00001430 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001431 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001432 {
Craig Citroe633be12015-03-02 13:40:36 -08001433 "message": "A String", # [Output Only] An optional, human-readable error message.
1434 "code": "A String", # [Output Only] The error type identifier for this error.
1435 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001436 },
1437 ],
1438 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001439 "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 -07001440 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001441 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001442 }</pre>
1443</div>
1444
1445<div class="method">
1446 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body)</code>
1447 <pre>Sets an instance's scheduling options.
1448
1449Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001450 project: string, Project ID for this request. (required)
1451 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001452 instance: string, Instance name. (required)
1453 body: object, The request body. (required)
1454 The object takes the form of:
1455
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001456{ # Sets the scheduling options for an Instance.
Takashi Matsuo06694102015-09-11 13:55:40 -07001457 "automaticRestart": True or False, # Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted.
1458 "preemptible": True or False, # Whether the instance is preemptible.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001459 "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 -04001460}
1461
1462
1463Returns:
1464 An object of the form:
1465
Takashi Matsuo06694102015-09-11 13:55:40 -07001466 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001467 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1468 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001469 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001470 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1471 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1472 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1473 "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 +00001474 "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 -08001475 "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.
1476 "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 -08001477 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001478 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1479 "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 +00001480 "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 -04001481 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001482 "message": "A String", # [Output Only] A human-readable description of the warning code.
1483 "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.
1484 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1485 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001486 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001487 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001488 "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 -04001489 },
1490 ],
1491 },
1492 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001493 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001494 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1495 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001496 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001497 "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 +00001498 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001499 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001500 {
Craig Citroe633be12015-03-02 13:40:36 -08001501 "message": "A String", # [Output Only] An optional, human-readable error message.
1502 "code": "A String", # [Output Only] The error type identifier for this error.
1503 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001504 },
1505 ],
1506 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001507 "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 -07001508 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001509 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001510 }</pre>
1511</div>
1512
1513<div class="method">
1514 <code class="details" id="setTags">setTags(project, zone, instance, body)</code>
1515 <pre>Sets tags for the specified instance to the data included in the request.
1516
1517Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001518 project: string, Project ID for this request. (required)
1519 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -04001520 instance: string, Name of the instance scoping this request. (required)
1521 body: object, The request body. (required)
1522 The object takes the form of:
1523
1524{ # A set of instance tags.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001525 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1526 "A String",
1527 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001528 "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.
1529 #
1530 # To see the latest fingerprint, make get() request to the instance.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001531}
John Asmuth614db982014-04-24 15:46:26 -04001532
1533
1534Returns:
1535 An object of the form:
1536
Takashi Matsuo06694102015-09-11 13:55:40 -07001537 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001538 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1539 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001540 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001541 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1542 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1543 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1544 "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 +00001545 "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 -08001546 "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.
1547 "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 -08001548 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001549 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1550 "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 +00001551 "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 -04001552 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001553 "message": "A String", # [Output Only] A human-readable description of the warning code.
1554 "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.
1555 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1556 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -04001557 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001558 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001559 "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 -04001560 },
1561 ],
1562 },
1563 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001564 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001565 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1566 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001567 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001568 "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 +00001569 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001570 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -04001571 {
Craig Citroe633be12015-03-02 13:40:36 -08001572 "message": "A String", # [Output Only] An optional, human-readable error message.
1573 "code": "A String", # [Output Only] The error type identifier for this error.
1574 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -04001575 },
1576 ],
1577 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001578 "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 -07001579 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001580 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
Craig Citroe633be12015-03-02 13:40:36 -08001581 }</pre>
1582</div>
1583
1584<div class="method">
1585 <code class="details" id="start">start(project, zone, instance)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001586 <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 -08001587
1588Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001589 project: string, Project ID for this request. (required)
1590 zone: string, The name of the zone for this request. (required)
Craig Citroe633be12015-03-02 13:40:36 -08001591 instance: string, Name of the instance resource to start. (required)
1592
1593Returns:
1594 An object of the form:
1595
Takashi Matsuo06694102015-09-11 13:55:40 -07001596 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001597 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1598 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001599 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001600 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1601 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1602 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1603 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001604 "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 -08001605 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
1606 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
Craig Citroe633be12015-03-02 13:40:36 -08001607 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001608 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1609 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001610 "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 -08001611 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001612 "message": "A String", # [Output Only] A human-readable description of the warning code.
1613 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1614 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1615 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Craig Citroe633be12015-03-02 13:40:36 -08001616 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001617 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001618 "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 -08001619 },
1620 ],
1621 },
1622 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001623 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001624 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1625 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001626 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001627 "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 +00001628 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001629 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1630 {
1631 "message": "A String", # [Output Only] An optional, human-readable error message.
1632 "code": "A String", # [Output Only] The error type identifier for this error.
1633 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
1634 },
1635 ],
1636 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001637 "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 -07001638 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001639 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
Craig Citroe633be12015-03-02 13:40:36 -08001640 }</pre>
1641</div>
1642
1643<div class="method">
1644 <code class="details" id="stop">stop(project, zone, instance)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001645 <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 -08001646
1647Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001648 project: string, Project ID for this request. (required)
1649 zone: string, The name of the zone for this request. (required)
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001650 instance: string, Name of the instance resource to stop. (required)
Craig Citroe633be12015-03-02 13:40:36 -08001651
1652Returns:
1653 An object of the form:
1654
Takashi Matsuo06694102015-09-11 13:55:40 -07001655 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001656 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1657 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001658 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001659 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1660 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1661 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1662 "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 +00001663 "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 -08001664 "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.
1665 "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 -08001666 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001667 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1668 "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 +00001669 "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 -08001670 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001671 "message": "A String", # [Output Only] A human-readable description of the warning code.
1672 "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.
1673 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1674 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
Craig Citroe633be12015-03-02 13:40:36 -08001675 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001676 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001677 "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 -08001678 },
1679 ],
1680 },
1681 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001682 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001683 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1684 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001685 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001686 "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 +00001687 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -08001688 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1689 {
1690 "message": "A String", # [Output Only] An optional, human-readable error message.
1691 "code": "A String", # [Output Only] The error type identifier for this error.
1692 "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
1693 },
1694 ],
1695 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001696 "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 -07001697 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001698 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -04001699 }</pre>
1700</div>
1701
1702</body></html>