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