blob: 4359b5be3fc6a0918e78ab2731bc5bd8cd3df2fc [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_alpha.html">Compute Engine API</a> . <a href="compute_alpha.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, forceAttach=None)</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="#getIamPolicy">getIamPolicy(project, zone, resource)</a></code></p>
103<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
104<p class="toc_element">
105 <code><a href="#getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</a></code></p>
106<p class="firstline">Returns the specified instance's serial port output.</p>
107<p class="toc_element">
108 <code><a href="#insert">insert(project, zone, body)</a></code></p>
109<p class="firstline">Creates an instance resource in the specified project using the data included in the request.</p>
110<p class="toc_element">
111 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
112<p class="firstline">Retrieves the list of instances contained within the specified zone.</p>
113<p class="toc_element">
114 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
115<p class="firstline">Retrieves the next page of results.</p>
116<p class="toc_element">
117 <code><a href="#reset">reset(project, zone, instance)</a></code></p>
118<p class="firstline">Performs a hard reset on the instance.</p>
119<p class="toc_element">
120 <code><a href="#setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</a></code></p>
121<p class="firstline">Sets the auto-delete flag for a disk attached to an instance.</p>
122<p class="toc_element">
123 <code><a href="#setIamPolicy">setIamPolicy(project, zone, resource, body)</a></code></p>
124<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
125<p class="toc_element">
126 <code><a href="#setLabels">setLabels(project, zone, instance, body)</a></code></p>
127<p class="firstline">Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.</p>
128<p class="toc_element">
129 <code><a href="#setMachineType">setMachineType(project, zone, instance, body)</a></code></p>
130<p class="firstline">Changes the machine type for a stopped instance to the machine type specified in the request.</p>
131<p class="toc_element">
132 <code><a href="#setMetadata">setMetadata(project, zone, instance, body)</a></code></p>
133<p class="firstline">Sets metadata for the specified instance to the data included in the request.</p>
134<p class="toc_element">
135 <code><a href="#setScheduling">setScheduling(project, zone, instance, body)</a></code></p>
136<p class="firstline">Sets an instance's scheduling options.</p>
137<p class="toc_element">
138 <code><a href="#setServiceAccount">setServiceAccount(project, zone, instance, body)</a></code></p>
139<p class="firstline">Sets the service account on the instance.</p>
140<p class="toc_element">
141 <code><a href="#setTags">setTags(project, zone, instance, body)</a></code></p>
142<p class="firstline">Sets tags for the specified instance to the data included in the request.</p>
143<p class="toc_element">
144 <code><a href="#start">start(project, zone, instance)</a></code></p>
145<p class="firstline">Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.</p>
146<p class="toc_element">
147 <code><a href="#startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</a></code></p>
148<p class="firstline">Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.</p>
149<p class="toc_element">
150 <code><a href="#stop">stop(project, zone, instance, discardLocalSsd=None)</a></code></p>
151<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>
152<p class="toc_element">
153 <code><a href="#suspend">suspend(project, zone, instance, discardLocalSsd=None)</a></code></p>
154<p class="firstline">This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances incur reduced per-minute, virtual machine usage charges while they are suspended. Any resources the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted.</p>
155<p class="toc_element">
156 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p>
157<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
158<p class="toc_element">
159 <code><a href="#updateAccessConfig">updateAccessConfig(project, zone, instance, networkInterface, body)</a></code></p>
160<p class="firstline">Updates the specified access config from an instance's network interface with the data included in the request.</p>
161<h3>Method Details</h3>
162<div class="method">
163 <code class="details" id="addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body)</code>
164 <pre>Adds an access config to an instance's network interface.
165
166Args:
167 project: string, Project ID for this request. (required)
168 zone: string, The name of the zone for this request. (required)
169 instance: string, The instance name for this request. (required)
170 networkInterface: string, The name of the network interface to add to this instance. (required)
171 body: object, The request body. (required)
172 The object takes the form of:
173
174{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
175 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
176 "name": "A String", # Name of this access configuration.
177 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
178 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM , STANDARD. If this field is not specified, it is assumed to be PREMIUM.
179 "ptrDomainName": "A String", # The DNS domain name for the public PTR record. This field can only be set when the set_ptr field is enabled.
180 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
181 "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.
182 "setPtr": True or False, # Specifies whether a public DNS ?PTR? record should be created to map the external IP address of the instance to a DNS domain name.
183 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
184}
185
186
187Returns:
188 An object of the form:
189
190 { # An Operation resource, used to manage asynchronous API requests.
191 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
192 "clientOperationId": "A String", # [Output Only] Reserved for future use.
193 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
194 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
195 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
196 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
197 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
198 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
199 "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.
200 "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.
201 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
202 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
203 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
204 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
205 {
206 "message": "A String", # [Output Only] A human-readable description of the warning code.
207 "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.
208 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
209 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
210 {
211 "value": "A String", # [Output Only] A warning data value corresponding to the key.
212 "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).
213 },
214 ],
215 },
216 ],
217 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
218 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
219 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
220 "name": "A String", # [Output Only] Name of the resource.
221 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
222 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
223 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
224 {
225 "message": "A String", # [Output Only] An optional, human-readable error message.
226 "code": "A String", # [Output Only] The error type identifier for this error.
227 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
228 },
229 ],
230 },
231 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
232 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
233 "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.
234 }</pre>
235</div>
236
237<div class="method">
238 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
239 <pre>Retrieves aggregated list of instances.
240
241Args:
242 project: string, Project ID for this request. (required)
243 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
244
245You 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.
246
247Currently, only sorting by name or creationTimestamp desc is supported.
248 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.
249 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.
250 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.
251
252The 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.
253
254For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
255
256You 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.
257
258To 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.
259
260Returns:
261 An object of the form:
262
263 {
264 "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.
265 "items": { # [Output Only] A map of scoped instance lists.
266 "a_key": { # [Output Only] Name of the scope containing this set of instances.
267 "instances": [ # [Output Only] List of instances contained in this scope.
268 { # An Instance resource.
269 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
270 "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.
271 "a_key": "A String",
272 },
273 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
274 "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.
275 "preemptible": True or False, # Whether the instance is preemptible.
276 "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.
277 },
278 "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:
279 #
280 # zones/us-central1-f/machineTypes/n1-standard-1
281 #
282 # 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):
283 #
284 # zones/zone/machineTypes/custom-CPUS-MEMORY
285 #
286 # For example: zones/us-central1-f/machineTypes/custom-4-5120
287 #
288 # For a full list of restrictions, read the Specifications for custom machine types.
289 "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.
290 { # A service account.
291 "scopes": [ # The list of scopes to be made available for this service account.
292 "A String",
293 ],
294 "email": "A String", # Email address of the service account.
295 },
296 ],
297 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
298 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
299 "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.
300 { # A network interface resource attached to an instance.
301 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
302 { # An alias IP range attached to an instance's network interface.
303 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
304 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
305 },
306 ],
307 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
308 "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.
309 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
310 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
311 "name": "A String", # Name of this access configuration.
312 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
313 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM , STANDARD. If this field is not specified, it is assumed to be PREMIUM.
314 "ptrDomainName": "A String", # The DNS domain name for the public PTR record. This field can only be set when the set_ptr field is enabled.
315 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
316 "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.
317 "setPtr": True or False, # Specifies whether a public DNS ?PTR? record should be created to map the external IP address of the instance to a DNS domain name.
318 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
319 },
320 ],
321 "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.
322 "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:
323 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
324 # - regions/region/subnetworks/subnetwork
325 "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:
326 #
327 # global/networks/default
328 #
329 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
330 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
331 # - projects/project/global/networks/network
332 # - global/networks/default
333 },
334 ],
335 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
336 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts data for an instance with a customer-supplied encryption key.
337 #
338 # If you are creating a new instance, this field encrypts the local SSD and in-memory contents of the instance using a key that you provide.
339 #
340 # If you are restarting an instance protected with a customer-supplied encryption key, you must provide the correct key in order to successfully restart the instance.
341 #
342 # If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key and you do not need to provide a key to start the instance later.
343 #
344 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt local SSDs and in-memory content in a managed instance group.
345 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
346 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
347 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
348 #
349 # The key must meet the following requirements before you can provide it to Compute Engine:
350 # - The key is wrapped using a RSA public key certificate provided by Google.
351 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
352 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
353 },
354 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
355 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
356 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
357 {
358 "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.
359 "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.
360 },
361 ],
362 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
363 "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.
364 },
365 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
366 "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.
367 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
368 "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.
369 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
370 "A String",
371 ],
372 "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.
373 #
374 # To see the latest fingerprint, make get() request to the instance.
375 },
376 "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.
377 #
378 # To see the latest fingerprint, make get() request to the instance.
379 "host": "A String", # Full or partial URL of the host resource that the instance should be placed on, in the format: zones/zone/hosts/host.
380 #
381 # Optional, Private Host (physical machine) that the instance will be placed on when it's created. The instance is guaranteed to be placed on the same machine as other instances with the same private host.
382 #
383 # The request will be rejected if the private host has run out of resources.
384 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
385 "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.
386 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
387 { # An instance-attached disk resource.
388 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
389 #
390 # 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.
391 #
392 # 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.
393 #
394 # 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.
395 #
396 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
397 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
398 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
399 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
400 #
401 # The key must meet the following requirements before you can provide it to Compute Engine:
402 # - The key is wrapped using a RSA public key certificate provided by Google.
403 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
404 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
405 },
406 "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.
407 #
408 # 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.
409 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
410 "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.
411 #
412 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
413 #
414 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
415 "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.
416 #
417 # 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.
418 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
419 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
420 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
421 #
422 # The key must meet the following requirements before you can provide it to Compute Engine:
423 # - The key is wrapped using a RSA public key certificate provided by Google.
424 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
425 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
426 },
427 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
428 "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:
429 #
430 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
431 #
432 # 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:
433 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
434 # - projects/project/zones/zone/diskTypes/diskType
435 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
436 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
437 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
438 #
439 # 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:
440 #
441 # projects/debian-cloud/global/images/family/debian-8
442 #
443 # Alternatively, use a specific version of a public operating system image:
444 #
445 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
446 #
447 # To create a disk with a private image that you created, specify the image name in the following format:
448 #
449 # global/images/my-private-image
450 #
451 # 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:
452 #
453 # global/images/family/my-private-family
454 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
455 },
456 "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).
457 "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.
458 "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.
459 "licenses": [ # [Output Only] Any valid publicly visible licenses.
460 "A String",
461 ],
462 "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.
463 "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.
464 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
465 "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.
466 },
467 ],
468 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
469 },
470 ],
471 "warning": { # [Output Only] Informational warning which replaces the list of instances when the list is empty.
472 "message": "A String", # [Output Only] A human-readable description of the warning code.
473 "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.
474 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
475 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
476 {
477 "value": "A String", # [Output Only] A warning data value corresponding to the key.
478 "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).
479 },
480 ],
481 },
482 },
483 },
484 "kind": "compute#instanceAggregatedList", # [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources.
485 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
486 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
487 }</pre>
488</div>
489
490<div class="method">
491 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
492 <pre>Retrieves the next page of results.
493
494Args:
495 previous_request: The request for the previous page. (required)
496 previous_response: The response from the request for the previous page. (required)
497
498Returns:
499 A request object that you can call 'execute()' on to request the next
500 page. Returns None if there are no more items in the collection.
501 </pre>
502</div>
503
504<div class="method">
505 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body, forceAttach=None)</code>
506 <pre>Attaches a Disk resource to an instance.
507
508Args:
509 project: string, Project ID for this request. (required)
510 zone: string, The name of the zone for this request. (required)
511 instance: string, The instance name for this request. (required)
512 body: object, The request body. (required)
513 The object takes the form of:
514
515{ # An instance-attached disk resource.
516 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
517 #
518 # 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.
519 #
520 # 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.
521 #
522 # 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.
523 #
524 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
525 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
526 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
527 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
528 #
529 # The key must meet the following requirements before you can provide it to Compute Engine:
530 # - The key is wrapped using a RSA public key certificate provided by Google.
531 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
532 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
533 },
534 "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.
535 #
536 # 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.
537 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
538 "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.
539 #
540 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
541 #
542 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
543 "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.
544 #
545 # 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.
546 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
547 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
548 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
549 #
550 # The key must meet the following requirements before you can provide it to Compute Engine:
551 # - The key is wrapped using a RSA public key certificate provided by Google.
552 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
553 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
554 },
555 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
556 "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:
557 #
558 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
559 #
560 # 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:
561 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
562 # - projects/project/zones/zone/diskTypes/diskType
563 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
564 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
565 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
566 #
567 # 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:
568 #
569 # projects/debian-cloud/global/images/family/debian-8
570 #
571 # Alternatively, use a specific version of a public operating system image:
572 #
573 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
574 #
575 # To create a disk with a private image that you created, specify the image name in the following format:
576 #
577 # global/images/my-private-image
578 #
579 # 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:
580 #
581 # global/images/family/my-private-family
582 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
583 },
584 "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).
585 "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.
586 "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.
587 "licenses": [ # [Output Only] Any valid publicly visible licenses.
588 "A String",
589 ],
590 "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.
591 "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.
592 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
593 "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.
594}
595
596 forceAttach: boolean, Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.
597
598Returns:
599 An object of the form:
600
601 { # An Operation resource, used to manage asynchronous API requests.
602 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
603 "clientOperationId": "A String", # [Output Only] Reserved for future use.
604 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
605 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
606 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
607 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
608 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
609 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
610 "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.
611 "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.
612 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
613 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
614 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
615 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
616 {
617 "message": "A String", # [Output Only] A human-readable description of the warning code.
618 "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.
619 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
620 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
621 {
622 "value": "A String", # [Output Only] A warning data value corresponding to the key.
623 "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).
624 },
625 ],
626 },
627 ],
628 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
629 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
630 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
631 "name": "A String", # [Output Only] Name of the resource.
632 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
633 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
634 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
635 {
636 "message": "A String", # [Output Only] An optional, human-readable error message.
637 "code": "A String", # [Output Only] The error type identifier for this error.
638 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
639 },
640 ],
641 },
642 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
643 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
644 "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.
645 }</pre>
646</div>
647
648<div class="method">
649 <code class="details" id="delete">delete(project, zone, instance)</code>
650 <pre>Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
651
652Args:
653 project: string, Project ID for this request. (required)
654 zone: string, The name of the zone for this request. (required)
655 instance: string, Name of the instance resource to delete. (required)
656
657Returns:
658 An object of the form:
659
660 { # An Operation resource, used to manage asynchronous API requests.
661 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
662 "clientOperationId": "A String", # [Output Only] Reserved for future use.
663 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
664 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
665 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
666 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
667 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
668 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
669 "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.
670 "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.
671 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
672 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
673 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
674 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
675 {
676 "message": "A String", # [Output Only] A human-readable description of the warning code.
677 "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.
678 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
679 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
680 {
681 "value": "A String", # [Output Only] A warning data value corresponding to the key.
682 "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).
683 },
684 ],
685 },
686 ],
687 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
688 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
689 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
690 "name": "A String", # [Output Only] Name of the resource.
691 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
692 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
693 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
694 {
695 "message": "A String", # [Output Only] An optional, human-readable error message.
696 "code": "A String", # [Output Only] The error type identifier for this error.
697 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
698 },
699 ],
700 },
701 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
702 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
703 "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.
704 }</pre>
705</div>
706
707<div class="method">
708 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</code>
709 <pre>Deletes an access config from an instance's network interface.
710
711Args:
712 project: string, Project ID for this request. (required)
713 zone: string, The name of the zone for this request. (required)
714 instance: string, The instance name for this request. (required)
715 accessConfig: string, The name of the access config to delete. (required)
716 networkInterface: string, The name of the network interface. (required)
717
718Returns:
719 An object of the form:
720
721 { # An Operation resource, used to manage asynchronous API requests.
722 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
723 "clientOperationId": "A String", # [Output Only] Reserved for future use.
724 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
725 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
726 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
727 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
728 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
729 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
730 "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.
731 "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.
732 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
733 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
734 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
735 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
736 {
737 "message": "A String", # [Output Only] A human-readable description of the warning code.
738 "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.
739 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
740 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
741 {
742 "value": "A String", # [Output Only] A warning data value corresponding to the key.
743 "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).
744 },
745 ],
746 },
747 ],
748 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
749 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
750 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
751 "name": "A String", # [Output Only] Name of the resource.
752 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
753 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
754 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
755 {
756 "message": "A String", # [Output Only] An optional, human-readable error message.
757 "code": "A String", # [Output Only] The error type identifier for this error.
758 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
759 },
760 ],
761 },
762 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
763 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
764 "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.
765 }</pre>
766</div>
767
768<div class="method">
769 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName)</code>
770 <pre>Detaches a disk from an instance.
771
772Args:
773 project: string, Project ID for this request. (required)
774 zone: string, The name of the zone for this request. (required)
775 instance: string, Instance name. (required)
776 deviceName: string, Disk device name to detach. (required)
777
778Returns:
779 An object of the form:
780
781 { # An Operation resource, used to manage asynchronous API requests.
782 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
783 "clientOperationId": "A String", # [Output Only] Reserved for future use.
784 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
785 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
786 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
787 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
788 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
789 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
790 "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.
791 "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.
792 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
793 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
794 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
795 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
796 {
797 "message": "A String", # [Output Only] A human-readable description of the warning code.
798 "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.
799 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
800 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
801 {
802 "value": "A String", # [Output Only] A warning data value corresponding to the key.
803 "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).
804 },
805 ],
806 },
807 ],
808 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
809 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
810 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
811 "name": "A String", # [Output Only] Name of the resource.
812 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
813 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
814 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
815 {
816 "message": "A String", # [Output Only] An optional, human-readable error message.
817 "code": "A String", # [Output Only] The error type identifier for this error.
818 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
819 },
820 ],
821 },
822 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
823 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
824 "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.
825 }</pre>
826</div>
827
828<div class="method">
829 <code class="details" id="get">get(project, zone, instance)</code>
830 <pre>Returns the specified Instance resource. Get a list of available instances by making a list() request.
831
832Args:
833 project: string, Project ID for this request. (required)
834 zone: string, The name of the zone for this request. (required)
835 instance: string, Name of the instance resource to return. (required)
836
837Returns:
838 An object of the form:
839
840 { # An Instance resource.
841 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
842 "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.
843 "a_key": "A String",
844 },
845 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
846 "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.
847 "preemptible": True or False, # Whether the instance is preemptible.
848 "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.
849 },
850 "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:
851 #
852 # zones/us-central1-f/machineTypes/n1-standard-1
853 #
854 # 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):
855 #
856 # zones/zone/machineTypes/custom-CPUS-MEMORY
857 #
858 # For example: zones/us-central1-f/machineTypes/custom-4-5120
859 #
860 # For a full list of restrictions, read the Specifications for custom machine types.
861 "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.
862 { # A service account.
863 "scopes": [ # The list of scopes to be made available for this service account.
864 "A String",
865 ],
866 "email": "A String", # Email address of the service account.
867 },
868 ],
869 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
870 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
871 "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.
872 { # A network interface resource attached to an instance.
873 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
874 { # An alias IP range attached to an instance's network interface.
875 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
876 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
877 },
878 ],
879 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
880 "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.
881 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
882 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
883 "name": "A String", # Name of this access configuration.
884 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
885 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM , STANDARD. If this field is not specified, it is assumed to be PREMIUM.
886 "ptrDomainName": "A String", # The DNS domain name for the public PTR record. This field can only be set when the set_ptr field is enabled.
887 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
888 "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.
889 "setPtr": True or False, # Specifies whether a public DNS ?PTR? record should be created to map the external IP address of the instance to a DNS domain name.
890 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
891 },
892 ],
893 "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.
894 "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:
895 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
896 # - regions/region/subnetworks/subnetwork
897 "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:
898 #
899 # global/networks/default
900 #
901 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
902 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
903 # - projects/project/global/networks/network
904 # - global/networks/default
905 },
906 ],
907 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
908 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts data for an instance with a customer-supplied encryption key.
909 #
910 # If you are creating a new instance, this field encrypts the local SSD and in-memory contents of the instance using a key that you provide.
911 #
912 # If you are restarting an instance protected with a customer-supplied encryption key, you must provide the correct key in order to successfully restart the instance.
913 #
914 # If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key and you do not need to provide a key to start the instance later.
915 #
916 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt local SSDs and in-memory content in a managed instance group.
917 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
918 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
919 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
920 #
921 # The key must meet the following requirements before you can provide it to Compute Engine:
922 # - The key is wrapped using a RSA public key certificate provided by Google.
923 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
924 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
925 },
926 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
927 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
928 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
929 {
930 "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.
931 "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.
932 },
933 ],
934 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
935 "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.
936 },
937 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
938 "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.
939 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
940 "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.
941 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
942 "A String",
943 ],
944 "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.
945 #
946 # To see the latest fingerprint, make get() request to the instance.
947 },
948 "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.
949 #
950 # To see the latest fingerprint, make get() request to the instance.
951 "host": "A String", # Full or partial URL of the host resource that the instance should be placed on, in the format: zones/zone/hosts/host.
952 #
953 # Optional, Private Host (physical machine) that the instance will be placed on when it's created. The instance is guaranteed to be placed on the same machine as other instances with the same private host.
954 #
955 # The request will be rejected if the private host has run out of resources.
956 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
957 "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.
958 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
959 { # An instance-attached disk resource.
960 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
961 #
962 # 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.
963 #
964 # 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.
965 #
966 # 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.
967 #
968 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
969 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
970 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
971 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
972 #
973 # The key must meet the following requirements before you can provide it to Compute Engine:
974 # - The key is wrapped using a RSA public key certificate provided by Google.
975 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
976 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
977 },
978 "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.
979 #
980 # 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.
981 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
982 "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.
983 #
984 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
985 #
986 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
987 "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.
988 #
989 # 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.
990 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
991 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
992 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
993 #
994 # The key must meet the following requirements before you can provide it to Compute Engine:
995 # - The key is wrapped using a RSA public key certificate provided by Google.
996 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
997 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
998 },
999 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1000 "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:
1001 #
1002 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1003 #
1004 # 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:
1005 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1006 # - projects/project/zones/zone/diskTypes/diskType
1007 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1008 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
1009 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
1010 #
1011 # 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:
1012 #
1013 # projects/debian-cloud/global/images/family/debian-8
1014 #
1015 # Alternatively, use a specific version of a public operating system image:
1016 #
1017 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1018 #
1019 # To create a disk with a private image that you created, specify the image name in the following format:
1020 #
1021 # global/images/my-private-image
1022 #
1023 # 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:
1024 #
1025 # global/images/family/my-private-family
1026 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1027 },
1028 "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).
1029 "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.
1030 "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.
1031 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1032 "A String",
1033 ],
1034 "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.
1035 "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.
1036 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
1037 "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.
1038 },
1039 ],
1040 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1041 }</pre>
1042</div>
1043
1044<div class="method">
1045 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource)</code>
1046 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
1047
1048Args:
1049 project: string, Project ID for this request. (required)
1050 zone: string, The name of the zone for this request. (required)
1051 resource: string, Name of the resource for this request. (required)
1052
1053Returns:
1054 An object of the form:
1055
1056 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
1057 #
1058 #
1059 #
1060 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.
1061 #
1062 # **Example**
1063 #
1064 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] }
1065 #
1066 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).
1067 "auditConfigs": [ # Specifies audit logging configs for "data access". "data access": generally refers to data reads/writes and admin reads. "admin activity": generally refers to admin writes.
1068 #
1069 # Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging.
1070 { # Enables "data access" audit logging for a service and specifies a list of members that are log-exempted.
1071 "exemptedMembers": [ # Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of Binding.members.
1072 "A String",
1073 ],
1074 "service": "A String", # Specifies a service that will be enabled for "data access" audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a special value that covers all services.
1075 },
1076 ],
1077 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1078 { # A rule to be applied in a Policy.
1079 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1080 { # Specifies what kind of log the caller must write
1081 "counter": { # Options for counters # Counter options.
1082 "field": "A String", # The field value to attribute.
1083 "metric": "A String", # The metric to update.
1084 },
1085 },
1086 ],
1087 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1088 "A String",
1089 ],
1090 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1091 "A String",
1092 ],
1093 "action": "A String", # Required
1094 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1095 "A String",
1096 ],
1097 "conditions": [ # Additional restrictions that must be met
1098 { # A condition to be met.
1099 "iam": "A String", # Trusted attributes supplied by the IAM system.
1100 "svc": "A String", # Trusted attributes discharged by the service.
1101 "value": "A String", # DEPRECATED. Use 'values' instead.
1102 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1103 "values": [ # The objects of the condition. This is mutually exclusive with 'value'.
1104 "A String",
1105 ],
1106 "op": "A String", # An operator to apply the subject with.
1107 },
1108 ],
1109 "description": "A String", # Human-readable description of the rule.
1110 },
1111 ],
1112 "version": 42, # Version of the `Policy`. The default version is 0.
1113 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1114 #
1115 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
1116 "bindings": [ # Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.
1117 { # Associates `members` with a `role`.
1118 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1119 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1120 #
1121 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1122 #
1123 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1124 #
1125 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.
1126 #
1127 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1128 #
1129 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1130 #
1131 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.
1132 "A String",
1133 ],
1134 },
1135 ],
1136 "iamOwned": True or False,
1137 }</pre>
1138</div>
1139
1140<div class="method">
1141 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</code>
1142 <pre>Returns the specified instance's serial port output.
1143
1144Args:
1145 project: string, Project ID for this request. (required)
1146 zone: string, The name of the zone for this request. (required)
1147 instance: string, Name of the instance scoping this request. (required)
1148 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.
1149 port: integer, Specifies which COM or serial port to retrieve data from.
1150
1151Returns:
1152 An object of the form:
1153
1154 { # An instance's serial console output.
1155 "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.
1156 "kind": "compute#serialPortOutput", # [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.
1157 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1158 "contents": "A String", # [Output Only] The contents of the console output.
1159 "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.
1160 }</pre>
1161</div>
1162
1163<div class="method">
1164 <code class="details" id="insert">insert(project, zone, body)</code>
1165 <pre>Creates an instance resource in the specified project using the data included in the request.
1166
1167Args:
1168 project: string, Project ID for this request. (required)
1169 zone: string, The name of the zone for this request. (required)
1170 body: object, The request body. (required)
1171 The object takes the form of:
1172
1173{ # An Instance resource.
1174 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1175 "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.
1176 "a_key": "A String",
1177 },
1178 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1179 "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.
1180 "preemptible": True or False, # Whether the instance is preemptible.
1181 "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.
1182 },
1183 "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:
1184 #
1185 # zones/us-central1-f/machineTypes/n1-standard-1
1186 #
1187 # 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):
1188 #
1189 # zones/zone/machineTypes/custom-CPUS-MEMORY
1190 #
1191 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1192 #
1193 # For a full list of restrictions, read the Specifications for custom machine types.
1194 "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.
1195 { # A service account.
1196 "scopes": [ # The list of scopes to be made available for this service account.
1197 "A String",
1198 ],
1199 "email": "A String", # Email address of the service account.
1200 },
1201 ],
1202 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1203 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1204 "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.
1205 { # A network interface resource attached to an instance.
1206 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
1207 { # An alias IP range attached to an instance's network interface.
1208 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
1209 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
1210 },
1211 ],
1212 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1213 "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.
1214 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1215 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1216 "name": "A String", # Name of this access configuration.
1217 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
1218 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM , STANDARD. If this field is not specified, it is assumed to be PREMIUM.
1219 "ptrDomainName": "A String", # The DNS domain name for the public PTR record. This field can only be set when the set_ptr field is enabled.
1220 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
1221 "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.
1222 "setPtr": True or False, # Specifies whether a public DNS ?PTR? record should be created to map the external IP address of the instance to a DNS domain name.
1223 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1224 },
1225 ],
1226 "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.
1227 "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:
1228 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1229 # - regions/region/subnetworks/subnetwork
1230 "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:
1231 #
1232 # global/networks/default
1233 #
1234 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1235 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1236 # - projects/project/global/networks/network
1237 # - global/networks/default
1238 },
1239 ],
1240 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1241 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts data for an instance with a customer-supplied encryption key.
1242 #
1243 # If you are creating a new instance, this field encrypts the local SSD and in-memory contents of the instance using a key that you provide.
1244 #
1245 # If you are restarting an instance protected with a customer-supplied encryption key, you must provide the correct key in order to successfully restart the instance.
1246 #
1247 # If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key and you do not need to provide a key to start the instance later.
1248 #
1249 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt local SSDs and in-memory content in a managed instance group.
1250 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1251 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1252 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1253 #
1254 # The key must meet the following requirements before you can provide it to Compute Engine:
1255 # - The key is wrapped using a RSA public key certificate provided by Google.
1256 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1257 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1258 },
1259 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1260 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1261 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1262 {
1263 "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.
1264 "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.
1265 },
1266 ],
1267 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1268 "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.
1269 },
1270 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1271 "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.
1272 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1273 "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.
1274 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1275 "A String",
1276 ],
1277 "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.
1278 #
1279 # To see the latest fingerprint, make get() request to the instance.
1280 },
1281 "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.
1282 #
1283 # To see the latest fingerprint, make get() request to the instance.
1284 "host": "A String", # Full or partial URL of the host resource that the instance should be placed on, in the format: zones/zone/hosts/host.
1285 #
1286 # Optional, Private Host (physical machine) that the instance will be placed on when it's created. The instance is guaranteed to be placed on the same machine as other instances with the same private host.
1287 #
1288 # The request will be rejected if the private host has run out of resources.
1289 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1290 "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.
1291 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1292 { # An instance-attached disk resource.
1293 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1294 #
1295 # 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.
1296 #
1297 # 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.
1298 #
1299 # 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.
1300 #
1301 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1302 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1303 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1304 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1305 #
1306 # The key must meet the following requirements before you can provide it to Compute Engine:
1307 # - The key is wrapped using a RSA public key certificate provided by Google.
1308 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1309 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1310 },
1311 "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.
1312 #
1313 # 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.
1314 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1315 "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.
1316 #
1317 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1318 #
1319 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1320 "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.
1321 #
1322 # 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.
1323 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1324 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1325 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1326 #
1327 # The key must meet the following requirements before you can provide it to Compute Engine:
1328 # - The key is wrapped using a RSA public key certificate provided by Google.
1329 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1330 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1331 },
1332 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1333 "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:
1334 #
1335 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1336 #
1337 # 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:
1338 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1339 # - projects/project/zones/zone/diskTypes/diskType
1340 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1341 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
1342 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
1343 #
1344 # 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:
1345 #
1346 # projects/debian-cloud/global/images/family/debian-8
1347 #
1348 # Alternatively, use a specific version of a public operating system image:
1349 #
1350 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1351 #
1352 # To create a disk with a private image that you created, specify the image name in the following format:
1353 #
1354 # global/images/my-private-image
1355 #
1356 # 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:
1357 #
1358 # global/images/family/my-private-family
1359 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1360 },
1361 "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).
1362 "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.
1363 "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.
1364 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1365 "A String",
1366 ],
1367 "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.
1368 "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.
1369 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
1370 "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.
1371 },
1372 ],
1373 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1374}
1375
1376
1377Returns:
1378 An object of the form:
1379
1380 { # An Operation resource, used to manage asynchronous API requests.
1381 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1382 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1383 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1384 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1385 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1386 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1387 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1388 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1389 "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.
1390 "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.
1391 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1392 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1393 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1394 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1395 {
1396 "message": "A String", # [Output Only] A human-readable description of the warning code.
1397 "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.
1398 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1399 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1400 {
1401 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1402 "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).
1403 },
1404 ],
1405 },
1406 ],
1407 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1408 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1409 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1410 "name": "A String", # [Output Only] Name of the resource.
1411 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1412 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1413 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1414 {
1415 "message": "A String", # [Output Only] An optional, human-readable error message.
1416 "code": "A String", # [Output Only] The error type identifier for this error.
1417 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1418 },
1419 ],
1420 },
1421 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1422 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1423 "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.
1424 }</pre>
1425</div>
1426
1427<div class="method">
1428 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
1429 <pre>Retrieves the list of instances contained within the specified zone.
1430
1431Args:
1432 project: string, Project ID for this request. (required)
1433 zone: string, The name of the zone for this request. (required)
1434 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1435
1436You 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.
1437
1438Currently, only sorting by name or creationTimestamp desc is supported.
1439 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.
1440 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.
1441 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.
1442
1443The 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.
1444
1445For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
1446
1447You 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.
1448
1449To 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.
1450
1451Returns:
1452 An object of the form:
1453
1454 { # Contains a list of instances.
1455 "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.
1456 "items": [ # [Output Only] A list of instances.
1457 { # An Instance resource.
1458 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1459 "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.
1460 "a_key": "A String",
1461 },
1462 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1463 "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.
1464 "preemptible": True or False, # Whether the instance is preemptible.
1465 "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.
1466 },
1467 "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:
1468 #
1469 # zones/us-central1-f/machineTypes/n1-standard-1
1470 #
1471 # 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):
1472 #
1473 # zones/zone/machineTypes/custom-CPUS-MEMORY
1474 #
1475 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1476 #
1477 # For a full list of restrictions, read the Specifications for custom machine types.
1478 "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.
1479 { # A service account.
1480 "scopes": [ # The list of scopes to be made available for this service account.
1481 "A String",
1482 ],
1483 "email": "A String", # Email address of the service account.
1484 },
1485 ],
1486 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1487 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1488 "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.
1489 { # A network interface resource attached to an instance.
1490 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
1491 { # An alias IP range attached to an instance's network interface.
1492 "subnetworkRangeName": "A String", # Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used.
1493 "ipCidrRange": "A String", # The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
1494 },
1495 ],
1496 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1497 "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.
1498 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1499 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1500 "name": "A String", # Name of this access configuration.
1501 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
1502 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM , STANDARD. If this field is not specified, it is assumed to be PREMIUM.
1503 "ptrDomainName": "A String", # The DNS domain name for the public PTR record. This field can only be set when the set_ptr field is enabled.
1504 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
1505 "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.
1506 "setPtr": True or False, # Specifies whether a public DNS ?PTR? record should be created to map the external IP address of the instance to a DNS domain name.
1507 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1508 },
1509 ],
1510 "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.
1511 "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:
1512 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1513 # - regions/region/subnetworks/subnetwork
1514 "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:
1515 #
1516 # global/networks/default
1517 #
1518 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1519 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1520 # - projects/project/global/networks/network
1521 # - global/networks/default
1522 },
1523 ],
1524 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1525 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts data for an instance with a customer-supplied encryption key.
1526 #
1527 # If you are creating a new instance, this field encrypts the local SSD and in-memory contents of the instance using a key that you provide.
1528 #
1529 # If you are restarting an instance protected with a customer-supplied encryption key, you must provide the correct key in order to successfully restart the instance.
1530 #
1531 # If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key and you do not need to provide a key to start the instance later.
1532 #
1533 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt local SSDs and in-memory content in a managed instance group.
1534 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1535 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1536 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1537 #
1538 # The key must meet the following requirements before you can provide it to Compute Engine:
1539 # - The key is wrapped using a RSA public key certificate provided by Google.
1540 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1541 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1542 },
1543 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1544 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1545 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1546 {
1547 "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.
1548 "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.
1549 },
1550 ],
1551 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1552 "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.
1553 },
1554 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1555 "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.
1556 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1557 "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.
1558 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1559 "A String",
1560 ],
1561 "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.
1562 #
1563 # To see the latest fingerprint, make get() request to the instance.
1564 },
1565 "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.
1566 #
1567 # To see the latest fingerprint, make get() request to the instance.
1568 "host": "A String", # Full or partial URL of the host resource that the instance should be placed on, in the format: zones/zone/hosts/host.
1569 #
1570 # Optional, Private Host (physical machine) that the instance will be placed on when it's created. The instance is guaranteed to be placed on the same machine as other instances with the same private host.
1571 #
1572 # The request will be rejected if the private host has run out of resources.
1573 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1574 "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.
1575 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1576 { # An instance-attached disk resource.
1577 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1578 #
1579 # 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.
1580 #
1581 # 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.
1582 #
1583 # 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.
1584 #
1585 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1586 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1587 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1588 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1589 #
1590 # The key must meet the following requirements before you can provide it to Compute Engine:
1591 # - The key is wrapped using a RSA public key certificate provided by Google.
1592 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1593 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1594 },
1595 "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.
1596 #
1597 # 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.
1598 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1599 "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.
1600 #
1601 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1602 #
1603 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1604 "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.
1605 #
1606 # 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.
1607 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1608 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1609 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1610 #
1611 # The key must meet the following requirements before you can provide it to Compute Engine:
1612 # - The key is wrapped using a RSA public key certificate provided by Google.
1613 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1614 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1615 },
1616 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1617 "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:
1618 #
1619 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1620 #
1621 # 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:
1622 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1623 # - projects/project/zones/zone/diskTypes/diskType
1624 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1625 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
1626 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
1627 #
1628 # 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:
1629 #
1630 # projects/debian-cloud/global/images/family/debian-8
1631 #
1632 # Alternatively, use a specific version of a public operating system image:
1633 #
1634 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1635 #
1636 # To create a disk with a private image that you created, specify the image name in the following format:
1637 #
1638 # global/images/my-private-image
1639 #
1640 # 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:
1641 #
1642 # global/images/family/my-private-family
1643 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1644 },
1645 "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).
1646 "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.
1647 "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.
1648 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1649 "A String",
1650 ],
1651 "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.
1652 "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.
1653 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
1654 "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.
1655 },
1656 ],
1657 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1658 },
1659 ],
1660 "kind": "compute#instanceList", # [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.
1661 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1662 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1663 }</pre>
1664</div>
1665
1666<div class="method">
1667 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1668 <pre>Retrieves the next page of results.
1669
1670Args:
1671 previous_request: The request for the previous page. (required)
1672 previous_response: The response from the request for the previous page. (required)
1673
1674Returns:
1675 A request object that you can call 'execute()' on to request the next
1676 page. Returns None if there are no more items in the collection.
1677 </pre>
1678</div>
1679
1680<div class="method">
1681 <code class="details" id="reset">reset(project, zone, instance)</code>
1682 <pre>Performs a hard reset on the instance.
1683
1684Args:
1685 project: string, Project ID for this request. (required)
1686 zone: string, The name of the zone for this request. (required)
1687 instance: string, Name of the instance scoping this request. (required)
1688
1689Returns:
1690 An object of the form:
1691
1692 { # An Operation resource, used to manage asynchronous API requests.
1693 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1694 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1695 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1696 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1697 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1698 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1699 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1700 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1701 "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.
1702 "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.
1703 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1704 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1705 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1706 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1707 {
1708 "message": "A String", # [Output Only] A human-readable description of the warning code.
1709 "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.
1710 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1711 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1712 {
1713 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1714 "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).
1715 },
1716 ],
1717 },
1718 ],
1719 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1720 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1721 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1722 "name": "A String", # [Output Only] Name of the resource.
1723 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1724 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1725 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1726 {
1727 "message": "A String", # [Output Only] An optional, human-readable error message.
1728 "code": "A String", # [Output Only] The error type identifier for this error.
1729 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1730 },
1731 ],
1732 },
1733 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1734 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1735 "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.
1736 }</pre>
1737</div>
1738
1739<div class="method">
1740 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</code>
1741 <pre>Sets the auto-delete flag for a disk attached to an instance.
1742
1743Args:
1744 project: string, Project ID for this request. (required)
1745 zone: string, The name of the zone for this request. (required)
1746 instance: string, The instance name. (required)
1747 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required)
1748 deviceName: string, The device name of the disk to modify. (required)
1749
1750Returns:
1751 An object of the form:
1752
1753 { # An Operation resource, used to manage asynchronous API requests.
1754 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1755 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1756 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1757 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1758 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1759 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1760 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1761 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1762 "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.
1763 "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.
1764 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1765 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1766 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1767 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1768 {
1769 "message": "A String", # [Output Only] A human-readable description of the warning code.
1770 "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.
1771 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1772 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1773 {
1774 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1775 "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).
1776 },
1777 ],
1778 },
1779 ],
1780 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1781 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1782 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1783 "name": "A String", # [Output Only] Name of the resource.
1784 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1785 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1786 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1787 {
1788 "message": "A String", # [Output Only] An optional, human-readable error message.
1789 "code": "A String", # [Output Only] The error type identifier for this error.
1790 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1791 },
1792 ],
1793 },
1794 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1795 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1796 "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.
1797 }</pre>
1798</div>
1799
1800<div class="method">
1801 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body)</code>
1802 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1803
1804Args:
1805 project: string, Project ID for this request. (required)
1806 zone: string, The name of the zone for this request. (required)
1807 resource: string, Name of the resource for this request. (required)
1808 body: object, The request body. (required)
1809 The object takes the form of:
1810
1811{ # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
1812 #
1813 #
1814 #
1815 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.
1816 #
1817 # **Example**
1818 #
1819 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] }
1820 #
1821 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).
1822 "auditConfigs": [ # Specifies audit logging configs for "data access". "data access": generally refers to data reads/writes and admin reads. "admin activity": generally refers to admin writes.
1823 #
1824 # Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging.
1825 { # Enables "data access" audit logging for a service and specifies a list of members that are log-exempted.
1826 "exemptedMembers": [ # Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of Binding.members.
1827 "A String",
1828 ],
1829 "service": "A String", # Specifies a service that will be enabled for "data access" audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a special value that covers all services.
1830 },
1831 ],
1832 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1833 { # A rule to be applied in a Policy.
1834 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1835 { # Specifies what kind of log the caller must write
1836 "counter": { # Options for counters # Counter options.
1837 "field": "A String", # The field value to attribute.
1838 "metric": "A String", # The metric to update.
1839 },
1840 },
1841 ],
1842 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1843 "A String",
1844 ],
1845 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1846 "A String",
1847 ],
1848 "action": "A String", # Required
1849 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1850 "A String",
1851 ],
1852 "conditions": [ # Additional restrictions that must be met
1853 { # A condition to be met.
1854 "iam": "A String", # Trusted attributes supplied by the IAM system.
1855 "svc": "A String", # Trusted attributes discharged by the service.
1856 "value": "A String", # DEPRECATED. Use 'values' instead.
1857 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1858 "values": [ # The objects of the condition. This is mutually exclusive with 'value'.
1859 "A String",
1860 ],
1861 "op": "A String", # An operator to apply the subject with.
1862 },
1863 ],
1864 "description": "A String", # Human-readable description of the rule.
1865 },
1866 ],
1867 "version": 42, # Version of the `Policy`. The default version is 0.
1868 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1869 #
1870 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
1871 "bindings": [ # Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.
1872 { # Associates `members` with a `role`.
1873 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1874 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1875 #
1876 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1877 #
1878 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1879 #
1880 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.
1881 #
1882 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1883 #
1884 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1885 #
1886 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.
1887 "A String",
1888 ],
1889 },
1890 ],
1891 "iamOwned": True or False,
1892}
1893
1894
1895Returns:
1896 An object of the form:
1897
1898 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
1899 #
1900 #
1901 #
1902 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.
1903 #
1904 # **Example**
1905 #
1906 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] }
1907 #
1908 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).
1909 "auditConfigs": [ # Specifies audit logging configs for "data access". "data access": generally refers to data reads/writes and admin reads. "admin activity": generally refers to admin writes.
1910 #
1911 # Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging.
1912 { # Enables "data access" audit logging for a service and specifies a list of members that are log-exempted.
1913 "exemptedMembers": [ # Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of Binding.members.
1914 "A String",
1915 ],
1916 "service": "A String", # Specifies a service that will be enabled for "data access" audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a special value that covers all services.
1917 },
1918 ],
1919 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1920 { # A rule to be applied in a Policy.
1921 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1922 { # Specifies what kind of log the caller must write
1923 "counter": { # Options for counters # Counter options.
1924 "field": "A String", # The field value to attribute.
1925 "metric": "A String", # The metric to update.
1926 },
1927 },
1928 ],
1929 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1930 "A String",
1931 ],
1932 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1933 "A String",
1934 ],
1935 "action": "A String", # Required
1936 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1937 "A String",
1938 ],
1939 "conditions": [ # Additional restrictions that must be met
1940 { # A condition to be met.
1941 "iam": "A String", # Trusted attributes supplied by the IAM system.
1942 "svc": "A String", # Trusted attributes discharged by the service.
1943 "value": "A String", # DEPRECATED. Use 'values' instead.
1944 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1945 "values": [ # The objects of the condition. This is mutually exclusive with 'value'.
1946 "A String",
1947 ],
1948 "op": "A String", # An operator to apply the subject with.
1949 },
1950 ],
1951 "description": "A String", # Human-readable description of the rule.
1952 },
1953 ],
1954 "version": 42, # Version of the `Policy`. The default version is 0.
1955 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1956 #
1957 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
1958 "bindings": [ # Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.
1959 { # Associates `members` with a `role`.
1960 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1961 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1962 #
1963 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1964 #
1965 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1966 #
1967 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.
1968 #
1969 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1970 #
1971 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1972 #
1973 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.
1974 "A String",
1975 ],
1976 },
1977 ],
1978 "iamOwned": True or False,
1979 }</pre>
1980</div>
1981
1982<div class="method">
1983 <code class="details" id="setLabels">setLabels(project, zone, instance, body)</code>
1984 <pre>Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.
1985
1986Args:
1987 project: string, Project ID for this request. (required)
1988 zone: string, The name of the zone for this request. (required)
1989 instance: string, Name of the instance scoping this request. (required)
1990 body: object, The request body. (required)
1991 The object takes the form of:
1992
1993{
1994 "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.
1995 "labels": { # A list of labels to apply for this instance. Changing instance labels will also change the instance tags.
1996 #
1997 # 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": "").
1998 "a_key": "A String",
1999 },
2000 }
2001
2002
2003Returns:
2004 An object of the form:
2005
2006 { # An Operation resource, used to manage asynchronous API requests.
2007 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2008 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2009 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2010 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2011 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2012 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2013 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2014 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2015 "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.
2016 "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.
2017 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2018 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2019 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2020 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2021 {
2022 "message": "A String", # [Output Only] A human-readable description of the warning code.
2023 "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.
2024 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2025 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2026 {
2027 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2028 "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).
2029 },
2030 ],
2031 },
2032 ],
2033 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2034 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2035 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2036 "name": "A String", # [Output Only] Name of the resource.
2037 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2038 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2039 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2040 {
2041 "message": "A String", # [Output Only] An optional, human-readable error message.
2042 "code": "A String", # [Output Only] The error type identifier for this error.
2043 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2044 },
2045 ],
2046 },
2047 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2048 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2049 "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.
2050 }</pre>
2051</div>
2052
2053<div class="method">
2054 <code class="details" id="setMachineType">setMachineType(project, zone, instance, body)</code>
2055 <pre>Changes the machine type for a stopped instance to the machine type specified in the request.
2056
2057Args:
2058 project: string, Project ID for this request. (required)
2059 zone: string, The name of the zone for this request. (required)
2060 instance: string, Name of the instance scoping this request. (required)
2061 body: object, The request body. (required)
2062 The object takes the form of:
2063
2064{
2065 "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
2066 }
2067
2068
2069Returns:
2070 An object of the form:
2071
2072 { # An Operation resource, used to manage asynchronous API requests.
2073 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2074 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2075 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2076 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2077 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2078 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2079 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2080 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2081 "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.
2082 "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.
2083 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2084 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2085 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2086 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2087 {
2088 "message": "A String", # [Output Only] A human-readable description of the warning code.
2089 "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.
2090 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2091 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2092 {
2093 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2094 "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).
2095 },
2096 ],
2097 },
2098 ],
2099 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2100 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2101 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2102 "name": "A String", # [Output Only] Name of the resource.
2103 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2104 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2105 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2106 {
2107 "message": "A String", # [Output Only] An optional, human-readable error message.
2108 "code": "A String", # [Output Only] The error type identifier for this error.
2109 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2110 },
2111 ],
2112 },
2113 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2114 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2115 "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.
2116 }</pre>
2117</div>
2118
2119<div class="method">
2120 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body)</code>
2121 <pre>Sets metadata for the specified instance to the data included in the request.
2122
2123Args:
2124 project: string, Project ID for this request. (required)
2125 zone: string, The name of the zone for this request. (required)
2126 instance: string, Name of the instance scoping this request. (required)
2127 body: object, The request body. (required)
2128 The object takes the form of:
2129
2130{ # A metadata key/value entry.
2131 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
2132 {
2133 "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.
2134 "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.
2135 },
2136 ],
2137 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
2138 "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.
2139}
2140
2141
2142Returns:
2143 An object of the form:
2144
2145 { # An Operation resource, used to manage asynchronous API requests.
2146 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2147 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2148 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2149 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2150 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2151 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2152 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2153 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2154 "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.
2155 "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.
2156 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2157 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2158 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2159 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2160 {
2161 "message": "A String", # [Output Only] A human-readable description of the warning code.
2162 "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.
2163 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2164 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2165 {
2166 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2167 "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).
2168 },
2169 ],
2170 },
2171 ],
2172 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2173 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2174 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2175 "name": "A String", # [Output Only] Name of the resource.
2176 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2177 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2178 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2179 {
2180 "message": "A String", # [Output Only] An optional, human-readable error message.
2181 "code": "A String", # [Output Only] The error type identifier for this error.
2182 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2183 },
2184 ],
2185 },
2186 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2187 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2188 "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.
2189 }</pre>
2190</div>
2191
2192<div class="method">
2193 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body)</code>
2194 <pre>Sets an instance's scheduling options.
2195
2196Args:
2197 project: string, Project ID for this request. (required)
2198 zone: string, The name of the zone for this request. (required)
2199 instance: string, Instance name. (required)
2200 body: object, The request body. (required)
2201 The object takes the form of:
2202
2203{ # Sets the scheduling options for an Instance.
2204 "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.
2205 "preemptible": True or False, # Whether the instance is preemptible.
2206 "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.
2207}
2208
2209
2210Returns:
2211 An object of the form:
2212
2213 { # An Operation resource, used to manage asynchronous API requests.
2214 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2215 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2216 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2217 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2218 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2219 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2220 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2221 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2222 "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.
2223 "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.
2224 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2225 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2226 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2227 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2228 {
2229 "message": "A String", # [Output Only] A human-readable description of the warning code.
2230 "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.
2231 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2232 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2233 {
2234 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2235 "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).
2236 },
2237 ],
2238 },
2239 ],
2240 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2241 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2242 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2243 "name": "A String", # [Output Only] Name of the resource.
2244 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2245 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2246 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2247 {
2248 "message": "A String", # [Output Only] An optional, human-readable error message.
2249 "code": "A String", # [Output Only] The error type identifier for this error.
2250 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2251 },
2252 ],
2253 },
2254 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2255 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2256 "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.
2257 }</pre>
2258</div>
2259
2260<div class="method">
2261 <code class="details" id="setServiceAccount">setServiceAccount(project, zone, instance, body)</code>
2262 <pre>Sets the service account on the instance.
2263
2264Args:
2265 project: string, Project ID for this request. (required)
2266 zone: string, The name of the zone for this request. (required)
2267 instance: string, Name of the instance resource to start. (required)
2268 body: object, The request body. (required)
2269 The object takes the form of:
2270
2271{
2272 "scopes": [ # The list of scopes to be made available for this service account.
2273 "A String",
2274 ],
2275 "email": "A String", # Email address of the service account.
2276 }
2277
2278
2279Returns:
2280 An object of the form:
2281
2282 { # An Operation resource, used to manage asynchronous API requests.
2283 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2284 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2285 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2286 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2287 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2288 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2289 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2290 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2291 "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.
2292 "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.
2293 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2294 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2295 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2296 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2297 {
2298 "message": "A String", # [Output Only] A human-readable description of the warning code.
2299 "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.
2300 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2301 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2302 {
2303 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2304 "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).
2305 },
2306 ],
2307 },
2308 ],
2309 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2310 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2311 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2312 "name": "A String", # [Output Only] Name of the resource.
2313 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2314 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2315 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2316 {
2317 "message": "A String", # [Output Only] An optional, human-readable error message.
2318 "code": "A String", # [Output Only] The error type identifier for this error.
2319 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2320 },
2321 ],
2322 },
2323 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2324 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2325 "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.
2326 }</pre>
2327</div>
2328
2329<div class="method">
2330 <code class="details" id="setTags">setTags(project, zone, instance, body)</code>
2331 <pre>Sets tags for the specified instance to the data included in the request.
2332
2333Args:
2334 project: string, Project ID for this request. (required)
2335 zone: string, The name of the zone for this request. (required)
2336 instance: string, Name of the instance scoping this request. (required)
2337 body: object, The request body. (required)
2338 The object takes the form of:
2339
2340{ # A set of instance tags.
2341 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
2342 "A String",
2343 ],
2344 "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.
2345 #
2346 # To see the latest fingerprint, make get() request to the instance.
2347}
2348
2349
2350Returns:
2351 An object of the form:
2352
2353 { # An Operation resource, used to manage asynchronous API requests.
2354 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2355 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2356 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2357 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2358 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2359 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2360 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2361 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2362 "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.
2363 "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.
2364 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2365 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2366 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2367 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2368 {
2369 "message": "A String", # [Output Only] A human-readable description of the warning code.
2370 "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.
2371 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2372 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2373 {
2374 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2375 "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).
2376 },
2377 ],
2378 },
2379 ],
2380 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2381 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2382 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2383 "name": "A String", # [Output Only] Name of the resource.
2384 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2385 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2386 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2387 {
2388 "message": "A String", # [Output Only] An optional, human-readable error message.
2389 "code": "A String", # [Output Only] The error type identifier for this error.
2390 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2391 },
2392 ],
2393 },
2394 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2395 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2396 "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.
2397 }</pre>
2398</div>
2399
2400<div class="method">
2401 <code class="details" id="start">start(project, zone, instance)</code>
2402 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2403
2404Args:
2405 project: string, Project ID for this request. (required)
2406 zone: string, The name of the zone for this request. (required)
2407 instance: string, Name of the instance resource to start. (required)
2408
2409Returns:
2410 An object of the form:
2411
2412 { # An Operation resource, used to manage asynchronous API requests.
2413 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2414 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2415 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2416 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2417 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2418 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2419 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2420 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2421 "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.
2422 "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.
2423 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2424 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2425 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2426 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2427 {
2428 "message": "A String", # [Output Only] A human-readable description of the warning code.
2429 "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.
2430 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2431 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2432 {
2433 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2434 "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).
2435 },
2436 ],
2437 },
2438 ],
2439 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2440 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2441 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2442 "name": "A String", # [Output Only] Name of the resource.
2443 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2444 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2445 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2446 {
2447 "message": "A String", # [Output Only] An optional, human-readable error message.
2448 "code": "A String", # [Output Only] The error type identifier for this error.
2449 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2450 },
2451 ],
2452 },
2453 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2454 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2455 "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.
2456 }</pre>
2457</div>
2458
2459<div class="method">
2460 <code class="details" id="startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</code>
2461 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2462
2463Args:
2464 project: string, Project ID for this request. (required)
2465 zone: string, The name of the zone for this request. (required)
2466 instance: string, Name of the instance resource to start. (required)
2467 body: object, The request body. (required)
2468 The object takes the form of:
2469
2470{
2471 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with an instance that is protected with a customer-supplied encryption key.
2472 #
2473 # If the instance you are starting is protected with a customer-supplied encryption key, the correct key must be provided otherwise the instance start will not succeed.
2474 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
2475 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
2476 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
2477 #
2478 # The key must meet the following requirements before you can provide it to Compute Engine:
2479 # - The key is wrapped using a RSA public key certificate provided by Google.
2480 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
2481 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
2482 },
2483 "disks": [ # Array of disks associated with this instance that are protected with a customer-supplied encryption key.
2484 #
2485 # In order to start the instance, the disk url and its corresponding key must be provided.
2486 #
2487 # If the disk is not protected with a customer-supplied encryption key it should not be specified.
2488 {
2489 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with the disk with a customer-supplied encryption key.
2490 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
2491 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
2492 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
2493 #
2494 # The key must meet the following requirements before you can provide it to Compute Engine:
2495 # - The key is wrapped using a RSA public key certificate provided by Google.
2496 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
2497 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
2498 },
2499 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
2500 },
2501 ],
2502 }
2503
2504
2505Returns:
2506 An object of the form:
2507
2508 { # An Operation resource, used to manage asynchronous API requests.
2509 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2510 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2511 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2512 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2513 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2514 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2515 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2516 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2517 "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.
2518 "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.
2519 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2520 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2521 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2522 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2523 {
2524 "message": "A String", # [Output Only] A human-readable description of the warning code.
2525 "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.
2526 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2527 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2528 {
2529 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2530 "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).
2531 },
2532 ],
2533 },
2534 ],
2535 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2536 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2537 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2538 "name": "A String", # [Output Only] Name of the resource.
2539 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2540 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2541 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2542 {
2543 "message": "A String", # [Output Only] An optional, human-readable error message.
2544 "code": "A String", # [Output Only] The error type identifier for this error.
2545 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2546 },
2547 ],
2548 },
2549 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2550 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2551 "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.
2552 }</pre>
2553</div>
2554
2555<div class="method">
2556 <code class="details" id="stop">stop(project, zone, instance, discardLocalSsd=None)</code>
2557 <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.
2558
2559Args:
2560 project: string, Project ID for this request. (required)
2561 zone: string, The name of the zone for this request. (required)
2562 instance: string, Name of the instance resource to stop. (required)
2563 discardLocalSsd: boolean, If true, discard the contents of any attached localSSD partitions. Default value is false.
2564
2565Returns:
2566 An object of the form:
2567
2568 { # An Operation resource, used to manage asynchronous API requests.
2569 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2570 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2571 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2572 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2573 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2574 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2575 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2576 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2577 "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.
2578 "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.
2579 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2580 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2581 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2582 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2583 {
2584 "message": "A String", # [Output Only] A human-readable description of the warning code.
2585 "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.
2586 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2587 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2588 {
2589 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2590 "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).
2591 },
2592 ],
2593 },
2594 ],
2595 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2596 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2597 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2598 "name": "A String", # [Output Only] Name of the resource.
2599 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2600 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2601 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2602 {
2603 "message": "A String", # [Output Only] An optional, human-readable error message.
2604 "code": "A String", # [Output Only] The error type identifier for this error.
2605 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2606 },
2607 ],
2608 },
2609 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2610 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2611 "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.
2612 }</pre>
2613</div>
2614
2615<div class="method">
2616 <code class="details" id="suspend">suspend(project, zone, instance, discardLocalSsd=None)</code>
2617 <pre>This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances incur reduced per-minute, virtual machine usage charges while they are suspended. Any resources the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted.
2618
2619Args:
2620 project: string, Project ID for this request. (required)
2621 zone: string, The name of the zone for this request. (required)
2622 instance: string, Name of the instance resource to suspend. (required)
2623 discardLocalSsd: boolean, If true, discard the contents of any attached localSSD partitions. Default value is false.
2624
2625Returns:
2626 An object of the form:
2627
2628 { # An Operation resource, used to manage asynchronous API requests.
2629 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2630 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2631 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2632 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2633 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2634 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2635 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2636 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2637 "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.
2638 "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.
2639 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2640 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2641 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2642 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2643 {
2644 "message": "A String", # [Output Only] A human-readable description of the warning code.
2645 "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.
2646 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2647 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2648 {
2649 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2650 "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).
2651 },
2652 ],
2653 },
2654 ],
2655 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2656 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2657 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2658 "name": "A String", # [Output Only] Name of the resource.
2659 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2660 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2661 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2662 {
2663 "message": "A String", # [Output Only] An optional, human-readable error message.
2664 "code": "A String", # [Output Only] The error type identifier for this error.
2665 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2666 },
2667 ],
2668 },
2669 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2670 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2671 "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.
2672 }</pre>
2673</div>
2674
2675<div class="method">
2676 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code>
2677 <pre>Returns permissions that a caller has on the specified resource.
2678
2679Args:
2680 project: string, Project ID for this request. (required)
2681 zone: string, The name of the zone for this request. (required)
2682 resource: string, Name of the resource for this request. (required)
2683 body: object, The request body. (required)
2684 The object takes the form of:
2685
2686{
2687 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
2688 "A String",
2689 ],
2690 }
2691
2692
2693Returns:
2694 An object of the form:
2695
2696 {
2697 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2698 "A String",
2699 ],
2700 }</pre>
2701</div>
2702
2703<div class="method">
2704 <code class="details" id="updateAccessConfig">updateAccessConfig(project, zone, instance, networkInterface, body)</code>
2705 <pre>Updates the specified access config from an instance's network interface with the data included in the request.
2706
2707Args:
2708 project: string, Project ID for this request. (required)
2709 zone: string, The name of the zone for this request. (required)
2710 instance: string, The instance name for this request. (required)
2711 networkInterface: string, The name of the network interface where the access config is attached. (required)
2712 body: object, The request body. (required)
2713 The object takes the form of:
2714
2715{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
2716 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
2717 "name": "A String", # Name of this access configuration.
2718 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
2719 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM , STANDARD. If this field is not specified, it is assumed to be PREMIUM.
2720 "ptrDomainName": "A String", # The DNS domain name for the public PTR record. This field can only be set when the set_ptr field is enabled.
2721 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
2722 "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.
2723 "setPtr": True or False, # Specifies whether a public DNS ?PTR? record should be created to map the external IP address of the instance to a DNS domain name.
2724 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
2725}
2726
2727
2728Returns:
2729 An object of the form:
2730
2731 { # An Operation resource, used to manage asynchronous API requests.
2732 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2733 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2734 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2735 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2736 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2737 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2738 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2739 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2740 "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.
2741 "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.
2742 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2743 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2744 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2745 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2746 {
2747 "message": "A String", # [Output Only] A human-readable description of the warning code.
2748 "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.
2749 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2750 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2751 {
2752 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2753 "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).
2754 },
2755 ],
2756 },
2757 ],
2758 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2759 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2760 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2761 "name": "A String", # [Output Only] Name of the resource.
2762 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2763 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2764 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2765 {
2766 "message": "A String", # [Output Only] An optional, human-readable error message.
2767 "code": "A String", # [Output Only] The error type identifier for this error.
2768 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2769 },
2770 ],
2771 },
2772 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2773 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
2774 "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.
2775 }</pre>
2776</div>
2777
2778</body></html>