blob: 0d683256ca046e262edbb383445202dc7e7c1e28 [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>
82<p class="firstline">A description of how to use this function</p>
83<p class="toc_element">
84 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
85<p class="firstline">Retrieves the next page of results.</p>
86<p class="toc_element">
87 <code><a href="#attachDisk">attachDisk(project, zone, instance, body)</a></code></p>
88<p class="firstline">Attaches a disk resource to an instance.</p>
89<p class="toc_element">
90 <code><a href="#delete">delete(project, zone, instance)</a></code></p>
91<p class="firstline">Deletes the specified instance resource.</p>
92<p class="toc_element">
93 <code><a href="#deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</a></code></p>
94<p class="firstline">Deletes an access config from an instance's network interface.</p>
95<p class="toc_element">
96 <code><a href="#detachDisk">detachDisk(project, zone, instance, deviceName)</a></code></p>
97<p class="firstline">Detaches a disk from an instance.</p>
98<p class="toc_element">
99 <code><a href="#get">get(project, zone, instance)</a></code></p>
100<p class="firstline">Returns the specified instance resource.</p>
101<p class="toc_element">
102 <code><a href="#getSerialPortOutput">getSerialPortOutput(project, zone, instance)</a></code></p>
103<p class="firstline">Returns the specified instance's serial port output.</p>
104<p class="toc_element">
105 <code><a href="#insert">insert(project, zone, body)</a></code></p>
106<p class="firstline">Creates an instance resource in the specified project using the data included in the request.</p>
107<p class="toc_element">
108 <code><a href="#list">list(project, zone, maxResults=None, pageToken=None, filter=None)</a></code></p>
109<p class="firstline">Retrieves the list of instance resources contained within the specified zone.</p>
110<p class="toc_element">
111 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
112<p class="firstline">Retrieves the next page of results.</p>
113<p class="toc_element">
114 <code><a href="#reset">reset(project, zone, instance)</a></code></p>
115<p class="firstline">Performs a hard reset on the instance.</p>
116<p class="toc_element">
117 <code><a href="#setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</a></code></p>
118<p class="firstline">Sets the auto-delete flag for a disk attached to an instance</p>
119<p class="toc_element">
120 <code><a href="#setMetadata">setMetadata(project, zone, instance, body)</a></code></p>
121<p class="firstline">Sets metadata for the specified instance to the data included in the request.</p>
122<p class="toc_element">
123 <code><a href="#setScheduling">setScheduling(project, zone, instance, body)</a></code></p>
124<p class="firstline">Sets an instance's scheduling options.</p>
125<p class="toc_element">
126 <code><a href="#setTags">setTags(project, zone, instance, body)</a></code></p>
127<p class="firstline">Sets tags for the specified instance to the data included in the request.</p>
128<h3>Method Details</h3>
129<div class="method">
130 <code class="details" id="addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body)</code>
131 <pre>Adds an access config to an instance's network interface.
132
133Args:
134 project: string, Project name. (required)
135 zone: string, Name of the zone scoping this request. (required)
136 instance: string, Instance name. (required)
137 networkInterface: string, Network interface name. (required)
138 body: object, The request body. (required)
139 The object takes the form of:
140
141{ # An access configuration attached to an instance's network interface.
142 "kind": "compute#accessConfig", # Type of the resource.
143 "type": "ONE_TO_ONE_NAT", # Type of configuration. Must be set to "ONE_TO_ONE_NAT". This configures port-for-port NAT to the internet.
144 "name": "A String", # Name of this access configuration.
145 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool.
146}
147
148
149Returns:
150 An object of the form:
151
152 { # An operation resource, used to manage asynchronous API requests.
153 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
154 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
155 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
156 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
157 "zone": "A String", # URL of the zone where the operation resides (output only).
158 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
159 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
160 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
161 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
162 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
163 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
164 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
165 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
166 {
167 "message": "A String", # Optional human-readable details for this warning.
168 "code": "A String", # The warning type identifier for this warning.
169 "data": [ # Metadata for this warning in 'key: value' format.
170 {
171 "value": "A String", # A warning data value corresponding to the key.
172 "key": "A String", # A key for the warning data.
173 },
174 ],
175 },
176 ],
177 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
178 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
179 "kind": "compute#operation", # Type of the resource.
180 "name": "A String", # Name of the resource (output only).
181 "region": "A String", # URL of the region where the operation resides (output only).
182 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
183 "errors": [ # The array of errors encountered while processing this operation.
184 {
185 "message": "A String", # An optional, human-readable error message.
186 "code": "A String", # The error type identifier for this error.
187 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
188 },
189 ],
190 },
191 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
192 "selfLink": "A String", # Server defined URL for the resource (output only).
193 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
194 }</pre>
195</div>
196
197<div class="method">
198 <code class="details" id="aggregatedList">aggregatedList(project, maxResults=None, pageToken=None, filter=None)</code>
199 <pre>A description of how to use this function
200
201Args:
202 project: string, Name of the project scoping this request. (required)
203 maxResults: integer, Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.
204 pageToken: string, Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
205 filter: string, Optional. Filter expression for filtering listed resources.
206
207Returns:
208 An object of the form:
209
210 {
211 "nextPageToken": "A String", # A token used to continue a truncated list request (output only).
212 "items": { # A map of scoped instance lists.
213 "a_key": { # Name of the scope containing this set of instances.
214 "instances": [ # List of instances contained in this scope.
215 { # An instance resource.
216 "status": "A String", # Instance status. One of the following values: "PROVISIONING", "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output only).
217 "kind": "compute#instance", # Type of the resource.
218 "canIpForward": True or False, # Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false.
219 "description": "A String", # An optional textual description of the resource; provided by the client when the resource is created.
220 "zone": "A String", # URL of the zone where the instance resides (output only).
221 "tags": { # A set of instance tags. # A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
222 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
223 "A String",
224 ],
225 "fingerprint": "A String", # Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.
226 },
227 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
228 { # An instance-attached disk resource.
229 "deviceName": "A String", # Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system.
230 "kind": "compute#attachedDisk", # Type of the resource.
231 "initializeParams": { # Initialization parameters for the new disk (Mutually exclusive with 'source', can currently only be specified on the boot disk). # Initialization parameters.
232 "diskSizeGb": "A String", # Size of the disk in base-2 GB.
233 "diskName": "A String", # Name of the disk (when not provided defaults to the name of the instance).
234 "sourceImage": "A String", # The source image used to create this disk.
235 },
236 "autoDelete": True or False, # Whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
237 "index": 42, # A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).
238 "boot": True or False, # Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem.
239 "source": "A String", # Persistent disk only; the URL of the persistent disk resource.
240 "mode": "A String", # The mode in which to attach this disk, either "READ_WRITE" or "READ_ONLY".
241 "type": "A String", # Type of the disk, either "SCRATCH" or "PERSISTENT". Note that persistent disks must be created before you can specify them here.
242 },
243 ],
244 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.
245 "statusMessage": "A String", # An optional, human-readable explanation of the status (output only).
246 "scheduling": { # Scheduling options for an Instance. # Scheduling options for this instance.
247 "automaticRestart": True or False, # Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user).
248 "onHostMaintenance": "A String", # How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.
249 },
250 "machineType": "A String", # URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.
251 "serviceAccounts": [ # A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.
252 { # A service account.
253 "scopes": [ # The list of scopes to be made available for this service account.
254 "A String",
255 ],
256 "email": "A String", # Email address of the service account.
257 },
258 ],
259 "networkInterfaces": [ # 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. 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.
260 { # A network interface resource attached to an instance.
261 "accessConfigs": [ # 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. 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.
262 { # An access configuration attached to an instance's network interface.
263 "kind": "compute#accessConfig", # Type of the resource.
264 "type": "ONE_TO_ONE_NAT", # Type of configuration. Must be set to "ONE_TO_ONE_NAT". This configures port-for-port NAT to the internet.
265 "name": "A String", # Name of this access configuration.
266 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool.
267 },
268 ],
269 "networkIP": "A String", # An optional IPV4 internal network address assigned to the instance for this network interface (output only).
270 "name": "A String", # Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only).
271 "network": "A String", # URL of the network resource attached to this interface.
272 },
273 ],
274 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
275 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
276 "selfLink": "A String", # Server defined URL for this resource (output only).
277 "metadata": { # A metadata key/value entry. # Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information.
278 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
279 {
280 "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.
281 "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.
282 },
283 ],
284 "kind": "compute#metadata", # Type of the resource.
285 "fingerprint": "A String", # Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.
286 },
287 },
288 ],
289 "warning": { # Informational warning which replaces the list of instances when the list is empty.
290 "message": "A String", # Optional human-readable details for this warning.
291 "code": "A String", # The warning type identifier for this warning.
292 "data": [ # Metadata for this warning in 'key: value' format.
293 {
294 "value": "A String", # A warning data value corresponding to the key.
295 "key": "A String", # A key for the warning data.
296 },
297 ],
298 },
299 },
300 },
301 "kind": "compute#instanceAggregatedList", # Type of resource.
302 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
303 "selfLink": "A String", # Server defined URL for this resource (output only).
304 }</pre>
305</div>
306
307<div class="method">
308 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
309 <pre>Retrieves the next page of results.
310
311Args:
312 previous_request: The request for the previous page. (required)
313 previous_response: The response from the request for the previous page. (required)
314
315Returns:
316 A request object that you can call 'execute()' on to request the next
317 page. Returns None if there are no more items in the collection.
318 </pre>
319</div>
320
321<div class="method">
322 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body)</code>
323 <pre>Attaches a disk resource to an instance.
324
325Args:
326 project: string, Project name. (required)
327 zone: string, Name of the zone scoping this request. (required)
328 instance: string, Instance name. (required)
329 body: object, The request body. (required)
330 The object takes the form of:
331
332{ # An instance-attached disk resource.
333 "deviceName": "A String", # Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system.
334 "kind": "compute#attachedDisk", # Type of the resource.
335 "initializeParams": { # Initialization parameters for the new disk (Mutually exclusive with 'source', can currently only be specified on the boot disk). # Initialization parameters.
336 "diskSizeGb": "A String", # Size of the disk in base-2 GB.
337 "diskName": "A String", # Name of the disk (when not provided defaults to the name of the instance).
338 "sourceImage": "A String", # The source image used to create this disk.
339 },
340 "autoDelete": True or False, # Whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
341 "index": 42, # A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).
342 "boot": True or False, # Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem.
343 "source": "A String", # Persistent disk only; the URL of the persistent disk resource.
344 "mode": "A String", # The mode in which to attach this disk, either "READ_WRITE" or "READ_ONLY".
345 "type": "A String", # Type of the disk, either "SCRATCH" or "PERSISTENT". Note that persistent disks must be created before you can specify them here.
346 }
347
348
349Returns:
350 An object of the form:
351
352 { # An operation resource, used to manage asynchronous API requests.
353 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
354 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
355 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
356 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
357 "zone": "A String", # URL of the zone where the operation resides (output only).
358 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
359 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
360 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
361 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
362 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
363 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
364 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
365 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
366 {
367 "message": "A String", # Optional human-readable details for this warning.
368 "code": "A String", # The warning type identifier for this warning.
369 "data": [ # Metadata for this warning in 'key: value' format.
370 {
371 "value": "A String", # A warning data value corresponding to the key.
372 "key": "A String", # A key for the warning data.
373 },
374 ],
375 },
376 ],
377 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
378 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
379 "kind": "compute#operation", # Type of the resource.
380 "name": "A String", # Name of the resource (output only).
381 "region": "A String", # URL of the region where the operation resides (output only).
382 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
383 "errors": [ # The array of errors encountered while processing this operation.
384 {
385 "message": "A String", # An optional, human-readable error message.
386 "code": "A String", # The error type identifier for this error.
387 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
388 },
389 ],
390 },
391 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
392 "selfLink": "A String", # Server defined URL for the resource (output only).
393 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
394 }</pre>
395</div>
396
397<div class="method">
398 <code class="details" id="delete">delete(project, zone, instance)</code>
399 <pre>Deletes the specified instance resource.
400
401Args:
402 project: string, Name of the project scoping this request. (required)
403 zone: string, Name of the zone scoping this request. (required)
404 instance: string, Name of the instance resource to delete. (required)
405
406Returns:
407 An object of the form:
408
409 { # An operation resource, used to manage asynchronous API requests.
410 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
411 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
412 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
413 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
414 "zone": "A String", # URL of the zone where the operation resides (output only).
415 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
416 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
417 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
418 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
419 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
420 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
421 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
422 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
423 {
424 "message": "A String", # Optional human-readable details for this warning.
425 "code": "A String", # The warning type identifier for this warning.
426 "data": [ # Metadata for this warning in 'key: value' format.
427 {
428 "value": "A String", # A warning data value corresponding to the key.
429 "key": "A String", # A key for the warning data.
430 },
431 ],
432 },
433 ],
434 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
435 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
436 "kind": "compute#operation", # Type of the resource.
437 "name": "A String", # Name of the resource (output only).
438 "region": "A String", # URL of the region where the operation resides (output only).
439 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
440 "errors": [ # The array of errors encountered while processing this operation.
441 {
442 "message": "A String", # An optional, human-readable error message.
443 "code": "A String", # The error type identifier for this error.
444 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
445 },
446 ],
447 },
448 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
449 "selfLink": "A String", # Server defined URL for the resource (output only).
450 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
451 }</pre>
452</div>
453
454<div class="method">
455 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</code>
456 <pre>Deletes an access config from an instance's network interface.
457
458Args:
459 project: string, Project name. (required)
460 zone: string, Name of the zone scoping this request. (required)
461 instance: string, Instance name. (required)
462 accessConfig: string, Access config name. (required)
463 networkInterface: string, Network interface name. (required)
464
465Returns:
466 An object of the form:
467
468 { # An operation resource, used to manage asynchronous API requests.
469 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
470 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
471 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
472 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
473 "zone": "A String", # URL of the zone where the operation resides (output only).
474 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
475 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
476 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
477 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
478 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
479 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
480 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
481 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
482 {
483 "message": "A String", # Optional human-readable details for this warning.
484 "code": "A String", # The warning type identifier for this warning.
485 "data": [ # Metadata for this warning in 'key: value' format.
486 {
487 "value": "A String", # A warning data value corresponding to the key.
488 "key": "A String", # A key for the warning data.
489 },
490 ],
491 },
492 ],
493 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
494 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
495 "kind": "compute#operation", # Type of the resource.
496 "name": "A String", # Name of the resource (output only).
497 "region": "A String", # URL of the region where the operation resides (output only).
498 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
499 "errors": [ # The array of errors encountered while processing this operation.
500 {
501 "message": "A String", # An optional, human-readable error message.
502 "code": "A String", # The error type identifier for this error.
503 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
504 },
505 ],
506 },
507 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
508 "selfLink": "A String", # Server defined URL for the resource (output only).
509 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
510 }</pre>
511</div>
512
513<div class="method">
514 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName)</code>
515 <pre>Detaches a disk from an instance.
516
517Args:
518 project: string, Project name. (required)
519 zone: string, Name of the zone scoping this request. (required)
520 instance: string, Instance name. (required)
521 deviceName: string, Disk device name to detach. (required)
522
523Returns:
524 An object of the form:
525
526 { # An operation resource, used to manage asynchronous API requests.
527 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
528 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
529 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
530 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
531 "zone": "A String", # URL of the zone where the operation resides (output only).
532 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
533 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
534 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
535 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
536 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
537 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
538 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
539 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
540 {
541 "message": "A String", # Optional human-readable details for this warning.
542 "code": "A String", # The warning type identifier for this warning.
543 "data": [ # Metadata for this warning in 'key: value' format.
544 {
545 "value": "A String", # A warning data value corresponding to the key.
546 "key": "A String", # A key for the warning data.
547 },
548 ],
549 },
550 ],
551 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
552 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
553 "kind": "compute#operation", # Type of the resource.
554 "name": "A String", # Name of the resource (output only).
555 "region": "A String", # URL of the region where the operation resides (output only).
556 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
557 "errors": [ # The array of errors encountered while processing this operation.
558 {
559 "message": "A String", # An optional, human-readable error message.
560 "code": "A String", # The error type identifier for this error.
561 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
562 },
563 ],
564 },
565 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
566 "selfLink": "A String", # Server defined URL for the resource (output only).
567 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
568 }</pre>
569</div>
570
571<div class="method">
572 <code class="details" id="get">get(project, zone, instance)</code>
573 <pre>Returns the specified instance resource.
574
575Args:
576 project: string, Name of the project scoping this request. (required)
577 zone: string, Name of the zone scoping this request. (required)
578 instance: string, Name of the instance resource to return. (required)
579
580Returns:
581 An object of the form:
582
583 { # An instance resource.
584 "status": "A String", # Instance status. One of the following values: "PROVISIONING", "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output only).
585 "kind": "compute#instance", # Type of the resource.
586 "canIpForward": True or False, # Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false.
587 "description": "A String", # An optional textual description of the resource; provided by the client when the resource is created.
588 "zone": "A String", # URL of the zone where the instance resides (output only).
589 "tags": { # A set of instance tags. # A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
590 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
591 "A String",
592 ],
593 "fingerprint": "A String", # Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.
594 },
595 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
596 { # An instance-attached disk resource.
597 "deviceName": "A String", # Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system.
598 "kind": "compute#attachedDisk", # Type of the resource.
599 "initializeParams": { # Initialization parameters for the new disk (Mutually exclusive with 'source', can currently only be specified on the boot disk). # Initialization parameters.
600 "diskSizeGb": "A String", # Size of the disk in base-2 GB.
601 "diskName": "A String", # Name of the disk (when not provided defaults to the name of the instance).
602 "sourceImage": "A String", # The source image used to create this disk.
603 },
604 "autoDelete": True or False, # Whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
605 "index": 42, # A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).
606 "boot": True or False, # Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem.
607 "source": "A String", # Persistent disk only; the URL of the persistent disk resource.
608 "mode": "A String", # The mode in which to attach this disk, either "READ_WRITE" or "READ_ONLY".
609 "type": "A String", # Type of the disk, either "SCRATCH" or "PERSISTENT". Note that persistent disks must be created before you can specify them here.
610 },
611 ],
612 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.
613 "statusMessage": "A String", # An optional, human-readable explanation of the status (output only).
614 "scheduling": { # Scheduling options for an Instance. # Scheduling options for this instance.
615 "automaticRestart": True or False, # Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user).
616 "onHostMaintenance": "A String", # How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.
617 },
618 "machineType": "A String", # URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.
619 "serviceAccounts": [ # A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.
620 { # A service account.
621 "scopes": [ # The list of scopes to be made available for this service account.
622 "A String",
623 ],
624 "email": "A String", # Email address of the service account.
625 },
626 ],
627 "networkInterfaces": [ # 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. 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.
628 { # A network interface resource attached to an instance.
629 "accessConfigs": [ # 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. 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.
630 { # An access configuration attached to an instance's network interface.
631 "kind": "compute#accessConfig", # Type of the resource.
632 "type": "ONE_TO_ONE_NAT", # Type of configuration. Must be set to "ONE_TO_ONE_NAT". This configures port-for-port NAT to the internet.
633 "name": "A String", # Name of this access configuration.
634 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool.
635 },
636 ],
637 "networkIP": "A String", # An optional IPV4 internal network address assigned to the instance for this network interface (output only).
638 "name": "A String", # Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only).
639 "network": "A String", # URL of the network resource attached to this interface.
640 },
641 ],
642 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
643 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
644 "selfLink": "A String", # Server defined URL for this resource (output only).
645 "metadata": { # A metadata key/value entry. # Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information.
646 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
647 {
648 "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.
649 "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.
650 },
651 ],
652 "kind": "compute#metadata", # Type of the resource.
653 "fingerprint": "A String", # Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.
654 },
655 }</pre>
656</div>
657
658<div class="method">
659 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance)</code>
660 <pre>Returns the specified instance's serial port output.
661
662Args:
663 project: string, Name of the project scoping this request. (required)
664 zone: string, Name of the zone scoping this request. (required)
665 instance: string, Name of the instance scoping this request. (required)
666
667Returns:
668 An object of the form:
669
670 { # An instance serial console output.
671 "kind": "compute#serialPortOutput", # Type of the resource.
672 "selfLink": "A String", # Server defined URL for the resource (output only).
673 "contents": "A String", # The contents of the console output.
674 }</pre>
675</div>
676
677<div class="method">
678 <code class="details" id="insert">insert(project, zone, body)</code>
679 <pre>Creates an instance resource in the specified project using the data included in the request.
680
681Args:
682 project: string, Name of the project scoping this request. (required)
683 zone: string, Name of the zone scoping this request. (required)
684 body: object, The request body. (required)
685 The object takes the form of:
686
687{ # An instance resource.
688 "status": "A String", # Instance status. One of the following values: "PROVISIONING", "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output only).
689 "kind": "compute#instance", # Type of the resource.
690 "canIpForward": True or False, # Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false.
691 "description": "A String", # An optional textual description of the resource; provided by the client when the resource is created.
692 "zone": "A String", # URL of the zone where the instance resides (output only).
693 "tags": { # A set of instance tags. # A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
694 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
695 "A String",
696 ],
697 "fingerprint": "A String", # Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.
698 },
699 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
700 { # An instance-attached disk resource.
701 "deviceName": "A String", # Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system.
702 "kind": "compute#attachedDisk", # Type of the resource.
703 "initializeParams": { # Initialization parameters for the new disk (Mutually exclusive with 'source', can currently only be specified on the boot disk). # Initialization parameters.
704 "diskSizeGb": "A String", # Size of the disk in base-2 GB.
705 "diskName": "A String", # Name of the disk (when not provided defaults to the name of the instance).
706 "sourceImage": "A String", # The source image used to create this disk.
707 },
708 "autoDelete": True or False, # Whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
709 "index": 42, # A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).
710 "boot": True or False, # Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem.
711 "source": "A String", # Persistent disk only; the URL of the persistent disk resource.
712 "mode": "A String", # The mode in which to attach this disk, either "READ_WRITE" or "READ_ONLY".
713 "type": "A String", # Type of the disk, either "SCRATCH" or "PERSISTENT". Note that persistent disks must be created before you can specify them here.
714 },
715 ],
716 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.
717 "statusMessage": "A String", # An optional, human-readable explanation of the status (output only).
718 "scheduling": { # Scheduling options for an Instance. # Scheduling options for this instance.
719 "automaticRestart": True or False, # Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user).
720 "onHostMaintenance": "A String", # How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.
721 },
722 "machineType": "A String", # URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.
723 "serviceAccounts": [ # A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.
724 { # A service account.
725 "scopes": [ # The list of scopes to be made available for this service account.
726 "A String",
727 ],
728 "email": "A String", # Email address of the service account.
729 },
730 ],
731 "networkInterfaces": [ # 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. 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.
732 { # A network interface resource attached to an instance.
733 "accessConfigs": [ # 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. 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.
734 { # An access configuration attached to an instance's network interface.
735 "kind": "compute#accessConfig", # Type of the resource.
736 "type": "ONE_TO_ONE_NAT", # Type of configuration. Must be set to "ONE_TO_ONE_NAT". This configures port-for-port NAT to the internet.
737 "name": "A String", # Name of this access configuration.
738 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool.
739 },
740 ],
741 "networkIP": "A String", # An optional IPV4 internal network address assigned to the instance for this network interface (output only).
742 "name": "A String", # Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only).
743 "network": "A String", # URL of the network resource attached to this interface.
744 },
745 ],
746 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
747 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
748 "selfLink": "A String", # Server defined URL for this resource (output only).
749 "metadata": { # A metadata key/value entry. # Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information.
750 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
751 {
752 "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.
753 "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.
754 },
755 ],
756 "kind": "compute#metadata", # Type of the resource.
757 "fingerprint": "A String", # Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.
758 },
759}
760
761
762Returns:
763 An object of the form:
764
765 { # An operation resource, used to manage asynchronous API requests.
766 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
767 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
768 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
769 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
770 "zone": "A String", # URL of the zone where the operation resides (output only).
771 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
772 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
773 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
774 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
775 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
776 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
777 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
778 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
779 {
780 "message": "A String", # Optional human-readable details for this warning.
781 "code": "A String", # The warning type identifier for this warning.
782 "data": [ # Metadata for this warning in 'key: value' format.
783 {
784 "value": "A String", # A warning data value corresponding to the key.
785 "key": "A String", # A key for the warning data.
786 },
787 ],
788 },
789 ],
790 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
791 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
792 "kind": "compute#operation", # Type of the resource.
793 "name": "A String", # Name of the resource (output only).
794 "region": "A String", # URL of the region where the operation resides (output only).
795 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
796 "errors": [ # The array of errors encountered while processing this operation.
797 {
798 "message": "A String", # An optional, human-readable error message.
799 "code": "A String", # The error type identifier for this error.
800 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
801 },
802 ],
803 },
804 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
805 "selfLink": "A String", # Server defined URL for the resource (output only).
806 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
807 }</pre>
808</div>
809
810<div class="method">
811 <code class="details" id="list">list(project, zone, maxResults=None, pageToken=None, filter=None)</code>
812 <pre>Retrieves the list of instance resources contained within the specified zone.
813
814Args:
815 project: string, Name of the project scoping this request. (required)
816 zone: string, Name of the zone scoping this request. (required)
817 maxResults: integer, Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500.
818 pageToken: string, Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
819 filter: string, Optional. Filter expression for filtering listed resources.
820
821Returns:
822 An object of the form:
823
824 { # Contains a list of instance resources.
825 "nextPageToken": "A String", # A token used to continue a truncated list request (output only).
826 "items": [ # A list of instance resources.
827 { # An instance resource.
828 "status": "A String", # Instance status. One of the following values: "PROVISIONING", "STAGING", "RUNNING", "STOPPING", "STOPPED", "TERMINATED" (output only).
829 "kind": "compute#instance", # Type of the resource.
830 "canIpForward": True or False, # Allows this instance to send packets with source IP addresses other than its own and receive packets with destination IP addresses other than its own. If this instance will be used as an IP gateway or it will be set as the next-hop in a Route resource, say true. If unsure, leave this set to false.
831 "description": "A String", # An optional textual description of the resource; provided by the client when the resource is created.
832 "zone": "A String", # URL of the zone where the instance resides (output only).
833 "tags": { # A set of instance tags. # A list of tags to be applied to this instance. Used to identify valid sources or targets for network firewalls. Provided by the client on instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035.
834 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
835 "A String",
836 ],
837 "fingerprint": "A String", # Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.
838 },
839 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
840 { # An instance-attached disk resource.
841 "deviceName": "A String", # Persistent disk only; must be unique within the instance when specified. This represents a unique device name that is reflected into the /dev/ tree of a Linux operating system running within the instance. If not specified, a default will be chosen by the system.
842 "kind": "compute#attachedDisk", # Type of the resource.
843 "initializeParams": { # Initialization parameters for the new disk (Mutually exclusive with 'source', can currently only be specified on the boot disk). # Initialization parameters.
844 "diskSizeGb": "A String", # Size of the disk in base-2 GB.
845 "diskName": "A String", # Name of the disk (when not provided defaults to the name of the instance).
846 "sourceImage": "A String", # The source image used to create this disk.
847 },
848 "autoDelete": True or False, # Whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
849 "index": 42, # A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, the server will choose an appropriate value (output only).
850 "boot": True or False, # Indicates that this is a boot disk. VM will use the first partition of the disk for its root filesystem.
851 "source": "A String", # Persistent disk only; the URL of the persistent disk resource.
852 "mode": "A String", # The mode in which to attach this disk, either "READ_WRITE" or "READ_ONLY".
853 "type": "A String", # Type of the disk, either "SCRATCH" or "PERSISTENT". Note that persistent disks must be created before you can specify them here.
854 },
855 ],
856 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.
857 "statusMessage": "A String", # An optional, human-readable explanation of the status (output only).
858 "scheduling": { # Scheduling options for an Instance. # Scheduling options for this instance.
859 "automaticRestart": True or False, # Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user).
860 "onHostMaintenance": "A String", # How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.
861 },
862 "machineType": "A String", # URL of the machine type resource describing which machine type to use to host the instance; provided by the client when the instance is created.
863 "serviceAccounts": [ # A list of service accounts each with specified scopes, for which access tokens are to be made available to the instance through metadata queries.
864 { # A service account.
865 "scopes": [ # The list of scopes to be made available for this service account.
866 "A String",
867 ],
868 "email": "A String", # Email address of the service account.
869 },
870 ],
871 "networkInterfaces": [ # 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. 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.
872 { # A network interface resource attached to an instance.
873 "accessConfigs": [ # 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. 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.
874 { # An access configuration attached to an instance's network interface.
875 "kind": "compute#accessConfig", # Type of the resource.
876 "type": "ONE_TO_ONE_NAT", # Type of configuration. Must be set to "ONE_TO_ONE_NAT". This configures port-for-port NAT to the internet.
877 "name": "A String", # Name of this access configuration.
878 "natIP": "A String", # An external IP address associated with this instance. Specify an unused static IP address available to the project. If not specified, the external IP will be drawn from a shared ephemeral pool.
879 },
880 ],
881 "networkIP": "A String", # An optional IPV4 internal network address assigned to the instance for this network interface (output only).
882 "name": "A String", # Name of the network interface, determined by the server; for network devices, these are e.g. eth0, eth1, etc. (output only).
883 "network": "A String", # URL of the network resource attached to this interface.
884 },
885 ],
886 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
887 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
888 "selfLink": "A String", # Server defined URL for this resource (output only).
889 "metadata": { # A metadata key/value entry. # Metadata key/value pairs assigned to this instance. Consists of custom metadata or predefined keys; see Instance documentation for more information.
890 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
891 {
892 "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.
893 "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.
894 },
895 ],
896 "kind": "compute#metadata", # Type of the resource.
897 "fingerprint": "A String", # Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.
898 },
899 },
900 ],
901 "kind": "compute#instanceList", # Type of resource.
902 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
903 "selfLink": "A String", # Server defined URL for this resource (output only).
904 }</pre>
905</div>
906
907<div class="method">
908 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
909 <pre>Retrieves the next page of results.
910
911Args:
912 previous_request: The request for the previous page. (required)
913 previous_response: The response from the request for the previous page. (required)
914
915Returns:
916 A request object that you can call 'execute()' on to request the next
917 page. Returns None if there are no more items in the collection.
918 </pre>
919</div>
920
921<div class="method">
922 <code class="details" id="reset">reset(project, zone, instance)</code>
923 <pre>Performs a hard reset on the instance.
924
925Args:
926 project: string, Name of the project scoping this request. (required)
927 zone: string, Name of the zone scoping this request. (required)
928 instance: string, Name of the instance scoping this request. (required)
929
930Returns:
931 An object of the form:
932
933 { # An operation resource, used to manage asynchronous API requests.
934 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
935 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
936 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
937 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
938 "zone": "A String", # URL of the zone where the operation resides (output only).
939 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
940 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
941 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
942 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
943 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
944 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
945 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
946 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
947 {
948 "message": "A String", # Optional human-readable details for this warning.
949 "code": "A String", # The warning type identifier for this warning.
950 "data": [ # Metadata for this warning in 'key: value' format.
951 {
952 "value": "A String", # A warning data value corresponding to the key.
953 "key": "A String", # A key for the warning data.
954 },
955 ],
956 },
957 ],
958 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
959 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
960 "kind": "compute#operation", # Type of the resource.
961 "name": "A String", # Name of the resource (output only).
962 "region": "A String", # URL of the region where the operation resides (output only).
963 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
964 "errors": [ # The array of errors encountered while processing this operation.
965 {
966 "message": "A String", # An optional, human-readable error message.
967 "code": "A String", # The error type identifier for this error.
968 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
969 },
970 ],
971 },
972 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
973 "selfLink": "A String", # Server defined URL for the resource (output only).
974 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
975 }</pre>
976</div>
977
978<div class="method">
979 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</code>
980 <pre>Sets the auto-delete flag for a disk attached to an instance
981
982Args:
983 project: string, Project name. (required)
984 zone: string, Name of the zone scoping this request. (required)
985 instance: string, Instance name. (required)
986 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required)
987 deviceName: string, Disk device name to modify. (required)
988
989Returns:
990 An object of the form:
991
992 { # An operation resource, used to manage asynchronous API requests.
993 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
994 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
995 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
996 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
997 "zone": "A String", # URL of the zone where the operation resides (output only).
998 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
999 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
1000 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
1001 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
1002 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
1003 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
1004 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
1005 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
1006 {
1007 "message": "A String", # Optional human-readable details for this warning.
1008 "code": "A String", # The warning type identifier for this warning.
1009 "data": [ # Metadata for this warning in 'key: value' format.
1010 {
1011 "value": "A String", # A warning data value corresponding to the key.
1012 "key": "A String", # A key for the warning data.
1013 },
1014 ],
1015 },
1016 ],
1017 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
1018 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
1019 "kind": "compute#operation", # Type of the resource.
1020 "name": "A String", # Name of the resource (output only).
1021 "region": "A String", # URL of the region where the operation resides (output only).
1022 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
1023 "errors": [ # The array of errors encountered while processing this operation.
1024 {
1025 "message": "A String", # An optional, human-readable error message.
1026 "code": "A String", # The error type identifier for this error.
1027 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
1028 },
1029 ],
1030 },
1031 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
1032 "selfLink": "A String", # Server defined URL for the resource (output only).
1033 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
1034 }</pre>
1035</div>
1036
1037<div class="method">
1038 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body)</code>
1039 <pre>Sets metadata for the specified instance to the data included in the request.
1040
1041Args:
1042 project: string, Name of the project scoping this request. (required)
1043 zone: string, Name of the zone scoping this request. (required)
1044 instance: string, Name of the instance scoping this request. (required)
1045 body: object, The request body. (required)
1046 The object takes the form of:
1047
1048{ # A metadata key/value entry.
1049 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1050 {
1051 "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.
1052 "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.
1053 },
1054 ],
1055 "kind": "compute#metadata", # Type of the resource.
1056 "fingerprint": "A String", # Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.
1057}
1058
1059
1060Returns:
1061 An object of the form:
1062
1063 { # An operation resource, used to manage asynchronous API requests.
1064 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
1065 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
1066 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
1067 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
1068 "zone": "A String", # URL of the zone where the operation resides (output only).
1069 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
1070 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
1071 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
1072 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
1073 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
1074 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
1075 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
1076 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
1077 {
1078 "message": "A String", # Optional human-readable details for this warning.
1079 "code": "A String", # The warning type identifier for this warning.
1080 "data": [ # Metadata for this warning in 'key: value' format.
1081 {
1082 "value": "A String", # A warning data value corresponding to the key.
1083 "key": "A String", # A key for the warning data.
1084 },
1085 ],
1086 },
1087 ],
1088 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
1089 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
1090 "kind": "compute#operation", # Type of the resource.
1091 "name": "A String", # Name of the resource (output only).
1092 "region": "A String", # URL of the region where the operation resides (output only).
1093 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
1094 "errors": [ # The array of errors encountered while processing this operation.
1095 {
1096 "message": "A String", # An optional, human-readable error message.
1097 "code": "A String", # The error type identifier for this error.
1098 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
1099 },
1100 ],
1101 },
1102 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
1103 "selfLink": "A String", # Server defined URL for the resource (output only).
1104 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
1105 }</pre>
1106</div>
1107
1108<div class="method">
1109 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body)</code>
1110 <pre>Sets an instance's scheduling options.
1111
1112Args:
1113 project: string, Project name. (required)
1114 zone: string, Name of the zone scoping this request. (required)
1115 instance: string, Instance name. (required)
1116 body: object, The request body. (required)
1117 The object takes the form of:
1118
1119{ # Scheduling options for an Instance.
1120 "automaticRestart": True or False, # Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user).
1121 "onHostMaintenance": "A String", # How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.
1122}
1123
1124
1125Returns:
1126 An object of the form:
1127
1128 { # An operation resource, used to manage asynchronous API requests.
1129 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
1130 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
1131 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
1132 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
1133 "zone": "A String", # URL of the zone where the operation resides (output only).
1134 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
1135 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
1136 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
1137 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
1138 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
1139 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
1140 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
1141 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
1142 {
1143 "message": "A String", # Optional human-readable details for this warning.
1144 "code": "A String", # The warning type identifier for this warning.
1145 "data": [ # Metadata for this warning in 'key: value' format.
1146 {
1147 "value": "A String", # A warning data value corresponding to the key.
1148 "key": "A String", # A key for the warning data.
1149 },
1150 ],
1151 },
1152 ],
1153 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
1154 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
1155 "kind": "compute#operation", # Type of the resource.
1156 "name": "A String", # Name of the resource (output only).
1157 "region": "A String", # URL of the region where the operation resides (output only).
1158 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
1159 "errors": [ # The array of errors encountered while processing this operation.
1160 {
1161 "message": "A String", # An optional, human-readable error message.
1162 "code": "A String", # The error type identifier for this error.
1163 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
1164 },
1165 ],
1166 },
1167 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
1168 "selfLink": "A String", # Server defined URL for the resource (output only).
1169 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
1170 }</pre>
1171</div>
1172
1173<div class="method">
1174 <code class="details" id="setTags">setTags(project, zone, instance, body)</code>
1175 <pre>Sets tags for the specified instance to the data included in the request.
1176
1177Args:
1178 project: string, Name of the project scoping this request. (required)
1179 zone: string, Name of the zone scoping this request. (required)
1180 instance: string, Name of the instance scoping this request. (required)
1181 body: object, The request body. (required)
1182 The object takes the form of:
1183
1184{ # A set of instance tags.
1185 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1186 "A String",
1187 ],
1188 "fingerprint": "A String", # Fingerprint of this resource. A hash of the tags stored in this object. This field is used optimistic locking. An up-to-date tags fingerprint must be provided in order to modify tags.
1189 }
1190
1191
1192Returns:
1193 An object of the form:
1194
1195 { # An operation resource, used to manage asynchronous API requests.
1196 "targetId": "A String", # Unique target id which identifies a particular incarnation of the target (output only).
1197 "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
1198 "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
1199 "id": "A String", # Unique identifier for the resource; defined by the server (output only).
1200 "zone": "A String", # URL of the zone where the operation resides (output only).
1201 "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
1202 "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
1203 "progress": 42, # 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 at when the operation will be complete. This number should be monotonically increasing as the operation progresses (output only).
1204 "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
1205 "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
1206 "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
1207 "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
1208 "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
1209 {
1210 "message": "A String", # Optional human-readable details for this warning.
1211 "code": "A String", # The warning type identifier for this warning.
1212 "data": [ # Metadata for this warning in 'key: value' format.
1213 {
1214 "value": "A String", # A warning data value corresponding to the key.
1215 "key": "A String", # A key for the warning data.
1216 },
1217 ],
1218 },
1219 ],
1220 "user": "A String", # User who requested the operation, for example "user@example.com" (output only).
1221 "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
1222 "kind": "compute#operation", # Type of the resource.
1223 "name": "A String", # Name of the resource (output only).
1224 "region": "A String", # URL of the region where the operation resides (output only).
1225 "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
1226 "errors": [ # The array of errors encountered while processing this operation.
1227 {
1228 "message": "A String", # An optional, human-readable error message.
1229 "code": "A String", # The error type identifier for this error.
1230 "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
1231 },
1232 ],
1233 },
1234 "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
1235 "selfLink": "A String", # Server defined URL for the resource (output only).
1236 "targetLink": "A String", # URL of the resource the operation is mutating (output only).
1237 }</pre>
1238</div>
1239
1240</body></html>