blob: e5104a93920ded2d9fbbe2f79e41190d10daaa13 [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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800178 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: CLOUD_NETWORK_PREMIUM , CLOUD_NETWORK_STANDARD. If this field is not specified, it is assumed to be CLOUD_NETWORK_PREMIUM.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700179 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800233 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700234 }</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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800313 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: CLOUD_NETWORK_PREMIUM , CLOUD_NETWORK_STANDARD. If this field is not specified, it is assumed to be CLOUD_NETWORK_PREMIUM.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700314 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800437 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700438 #
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
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800454 #
455 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700456 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
457 },
458 "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).
459 "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.
460 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800461 "diskSizeGb": "A String", # The size of the disk in base-2 GB. This supersedes disk_size_gb in InitializeParams.
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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700464 "licenses": [ # [Output Only] Any valid publicly visible licenses.
465 "A String",
466 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700467 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800468 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
469 #
470 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
471 #
472 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700473 },
474 ],
475 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
476 },
477 ],
478 "warning": { # [Output Only] Informational warning which replaces the list of instances when the list is empty.
479 "message": "A String", # [Output Only] A human-readable description of the warning code.
480 "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.
481 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
482 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
483 {
484 "value": "A String", # [Output Only] A warning data value corresponding to the key.
485 "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).
486 },
487 ],
488 },
489 },
490 },
491 "kind": "compute#instanceAggregatedList", # [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources.
492 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
493 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
494 }</pre>
495</div>
496
497<div class="method">
498 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
499 <pre>Retrieves the next page of results.
500
501Args:
502 previous_request: The request for the previous page. (required)
503 previous_response: The response from the request for the previous page. (required)
504
505Returns:
506 A request object that you can call 'execute()' on to request the next
507 page. Returns None if there are no more items in the collection.
508 </pre>
509</div>
510
511<div class="method">
512 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body, forceAttach=None)</code>
513 <pre>Attaches a Disk resource to an instance.
514
515Args:
516 project: string, Project ID for this request. (required)
517 zone: string, The name of the zone for this request. (required)
518 instance: string, The instance name for this request. (required)
519 body: object, The request body. (required)
520 The object takes the form of:
521
522{ # An instance-attached disk resource.
523 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
524 #
525 # 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.
526 #
527 # 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.
528 #
529 # 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.
530 #
531 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
532 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
533 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
534 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
535 #
536 # The key must meet the following requirements before you can provide it to Compute Engine:
537 # - The key is wrapped using a RSA public key certificate provided by Google.
538 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
539 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
540 },
541 "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.
542 #
543 # 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.
544 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
545 "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.
546 #
547 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
548 #
549 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
550 "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.
551 #
552 # 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.
553 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
554 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
555 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
556 #
557 # The key must meet the following requirements before you can provide it to Compute Engine:
558 # - The key is wrapped using a RSA public key certificate provided by Google.
559 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
560 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
561 },
562 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
563 "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:
564 #
565 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
566 #
567 # 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:
568 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
569 # - projects/project/zones/zone/diskTypes/diskType
570 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
571 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800572 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700573 #
574 # 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:
575 #
576 # projects/debian-cloud/global/images/family/debian-8
577 #
578 # Alternatively, use a specific version of a public operating system image:
579 #
580 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
581 #
582 # To create a disk with a private image that you created, specify the image name in the following format:
583 #
584 # global/images/my-private-image
585 #
586 # 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:
587 #
588 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800589 #
590 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700591 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
592 },
593 "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).
594 "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.
595 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800596 "diskSizeGb": "A String", # The size of the disk in base-2 GB. This supersedes disk_size_gb in InitializeParams.
597 "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.
598 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700599 "licenses": [ # [Output Only] Any valid publicly visible licenses.
600 "A String",
601 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700602 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800603 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
604 #
605 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
606 #
607 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700608}
609
610 forceAttach: boolean, Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.
611
612Returns:
613 An object of the form:
614
615 { # An Operation resource, used to manage asynchronous API requests.
616 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
617 "clientOperationId": "A String", # [Output Only] Reserved for future use.
618 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
619 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
620 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
621 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
622 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
623 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
624 "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.
625 "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.
626 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
627 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
628 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
629 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
630 {
631 "message": "A String", # [Output Only] A human-readable description of the warning code.
632 "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.
633 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
634 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
635 {
636 "value": "A String", # [Output Only] A warning data value corresponding to the key.
637 "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).
638 },
639 ],
640 },
641 ],
642 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
643 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
644 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
645 "name": "A String", # [Output Only] Name of the resource.
646 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
647 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
648 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
649 {
650 "message": "A String", # [Output Only] An optional, human-readable error message.
651 "code": "A String", # [Output Only] The error type identifier for this error.
652 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
653 },
654 ],
655 },
656 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
657 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800658 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700659 }</pre>
660</div>
661
662<div class="method">
663 <code class="details" id="delete">delete(project, zone, instance)</code>
664 <pre>Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
665
666Args:
667 project: string, Project ID for this request. (required)
668 zone: string, The name of the zone for this request. (required)
669 instance: string, Name of the instance resource to delete. (required)
670
671Returns:
672 An object of the form:
673
674 { # An Operation resource, used to manage asynchronous API requests.
675 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
676 "clientOperationId": "A String", # [Output Only] Reserved for future use.
677 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
678 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
679 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
680 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
681 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
682 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
683 "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.
684 "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.
685 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
686 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
687 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
688 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
689 {
690 "message": "A String", # [Output Only] A human-readable description of the warning code.
691 "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.
692 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
693 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
694 {
695 "value": "A String", # [Output Only] A warning data value corresponding to the key.
696 "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).
697 },
698 ],
699 },
700 ],
701 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
702 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
703 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
704 "name": "A String", # [Output Only] Name of the resource.
705 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
706 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
707 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
708 {
709 "message": "A String", # [Output Only] An optional, human-readable error message.
710 "code": "A String", # [Output Only] The error type identifier for this error.
711 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
712 },
713 ],
714 },
715 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
716 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800717 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700718 }</pre>
719</div>
720
721<div class="method">
722 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface)</code>
723 <pre>Deletes an access config from an instance's network interface.
724
725Args:
726 project: string, Project ID for this request. (required)
727 zone: string, The name of the zone for this request. (required)
728 instance: string, The instance name for this request. (required)
729 accessConfig: string, The name of the access config to delete. (required)
730 networkInterface: string, The name of the network interface. (required)
731
732Returns:
733 An object of the form:
734
735 { # An Operation resource, used to manage asynchronous API requests.
736 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
737 "clientOperationId": "A String", # [Output Only] Reserved for future use.
738 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
739 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
740 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
741 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
742 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
743 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
744 "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.
745 "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.
746 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
747 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
748 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
749 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
750 {
751 "message": "A String", # [Output Only] A human-readable description of the warning code.
752 "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.
753 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
754 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
755 {
756 "value": "A String", # [Output Only] A warning data value corresponding to the key.
757 "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).
758 },
759 ],
760 },
761 ],
762 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
763 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
764 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
765 "name": "A String", # [Output Only] Name of the resource.
766 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
767 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
768 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
769 {
770 "message": "A String", # [Output Only] An optional, human-readable error message.
771 "code": "A String", # [Output Only] The error type identifier for this error.
772 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
773 },
774 ],
775 },
776 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
777 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800778 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700779 }</pre>
780</div>
781
782<div class="method">
783 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName)</code>
784 <pre>Detaches a disk from an instance.
785
786Args:
787 project: string, Project ID for this request. (required)
788 zone: string, The name of the zone for this request. (required)
789 instance: string, Instance name. (required)
790 deviceName: string, Disk device name to detach. (required)
791
792Returns:
793 An object of the form:
794
795 { # An Operation resource, used to manage asynchronous API requests.
796 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
797 "clientOperationId": "A String", # [Output Only] Reserved for future use.
798 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
799 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
800 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
801 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
802 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
803 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
804 "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.
805 "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.
806 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
807 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
808 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
809 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
810 {
811 "message": "A String", # [Output Only] A human-readable description of the warning code.
812 "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.
813 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
814 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
815 {
816 "value": "A String", # [Output Only] A warning data value corresponding to the key.
817 "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).
818 },
819 ],
820 },
821 ],
822 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
823 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
824 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
825 "name": "A String", # [Output Only] Name of the resource.
826 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
827 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
828 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
829 {
830 "message": "A String", # [Output Only] An optional, human-readable error message.
831 "code": "A String", # [Output Only] The error type identifier for this error.
832 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
833 },
834 ],
835 },
836 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
837 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800838 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700839 }</pre>
840</div>
841
842<div class="method">
843 <code class="details" id="get">get(project, zone, instance)</code>
844 <pre>Returns the specified Instance resource. Get a list of available instances by making a list() request.
845
846Args:
847 project: string, Project ID for this request. (required)
848 zone: string, The name of the zone for this request. (required)
849 instance: string, Name of the instance resource to return. (required)
850
851Returns:
852 An object of the form:
853
854 { # An Instance resource.
855 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
856 "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.
857 "a_key": "A String",
858 },
859 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
860 "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.
861 "preemptible": True or False, # Whether the instance is preemptible.
862 "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.
863 },
864 "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:
865 #
866 # zones/us-central1-f/machineTypes/n1-standard-1
867 #
868 # 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):
869 #
870 # zones/zone/machineTypes/custom-CPUS-MEMORY
871 #
872 # For example: zones/us-central1-f/machineTypes/custom-4-5120
873 #
874 # For a full list of restrictions, read the Specifications for custom machine types.
875 "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.
876 { # A service account.
877 "scopes": [ # The list of scopes to be made available for this service account.
878 "A String",
879 ],
880 "email": "A String", # Email address of the service account.
881 },
882 ],
883 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
884 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
885 "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.
886 { # A network interface resource attached to an instance.
887 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
888 { # An alias IP range attached to an instance's network interface.
889 "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.
890 "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).
891 },
892 ],
893 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
894 "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.
895 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
896 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
897 "name": "A String", # Name of this access configuration.
898 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800899 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: CLOUD_NETWORK_PREMIUM , CLOUD_NETWORK_STANDARD. If this field is not specified, it is assumed to be CLOUD_NETWORK_PREMIUM.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700900 "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.
901 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
902 "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.
903 "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.
904 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
905 },
906 ],
907 "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.
908 "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:
909 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
910 # - regions/region/subnetworks/subnetwork
911 "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:
912 #
913 # global/networks/default
914 #
915 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
916 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
917 # - projects/project/global/networks/network
918 # - global/networks/default
919 },
920 ],
921 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
922 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts data for an instance with a customer-supplied encryption key.
923 #
924 # 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.
925 #
926 # 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.
927 #
928 # 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.
929 #
930 # 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.
931 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
932 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
933 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
934 #
935 # The key must meet the following requirements before you can provide it to Compute Engine:
936 # - The key is wrapped using a RSA public key certificate provided by Google.
937 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
938 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
939 },
940 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
941 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
942 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
943 {
944 "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.
945 "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.
946 },
947 ],
948 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
949 "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.
950 },
951 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
952 "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.
953 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
954 "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.
955 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
956 "A String",
957 ],
958 "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.
959 #
960 # To see the latest fingerprint, make get() request to the instance.
961 },
962 "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.
963 #
964 # To see the latest fingerprint, make get() request to the instance.
965 "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.
966 #
967 # 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.
968 #
969 # The request will be rejected if the private host has run out of resources.
970 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
971 "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.
972 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
973 { # An instance-attached disk resource.
974 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
975 #
976 # 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.
977 #
978 # 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.
979 #
980 # 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.
981 #
982 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
983 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
984 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
985 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
986 #
987 # The key must meet the following requirements before you can provide it to Compute Engine:
988 # - The key is wrapped using a RSA public key certificate provided by Google.
989 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
990 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
991 },
992 "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.
993 #
994 # 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.
995 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
996 "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.
997 #
998 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
999 #
1000 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1001 "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.
1002 #
1003 # 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.
1004 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1005 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1006 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1007 #
1008 # The key must meet the following requirements before you can provide it to Compute Engine:
1009 # - The key is wrapped using a RSA public key certificate provided by Google.
1010 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1011 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1012 },
1013 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1014 "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:
1015 #
1016 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1017 #
1018 # 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:
1019 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1020 # - projects/project/zones/zone/diskTypes/diskType
1021 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1022 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001023 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001024 #
1025 # 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:
1026 #
1027 # projects/debian-cloud/global/images/family/debian-8
1028 #
1029 # Alternatively, use a specific version of a public operating system image:
1030 #
1031 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1032 #
1033 # To create a disk with a private image that you created, specify the image name in the following format:
1034 #
1035 # global/images/my-private-image
1036 #
1037 # 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:
1038 #
1039 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001040 #
1041 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001042 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1043 },
1044 "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).
1045 "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.
1046 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001047 "diskSizeGb": "A String", # The size of the disk in base-2 GB. This supersedes disk_size_gb in InitializeParams.
1048 "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.
1049 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001050 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1051 "A String",
1052 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001053 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001054 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
1055 #
1056 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
1057 #
1058 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001059 },
1060 ],
1061 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1062 }</pre>
1063</div>
1064
1065<div class="method">
1066 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource)</code>
1067 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
1068
1069Args:
1070 project: string, Project ID for this request. (required)
1071 zone: string, The name of the zone for this request. (required)
1072 resource: string, Name of the resource for this request. (required)
1073
1074Returns:
1075 An object of the form:
1076
1077 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
1078 #
1079 #
1080 #
1081 # 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.
1082 #
1083 # **Example**
1084 #
1085 # { "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"] } ] }
1086 #
1087 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).
1088 "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.
1089 #
1090 # Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001091 { # Provides the configuration for non-admin_activity logging for a service. Controls exemptions and specific log sub-types.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001092 "exemptedMembers": [ # Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of Binding.members.
1093 "A String",
1094 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001095 "auditLogConfigs": [ # The configuration for each type of logging
1096 { # Provides the configuration for a sub-type of logging.
1097 "exemptedMembers": [ # Specifies the identities that are exempted from this type of logging Follows the same format of Binding.members.
1098 "A String",
1099 ],
1100 "logType": "A String", # The log type that this config enables.
1101 },
1102 ],
1103 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a special value that covers all services.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001104 },
1105 ],
1106 "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.
1107 { # A rule to be applied in a Policy.
1108 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1109 { # Specifies what kind of log the caller must write
1110 "counter": { # Options for counters # Counter options.
1111 "field": "A String", # The field value to attribute.
1112 "metric": "A String", # The metric to update.
1113 },
1114 },
1115 ],
1116 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1117 "A String",
1118 ],
1119 "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.
1120 "A String",
1121 ],
1122 "action": "A String", # Required
1123 "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.
1124 "A String",
1125 ],
1126 "conditions": [ # Additional restrictions that must be met
1127 { # A condition to be met.
1128 "iam": "A String", # Trusted attributes supplied by the IAM system.
1129 "svc": "A String", # Trusted attributes discharged by the service.
1130 "value": "A String", # DEPRECATED. Use 'values' instead.
1131 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1132 "values": [ # The objects of the condition. This is mutually exclusive with 'value'.
1133 "A String",
1134 ],
1135 "op": "A String", # An operator to apply the subject with.
1136 },
1137 ],
1138 "description": "A String", # Human-readable description of the rule.
1139 },
1140 ],
1141 "version": 42, # Version of the `Policy`. The default version is 0.
1142 "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.
1143 #
1144 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
1145 "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.
1146 { # Associates `members` with a `role`.
1147 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1148 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1149 #
1150 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1151 #
1152 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1153 #
1154 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.
1155 #
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001156 #
1157 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001158 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1159 #
1160 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1161 #
1162 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.
1163 "A String",
1164 ],
1165 },
1166 ],
1167 "iamOwned": True or False,
1168 }</pre>
1169</div>
1170
1171<div class="method">
1172 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</code>
1173 <pre>Returns the specified instance's serial port output.
1174
1175Args:
1176 project: string, Project ID for this request. (required)
1177 zone: string, The name of the zone for this request. (required)
1178 instance: string, Name of the instance scoping this request. (required)
1179 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.
1180 port: integer, Specifies which COM or serial port to retrieve data from.
1181
1182Returns:
1183 An object of the form:
1184
1185 { # An instance's serial console output.
1186 "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.
1187 "kind": "compute#serialPortOutput", # [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.
1188 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1189 "contents": "A String", # [Output Only] The contents of the console output.
1190 "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.
1191 }</pre>
1192</div>
1193
1194<div class="method">
1195 <code class="details" id="insert">insert(project, zone, body)</code>
1196 <pre>Creates an instance resource in the specified project using the data included in the request.
1197
1198Args:
1199 project: string, Project ID for this request. (required)
1200 zone: string, The name of the zone for this request. (required)
1201 body: object, The request body. (required)
1202 The object takes the form of:
1203
1204{ # An Instance resource.
1205 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1206 "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.
1207 "a_key": "A String",
1208 },
1209 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1210 "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.
1211 "preemptible": True or False, # Whether the instance is preemptible.
1212 "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.
1213 },
1214 "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:
1215 #
1216 # zones/us-central1-f/machineTypes/n1-standard-1
1217 #
1218 # 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):
1219 #
1220 # zones/zone/machineTypes/custom-CPUS-MEMORY
1221 #
1222 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1223 #
1224 # For a full list of restrictions, read the Specifications for custom machine types.
1225 "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.
1226 { # A service account.
1227 "scopes": [ # The list of scopes to be made available for this service account.
1228 "A String",
1229 ],
1230 "email": "A String", # Email address of the service account.
1231 },
1232 ],
1233 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1234 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1235 "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.
1236 { # A network interface resource attached to an instance.
1237 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
1238 { # An alias IP range attached to an instance's network interface.
1239 "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.
1240 "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).
1241 },
1242 ],
1243 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1244 "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.
1245 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1246 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1247 "name": "A String", # Name of this access configuration.
1248 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001249 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: CLOUD_NETWORK_PREMIUM , CLOUD_NETWORK_STANDARD. If this field is not specified, it is assumed to be CLOUD_NETWORK_PREMIUM.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001250 "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.
1251 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
1252 "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.
1253 "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.
1254 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1255 },
1256 ],
1257 "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.
1258 "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:
1259 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1260 # - regions/region/subnetworks/subnetwork
1261 "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:
1262 #
1263 # global/networks/default
1264 #
1265 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1266 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1267 # - projects/project/global/networks/network
1268 # - global/networks/default
1269 },
1270 ],
1271 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1272 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts data for an instance with a customer-supplied encryption key.
1273 #
1274 # 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.
1275 #
1276 # 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.
1277 #
1278 # 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.
1279 #
1280 # 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.
1281 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1282 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1283 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1284 #
1285 # The key must meet the following requirements before you can provide it to Compute Engine:
1286 # - The key is wrapped using a RSA public key certificate provided by Google.
1287 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1288 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1289 },
1290 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1291 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1292 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1293 {
1294 "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.
1295 "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.
1296 },
1297 ],
1298 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1299 "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.
1300 },
1301 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1302 "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.
1303 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1304 "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.
1305 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1306 "A String",
1307 ],
1308 "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.
1309 #
1310 # To see the latest fingerprint, make get() request to the instance.
1311 },
1312 "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.
1313 #
1314 # To see the latest fingerprint, make get() request to the instance.
1315 "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.
1316 #
1317 # 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.
1318 #
1319 # The request will be rejected if the private host has run out of resources.
1320 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1321 "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.
1322 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1323 { # An instance-attached disk resource.
1324 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1325 #
1326 # 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.
1327 #
1328 # 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.
1329 #
1330 # 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.
1331 #
1332 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1333 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1334 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1335 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1336 #
1337 # The key must meet the following requirements before you can provide it to Compute Engine:
1338 # - The key is wrapped using a RSA public key certificate provided by Google.
1339 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1340 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1341 },
1342 "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.
1343 #
1344 # 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.
1345 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1346 "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.
1347 #
1348 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1349 #
1350 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1351 "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.
1352 #
1353 # 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.
1354 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1355 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1356 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1357 #
1358 # The key must meet the following requirements before you can provide it to Compute Engine:
1359 # - The key is wrapped using a RSA public key certificate provided by Google.
1360 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1361 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1362 },
1363 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1364 "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:
1365 #
1366 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1367 #
1368 # 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:
1369 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1370 # - projects/project/zones/zone/diskTypes/diskType
1371 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1372 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001373 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001374 #
1375 # 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:
1376 #
1377 # projects/debian-cloud/global/images/family/debian-8
1378 #
1379 # Alternatively, use a specific version of a public operating system image:
1380 #
1381 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1382 #
1383 # To create a disk with a private image that you created, specify the image name in the following format:
1384 #
1385 # global/images/my-private-image
1386 #
1387 # 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:
1388 #
1389 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001390 #
1391 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001392 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1393 },
1394 "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).
1395 "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.
1396 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001397 "diskSizeGb": "A String", # The size of the disk in base-2 GB. This supersedes disk_size_gb in InitializeParams.
1398 "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.
1399 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001400 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1401 "A String",
1402 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001403 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001404 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
1405 #
1406 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
1407 #
1408 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001409 },
1410 ],
1411 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1412}
1413
1414
1415Returns:
1416 An object of the form:
1417
1418 { # An Operation resource, used to manage asynchronous API requests.
1419 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1420 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1421 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1422 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1423 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1424 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1425 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1426 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1427 "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.
1428 "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.
1429 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1430 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1431 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1432 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1433 {
1434 "message": "A String", # [Output Only] A human-readable description of the warning code.
1435 "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.
1436 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1437 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1438 {
1439 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1440 "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).
1441 },
1442 ],
1443 },
1444 ],
1445 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1446 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1447 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1448 "name": "A String", # [Output Only] Name of the resource.
1449 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1450 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1451 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1452 {
1453 "message": "A String", # [Output Only] An optional, human-readable error message.
1454 "code": "A String", # [Output Only] The error type identifier for this error.
1455 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1456 },
1457 ],
1458 },
1459 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1460 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001461 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001462 }</pre>
1463</div>
1464
1465<div class="method">
1466 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
1467 <pre>Retrieves the list of instances contained within the specified zone.
1468
1469Args:
1470 project: string, Project ID for this request. (required)
1471 zone: string, The name of the zone for this request. (required)
1472 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1473
1474You 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.
1475
1476Currently, only sorting by name or creationTimestamp desc is supported.
1477 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.
1478 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.
1479 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.
1480
1481The 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.
1482
1483For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
1484
1485You 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.
1486
1487To 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.
1488
1489Returns:
1490 An object of the form:
1491
1492 { # Contains a list of instances.
1493 "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.
1494 "items": [ # [Output Only] A list of instances.
1495 { # An Instance resource.
1496 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, and TERMINATED.
1497 "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.
1498 "a_key": "A String",
1499 },
1500 "scheduling": { # Sets the scheduling options for an Instance. # Scheduling options for this instance.
1501 "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.
1502 "preemptible": True or False, # Whether the instance is preemptible.
1503 "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.
1504 },
1505 "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:
1506 #
1507 # zones/us-central1-f/machineTypes/n1-standard-1
1508 #
1509 # 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):
1510 #
1511 # zones/zone/machineTypes/custom-CPUS-MEMORY
1512 #
1513 # For example: zones/us-central1-f/machineTypes/custom-4-5120
1514 #
1515 # For a full list of restrictions, read the Specifications for custom machine types.
1516 "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.
1517 { # A service account.
1518 "scopes": [ # The list of scopes to be made available for this service account.
1519 "A String",
1520 ],
1521 "email": "A String", # Email address of the service account.
1522 },
1523 ],
1524 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1525 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1526 "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.
1527 { # A network interface resource attached to an instance.
1528 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks.
1529 { # An alias IP range attached to an instance's network interface.
1530 "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.
1531 "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).
1532 },
1533 ],
1534 "name": "A String", # [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc.
1535 "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.
1536 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
1537 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
1538 "name": "A String", # Name of this access configuration.
1539 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001540 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: CLOUD_NETWORK_PREMIUM , CLOUD_NETWORK_STANDARD. If this field is not specified, it is assumed to be CLOUD_NETWORK_PREMIUM.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001541 "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.
1542 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
1543 "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.
1544 "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.
1545 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
1546 },
1547 ],
1548 "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.
1549 "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:
1550 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
1551 # - regions/region/subnetworks/subnetwork
1552 "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:
1553 #
1554 # global/networks/default
1555 #
1556 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:
1557 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network
1558 # - projects/project/global/networks/network
1559 # - global/networks/default
1560 },
1561 ],
1562 "zone": "A String", # [Output Only] URL of the zone where the instance resides.
1563 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts data for an instance with a customer-supplied encryption key.
1564 #
1565 # 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.
1566 #
1567 # 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.
1568 #
1569 # 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.
1570 #
1571 # 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.
1572 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1573 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1574 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1575 #
1576 # The key must meet the following requirements before you can provide it to Compute Engine:
1577 # - The key is wrapped using a RSA public key certificate provided by Google.
1578 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1579 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1580 },
1581 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status.
1582 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.
1583 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
1584 {
1585 "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.
1586 "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.
1587 },
1588 ],
1589 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
1590 "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.
1591 },
1592 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance.
1593 "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.
1594 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1595 "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.
1596 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
1597 "A String",
1598 ],
1599 "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.
1600 #
1601 # To see the latest fingerprint, make get() request to the instance.
1602 },
1603 "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.
1604 #
1605 # To see the latest fingerprint, make get() request to the instance.
1606 "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.
1607 #
1608 # 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.
1609 #
1610 # The request will be rejected if the private host has run out of resources.
1611 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances.
1612 "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.
1613 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them.
1614 { # An instance-attached disk resource.
1615 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key.
1616 #
1617 # 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.
1618 #
1619 # 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.
1620 #
1621 # 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.
1622 #
1623 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group.
1624 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1625 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1626 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1627 #
1628 # The key must meet the following requirements before you can provide it to Compute Engine:
1629 # - The key is wrapped using a RSA public key certificate provided by Google.
1630 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1631 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1632 },
1633 "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.
1634 #
1635 # 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.
1636 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
1637 "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.
1638 #
1639 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1640 #
1641 # This property is mutually exclusive with the source property; you can only define one or the other, but not both.
1642 "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.
1643 #
1644 # 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.
1645 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1646 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1647 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1648 #
1649 # The key must meet the following requirements before you can provide it to Compute Engine:
1650 # - The key is wrapped using a RSA public key certificate provided by Google.
1651 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
1652 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1653 },
1654 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance.
1655 "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:
1656 #
1657 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard
1658 #
1659 # 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:
1660 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
1661 # - projects/project/zones/zone/diskTypes/diskType
1662 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL.
1663 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001664 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001665 #
1666 # 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:
1667 #
1668 # projects/debian-cloud/global/images/family/debian-8
1669 #
1670 # Alternatively, use a specific version of a public operating system image:
1671 #
1672 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
1673 #
1674 # To create a disk with a private image that you created, specify the image name in the following format:
1675 #
1676 # global/images/my-private-image
1677 #
1678 # 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:
1679 #
1680 # global/images/family/my-private-family
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001681 #
1682 # If the source image is deleted later, this field will not be set.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001683 "diskStorageType": "A String", # [Deprecated] Storage type of the disk.
1684 },
1685 "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).
1686 "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.
1687 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001688 "diskSizeGb": "A String", # The size of the disk in base-2 GB. This supersedes disk_size_gb in InitializeParams.
1689 "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.
1690 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001691 "licenses": [ # [Output Only] Any valid publicly visible licenses.
1692 "A String",
1693 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001694 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001695 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required.
1696 #
1697 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks.
1698 #
1699 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001700 },
1701 ],
1702 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1703 },
1704 ],
1705 "kind": "compute#instanceList", # [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.
1706 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1707 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1708 }</pre>
1709</div>
1710
1711<div class="method">
1712 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1713 <pre>Retrieves the next page of results.
1714
1715Args:
1716 previous_request: The request for the previous page. (required)
1717 previous_response: The response from the request for the previous page. (required)
1718
1719Returns:
1720 A request object that you can call 'execute()' on to request the next
1721 page. Returns None if there are no more items in the collection.
1722 </pre>
1723</div>
1724
1725<div class="method">
1726 <code class="details" id="reset">reset(project, zone, instance)</code>
1727 <pre>Performs a hard reset on the instance.
1728
1729Args:
1730 project: string, Project ID for this request. (required)
1731 zone: string, The name of the zone for this request. (required)
1732 instance: string, Name of the instance scoping this request. (required)
1733
1734Returns:
1735 An object of the form:
1736
1737 { # An Operation resource, used to manage asynchronous API requests.
1738 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1739 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1740 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1741 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1742 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1743 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1744 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1745 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1746 "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.
1747 "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.
1748 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1749 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1750 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1751 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1752 {
1753 "message": "A String", # [Output Only] A human-readable description of the warning code.
1754 "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.
1755 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1756 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1757 {
1758 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1759 "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).
1760 },
1761 ],
1762 },
1763 ],
1764 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1765 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1766 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1767 "name": "A String", # [Output Only] Name of the resource.
1768 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1769 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1770 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1771 {
1772 "message": "A String", # [Output Only] An optional, human-readable error message.
1773 "code": "A String", # [Output Only] The error type identifier for this error.
1774 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1775 },
1776 ],
1777 },
1778 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1779 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001780 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001781 }</pre>
1782</div>
1783
1784<div class="method">
1785 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName)</code>
1786 <pre>Sets the auto-delete flag for a disk attached to an instance.
1787
1788Args:
1789 project: string, Project ID for this request. (required)
1790 zone: string, The name of the zone for this request. (required)
1791 instance: string, The instance name. (required)
1792 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required)
1793 deviceName: string, The device name of the disk to modify. (required)
1794
1795Returns:
1796 An object of the form:
1797
1798 { # An Operation resource, used to manage asynchronous API requests.
1799 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1800 "clientOperationId": "A String", # [Output Only] Reserved for future use.
1801 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1802 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1803 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
1804 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1805 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1806 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1807 "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.
1808 "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.
1809 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1810 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1811 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1812 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1813 {
1814 "message": "A String", # [Output Only] A human-readable description of the warning code.
1815 "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.
1816 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1817 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1818 {
1819 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1820 "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).
1821 },
1822 ],
1823 },
1824 ],
1825 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1826 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1827 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1828 "name": "A String", # [Output Only] Name of the resource.
1829 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
1830 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1831 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1832 {
1833 "message": "A String", # [Output Only] An optional, human-readable error message.
1834 "code": "A String", # [Output Only] The error type identifier for this error.
1835 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1836 },
1837 ],
1838 },
1839 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1840 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001841 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001842 }</pre>
1843</div>
1844
1845<div class="method">
1846 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body)</code>
1847 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1848
1849Args:
1850 project: string, Project ID for this request. (required)
1851 zone: string, The name of the zone for this request. (required)
1852 resource: string, Name of the resource for this request. (required)
1853 body: object, The request body. (required)
1854 The object takes the form of:
1855
1856{ # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
1857 #
1858 #
1859 #
1860 # 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.
1861 #
1862 # **Example**
1863 #
1864 # { "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"] } ] }
1865 #
1866 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).
1867 "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.
1868 #
1869 # Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001870 { # Provides the configuration for non-admin_activity logging for a service. Controls exemptions and specific log sub-types.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001871 "exemptedMembers": [ # Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of Binding.members.
1872 "A String",
1873 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001874 "auditLogConfigs": [ # The configuration for each type of logging
1875 { # Provides the configuration for a sub-type of logging.
1876 "exemptedMembers": [ # Specifies the identities that are exempted from this type of logging Follows the same format of Binding.members.
1877 "A String",
1878 ],
1879 "logType": "A String", # The log type that this config enables.
1880 },
1881 ],
1882 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a special value that covers all services.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001883 },
1884 ],
1885 "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.
1886 { # A rule to be applied in a Policy.
1887 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1888 { # Specifies what kind of log the caller must write
1889 "counter": { # Options for counters # Counter options.
1890 "field": "A String", # The field value to attribute.
1891 "metric": "A String", # The metric to update.
1892 },
1893 },
1894 ],
1895 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1896 "A String",
1897 ],
1898 "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.
1899 "A String",
1900 ],
1901 "action": "A String", # Required
1902 "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.
1903 "A String",
1904 ],
1905 "conditions": [ # Additional restrictions that must be met
1906 { # A condition to be met.
1907 "iam": "A String", # Trusted attributes supplied by the IAM system.
1908 "svc": "A String", # Trusted attributes discharged by the service.
1909 "value": "A String", # DEPRECATED. Use 'values' instead.
1910 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1911 "values": [ # The objects of the condition. This is mutually exclusive with 'value'.
1912 "A String",
1913 ],
1914 "op": "A String", # An operator to apply the subject with.
1915 },
1916 ],
1917 "description": "A String", # Human-readable description of the rule.
1918 },
1919 ],
1920 "version": 42, # Version of the `Policy`. The default version is 0.
1921 "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.
1922 #
1923 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
1924 "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.
1925 { # Associates `members` with a `role`.
1926 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1927 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1928 #
1929 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1930 #
1931 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1932 #
1933 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.
1934 #
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001935 #
1936 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001937 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1938 #
1939 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1940 #
1941 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.
1942 "A String",
1943 ],
1944 },
1945 ],
1946 "iamOwned": True or False,
1947}
1948
1949
1950Returns:
1951 An object of the form:
1952
1953 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
1954 #
1955 #
1956 #
1957 # 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.
1958 #
1959 # **Example**
1960 #
1961 # { "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"] } ] }
1962 #
1963 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).
1964 "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.
1965 #
1966 # Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001967 { # Provides the configuration for non-admin_activity logging for a service. Controls exemptions and specific log sub-types.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001968 "exemptedMembers": [ # Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of Binding.members.
1969 "A String",
1970 ],
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001971 "auditLogConfigs": [ # The configuration for each type of logging
1972 { # Provides the configuration for a sub-type of logging.
1973 "exemptedMembers": [ # Specifies the identities that are exempted from this type of logging Follows the same format of Binding.members.
1974 "A String",
1975 ],
1976 "logType": "A String", # The log type that this config enables.
1977 },
1978 ],
1979 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a special value that covers all services.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001980 },
1981 ],
1982 "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.
1983 { # A rule to be applied in a Policy.
1984 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1985 { # Specifies what kind of log the caller must write
1986 "counter": { # Options for counters # Counter options.
1987 "field": "A String", # The field value to attribute.
1988 "metric": "A String", # The metric to update.
1989 },
1990 },
1991 ],
1992 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1993 "A String",
1994 ],
1995 "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.
1996 "A String",
1997 ],
1998 "action": "A String", # Required
1999 "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.
2000 "A String",
2001 ],
2002 "conditions": [ # Additional restrictions that must be met
2003 { # A condition to be met.
2004 "iam": "A String", # Trusted attributes supplied by the IAM system.
2005 "svc": "A String", # Trusted attributes discharged by the service.
2006 "value": "A String", # DEPRECATED. Use 'values' instead.
2007 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
2008 "values": [ # The objects of the condition. This is mutually exclusive with 'value'.
2009 "A String",
2010 ],
2011 "op": "A String", # An operator to apply the subject with.
2012 },
2013 ],
2014 "description": "A String", # Human-readable description of the rule.
2015 },
2016 ],
2017 "version": 42, # Version of the `Policy`. The default version is 0.
2018 "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.
2019 #
2020 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
2021 "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.
2022 { # Associates `members` with a `role`.
2023 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
2024 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
2025 #
2026 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
2027 #
2028 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
2029 #
2030 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.
2031 #
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002032 #
2033 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002034 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
2035 #
2036 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
2037 #
2038 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.
2039 "A String",
2040 ],
2041 },
2042 ],
2043 "iamOwned": True or False,
2044 }</pre>
2045</div>
2046
2047<div class="method">
2048 <code class="details" id="setLabels">setLabels(project, zone, instance, body)</code>
2049 <pre>Sets labels on an instance. To learn more about labels, read the Labeling or Tagging Resources documentation.
2050
2051Args:
2052 project: string, Project ID for this request. (required)
2053 zone: string, The name of the zone for this request. (required)
2054 instance: string, Name of the instance scoping this request. (required)
2055 body: object, The request body. (required)
2056 The object takes the form of:
2057
2058{
2059 "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.
2060 "labels": { # A list of labels to apply for this instance. Changing instance labels will also change the instance tags.
2061 #
2062 # 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": "").
2063 "a_key": "A String",
2064 },
2065 }
2066
2067
2068Returns:
2069 An object of the form:
2070
2071 { # An Operation resource, used to manage asynchronous API requests.
2072 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2073 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2074 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2075 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2076 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2077 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2078 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2079 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2080 "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.
2081 "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.
2082 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2083 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2084 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2085 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2086 {
2087 "message": "A String", # [Output Only] A human-readable description of the warning code.
2088 "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.
2089 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2090 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2091 {
2092 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2093 "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).
2094 },
2095 ],
2096 },
2097 ],
2098 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2099 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2100 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2101 "name": "A String", # [Output Only] Name of the resource.
2102 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2103 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2104 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2105 {
2106 "message": "A String", # [Output Only] An optional, human-readable error message.
2107 "code": "A String", # [Output Only] The error type identifier for this error.
2108 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2109 },
2110 ],
2111 },
2112 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2113 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002114 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002115 }</pre>
2116</div>
2117
2118<div class="method">
2119 <code class="details" id="setMachineType">setMachineType(project, zone, instance, body)</code>
2120 <pre>Changes the machine type for a stopped instance to the machine type specified in the request.
2121
2122Args:
2123 project: string, Project ID for this request. (required)
2124 zone: string, The name of the zone for this request. (required)
2125 instance: string, Name of the instance scoping this request. (required)
2126 body: object, The request body. (required)
2127 The object takes the form of:
2128
2129{
2130 "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
2131 }
2132
2133
2134Returns:
2135 An object of the form:
2136
2137 { # An Operation resource, used to manage asynchronous API requests.
2138 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2139 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2140 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2141 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2142 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2143 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2144 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2145 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2146 "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.
2147 "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.
2148 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2149 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2150 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2151 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2152 {
2153 "message": "A String", # [Output Only] A human-readable description of the warning code.
2154 "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.
2155 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2156 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2157 {
2158 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2159 "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).
2160 },
2161 ],
2162 },
2163 ],
2164 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2165 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2166 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2167 "name": "A String", # [Output Only] Name of the resource.
2168 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2169 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2170 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2171 {
2172 "message": "A String", # [Output Only] An optional, human-readable error message.
2173 "code": "A String", # [Output Only] The error type identifier for this error.
2174 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2175 },
2176 ],
2177 },
2178 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2179 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002180 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002181 }</pre>
2182</div>
2183
2184<div class="method">
2185 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body)</code>
2186 <pre>Sets metadata for the specified instance to the data included in the request.
2187
2188Args:
2189 project: string, Project ID for this request. (required)
2190 zone: string, The name of the zone for this request. (required)
2191 instance: string, Name of the instance scoping this request. (required)
2192 body: object, The request body. (required)
2193 The object takes the form of:
2194
2195{ # A metadata key/value entry.
2196 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
2197 {
2198 "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.
2199 "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.
2200 },
2201 ],
2202 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
2203 "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.
2204}
2205
2206
2207Returns:
2208 An object of the form:
2209
2210 { # An Operation resource, used to manage asynchronous API requests.
2211 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2212 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2213 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2214 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2215 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2216 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2217 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2218 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2219 "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.
2220 "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.
2221 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2222 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2223 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2224 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2225 {
2226 "message": "A String", # [Output Only] A human-readable description of the warning code.
2227 "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.
2228 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2229 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2230 {
2231 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2232 "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).
2233 },
2234 ],
2235 },
2236 ],
2237 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2238 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2239 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2240 "name": "A String", # [Output Only] Name of the resource.
2241 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2242 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2243 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2244 {
2245 "message": "A String", # [Output Only] An optional, human-readable error message.
2246 "code": "A String", # [Output Only] The error type identifier for this error.
2247 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2248 },
2249 ],
2250 },
2251 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2252 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002253 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002254 }</pre>
2255</div>
2256
2257<div class="method">
2258 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body)</code>
2259 <pre>Sets an instance's scheduling options.
2260
2261Args:
2262 project: string, Project ID for this request. (required)
2263 zone: string, The name of the zone for this request. (required)
2264 instance: string, Instance name. (required)
2265 body: object, The request body. (required)
2266 The object takes the form of:
2267
2268{ # Sets the scheduling options for an Instance.
2269 "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.
2270 "preemptible": True or False, # Whether the instance is preemptible.
2271 "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.
2272}
2273
2274
2275Returns:
2276 An object of the form:
2277
2278 { # An Operation resource, used to manage asynchronous API requests.
2279 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2280 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2281 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2282 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2283 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2284 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2285 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2286 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2287 "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.
2288 "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.
2289 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2290 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2291 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2292 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2293 {
2294 "message": "A String", # [Output Only] A human-readable description of the warning code.
2295 "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.
2296 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2297 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2298 {
2299 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2300 "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).
2301 },
2302 ],
2303 },
2304 ],
2305 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2306 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2307 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2308 "name": "A String", # [Output Only] Name of the resource.
2309 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2310 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2311 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2312 {
2313 "message": "A String", # [Output Only] An optional, human-readable error message.
2314 "code": "A String", # [Output Only] The error type identifier for this error.
2315 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2316 },
2317 ],
2318 },
2319 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2320 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002321 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002322 }</pre>
2323</div>
2324
2325<div class="method">
2326 <code class="details" id="setServiceAccount">setServiceAccount(project, zone, instance, body)</code>
2327 <pre>Sets the service account on the instance.
2328
2329Args:
2330 project: string, Project ID for this request. (required)
2331 zone: string, The name of the zone for this request. (required)
2332 instance: string, Name of the instance resource to start. (required)
2333 body: object, The request body. (required)
2334 The object takes the form of:
2335
2336{
2337 "scopes": [ # The list of scopes to be made available for this service account.
2338 "A String",
2339 ],
2340 "email": "A String", # Email address of the service account.
2341 }
2342
2343
2344Returns:
2345 An object of the form:
2346
2347 { # An Operation resource, used to manage asynchronous API requests.
2348 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2349 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2350 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2351 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2352 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2353 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2354 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2355 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2356 "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.
2357 "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.
2358 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2359 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2360 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2361 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2362 {
2363 "message": "A String", # [Output Only] A human-readable description of the warning code.
2364 "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.
2365 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2366 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2367 {
2368 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2369 "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).
2370 },
2371 ],
2372 },
2373 ],
2374 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2375 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2376 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2377 "name": "A String", # [Output Only] Name of the resource.
2378 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2379 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2380 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2381 {
2382 "message": "A String", # [Output Only] An optional, human-readable error message.
2383 "code": "A String", # [Output Only] The error type identifier for this error.
2384 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2385 },
2386 ],
2387 },
2388 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2389 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002390 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002391 }</pre>
2392</div>
2393
2394<div class="method">
2395 <code class="details" id="setTags">setTags(project, zone, instance, body)</code>
2396 <pre>Sets tags for the specified instance to the data included in the request.
2397
2398Args:
2399 project: string, Project ID for this request. (required)
2400 zone: string, The name of the zone for this request. (required)
2401 instance: string, Name of the instance scoping this request. (required)
2402 body: object, The request body. (required)
2403 The object takes the form of:
2404
2405{ # A set of instance tags.
2406 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.
2407 "A String",
2408 ],
2409 "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.
2410 #
2411 # To see the latest fingerprint, make get() request to the instance.
2412}
2413
2414
2415Returns:
2416 An object of the form:
2417
2418 { # An Operation resource, used to manage asynchronous API requests.
2419 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2420 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2421 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2422 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2423 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2424 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2425 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2426 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2427 "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.
2428 "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.
2429 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2430 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2431 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2432 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2433 {
2434 "message": "A String", # [Output Only] A human-readable description of the warning code.
2435 "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.
2436 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2437 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2438 {
2439 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2440 "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).
2441 },
2442 ],
2443 },
2444 ],
2445 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2446 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2447 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2448 "name": "A String", # [Output Only] Name of the resource.
2449 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2450 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2451 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2452 {
2453 "message": "A String", # [Output Only] An optional, human-readable error message.
2454 "code": "A String", # [Output Only] The error type identifier for this error.
2455 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2456 },
2457 ],
2458 },
2459 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2460 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002461 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002462 }</pre>
2463</div>
2464
2465<div class="method">
2466 <code class="details" id="start">start(project, zone, instance)</code>
2467 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2468
2469Args:
2470 project: string, Project ID for this request. (required)
2471 zone: string, The name of the zone for this request. (required)
2472 instance: string, Name of the instance resource to start. (required)
2473
2474Returns:
2475 An object of the form:
2476
2477 { # An Operation resource, used to manage asynchronous API requests.
2478 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2479 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2480 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2481 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2482 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2483 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2484 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2485 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2486 "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.
2487 "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.
2488 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2489 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2490 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2491 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2492 {
2493 "message": "A String", # [Output Only] A human-readable description of the warning code.
2494 "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.
2495 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2496 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2497 {
2498 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2499 "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).
2500 },
2501 ],
2502 },
2503 ],
2504 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2505 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2506 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2507 "name": "A String", # [Output Only] Name of the resource.
2508 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2509 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2510 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2511 {
2512 "message": "A String", # [Output Only] An optional, human-readable error message.
2513 "code": "A String", # [Output Only] The error type identifier for this error.
2514 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2515 },
2516 ],
2517 },
2518 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2519 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002520 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002521 }</pre>
2522</div>
2523
2524<div class="method">
2525 <code class="details" id="startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body)</code>
2526 <pre>Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.
2527
2528Args:
2529 project: string, Project ID for this request. (required)
2530 zone: string, The name of the zone for this request. (required)
2531 instance: string, Name of the instance resource to start. (required)
2532 body: object, The request body. (required)
2533 The object takes the form of:
2534
2535{
2536 "instanceEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with an instance that is protected with a customer-supplied encryption key.
2537 #
2538 # 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.
2539 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
2540 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
2541 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
2542 #
2543 # The key must meet the following requirements before you can provide it to Compute Engine:
2544 # - The key is wrapped using a RSA public key certificate provided by Google.
2545 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
2546 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
2547 },
2548 "disks": [ # Array of disks associated with this instance that are protected with a customer-supplied encryption key.
2549 #
2550 # In order to start the instance, the disk url and its corresponding key must be provided.
2551 #
2552 # If the disk is not protected with a customer-supplied encryption key it should not be specified.
2553 {
2554 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with the disk with a customer-supplied encryption key.
2555 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
2556 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
2557 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
2558 #
2559 # The key must meet the following requirements before you can provide it to Compute Engine:
2560 # - The key is wrapped using a RSA public key certificate provided by Google.
2561 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
2562 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
2563 },
2564 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks.
2565 },
2566 ],
2567 }
2568
2569
2570Returns:
2571 An object of the form:
2572
2573 { # An Operation resource, used to manage asynchronous API requests.
2574 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2575 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2576 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2577 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2578 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2579 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2580 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2581 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2582 "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.
2583 "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.
2584 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2585 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2586 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2587 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2588 {
2589 "message": "A String", # [Output Only] A human-readable description of the warning code.
2590 "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.
2591 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2592 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2593 {
2594 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2595 "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).
2596 },
2597 ],
2598 },
2599 ],
2600 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2601 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2602 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2603 "name": "A String", # [Output Only] Name of the resource.
2604 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2605 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2606 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2607 {
2608 "message": "A String", # [Output Only] An optional, human-readable error message.
2609 "code": "A String", # [Output Only] The error type identifier for this error.
2610 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2611 },
2612 ],
2613 },
2614 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2615 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002616 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002617 }</pre>
2618</div>
2619
2620<div class="method">
2621 <code class="details" id="stop">stop(project, zone, instance, discardLocalSsd=None)</code>
2622 <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.
2623
2624Args:
2625 project: string, Project ID for this request. (required)
2626 zone: string, The name of the zone for this request. (required)
2627 instance: string, Name of the instance resource to stop. (required)
2628 discardLocalSsd: boolean, If true, discard the contents of any attached localSSD partitions. Default value is false.
2629
2630Returns:
2631 An object of the form:
2632
2633 { # An Operation resource, used to manage asynchronous API requests.
2634 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2635 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2636 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2637 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2638 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2639 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2640 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2641 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2642 "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.
2643 "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.
2644 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2645 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2646 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2647 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2648 {
2649 "message": "A String", # [Output Only] A human-readable description of the warning code.
2650 "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.
2651 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2652 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2653 {
2654 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2655 "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).
2656 },
2657 ],
2658 },
2659 ],
2660 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2661 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2662 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2663 "name": "A String", # [Output Only] Name of the resource.
2664 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2665 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2666 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2667 {
2668 "message": "A String", # [Output Only] An optional, human-readable error message.
2669 "code": "A String", # [Output Only] The error type identifier for this error.
2670 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2671 },
2672 ],
2673 },
2674 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2675 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002676 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002677 }</pre>
2678</div>
2679
2680<div class="method">
2681 <code class="details" id="suspend">suspend(project, zone, instance, discardLocalSsd=None)</code>
2682 <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.
2683
2684Args:
2685 project: string, Project ID for this request. (required)
2686 zone: string, The name of the zone for this request. (required)
2687 instance: string, Name of the instance resource to suspend. (required)
2688 discardLocalSsd: boolean, If true, discard the contents of any attached localSSD partitions. Default value is false.
2689
2690Returns:
2691 An object of the form:
2692
2693 { # An Operation resource, used to manage asynchronous API requests.
2694 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2695 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2696 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2697 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2698 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2699 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2700 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2701 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2702 "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.
2703 "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.
2704 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2705 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2706 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2707 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2708 {
2709 "message": "A String", # [Output Only] A human-readable description of the warning code.
2710 "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.
2711 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2712 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2713 {
2714 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2715 "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).
2716 },
2717 ],
2718 },
2719 ],
2720 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2721 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2722 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2723 "name": "A String", # [Output Only] Name of the resource.
2724 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2725 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2726 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2727 {
2728 "message": "A String", # [Output Only] An optional, human-readable error message.
2729 "code": "A String", # [Output Only] The error type identifier for this error.
2730 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2731 },
2732 ],
2733 },
2734 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2735 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002736 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002737 }</pre>
2738</div>
2739
2740<div class="method">
2741 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code>
2742 <pre>Returns permissions that a caller has on the specified resource.
2743
2744Args:
2745 project: string, Project ID for this request. (required)
2746 zone: string, The name of the zone for this request. (required)
2747 resource: string, Name of the resource for this request. (required)
2748 body: object, The request body. (required)
2749 The object takes the form of:
2750
2751{
2752 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
2753 "A String",
2754 ],
2755 }
2756
2757
2758Returns:
2759 An object of the form:
2760
2761 {
2762 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2763 "A String",
2764 ],
2765 }</pre>
2766</div>
2767
2768<div class="method">
2769 <code class="details" id="updateAccessConfig">updateAccessConfig(project, zone, instance, networkInterface, body)</code>
2770 <pre>Updates the specified access config from an instance's network interface with the data included in the request.
2771
2772Args:
2773 project: string, Project ID for this request. (required)
2774 zone: string, The name of the zone for this request. (required)
2775 instance: string, The instance name for this request. (required)
2776 networkInterface: string, The name of the network interface where the access config is attached. (required)
2777 body: object, The request body. (required)
2778 The object takes the form of:
2779
2780{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported.
2781 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs.
2782 "name": "A String", # Name of this access configuration.
2783 "setPublicDns": True or False, # Specifies whether a public DNS ?A? record should be created for the external IP address of this access configuration.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002784 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: CLOUD_NETWORK_PREMIUM , CLOUD_NETWORK_STANDARD. If this field is not specified, it is assumed to be CLOUD_NETWORK_PREMIUM.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002785 "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.
2786 "dnsName": "A String", # [Output Only] The public DNS domain name for the instance.
2787 "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.
2788 "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.
2789 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT.
2790}
2791
2792
2793Returns:
2794 An object of the form:
2795
2796 { # An Operation resource, used to manage asynchronous API requests.
2797 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2798 "clientOperationId": "A String", # [Output Only] Reserved for future use.
2799 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
2800 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
2801 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
2802 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2803 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
2804 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
2805 "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.
2806 "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.
2807 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
2808 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
2809 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2810 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2811 {
2812 "message": "A String", # [Output Only] A human-readable description of the warning code.
2813 "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.
2814 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2815 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2816 {
2817 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2818 "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).
2819 },
2820 ],
2821 },
2822 ],
2823 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
2824 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2825 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
2826 "name": "A String", # [Output Only] Name of the resource.
2827 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
2828 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2829 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2830 {
2831 "message": "A String", # [Output Only] An optional, human-readable error message.
2832 "code": "A String", # [Output Only] The error type identifier for this error.
2833 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2834 },
2835 ],
2836 },
2837 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2838 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002839 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002840 }</pre>
2841</div>
2842
2843</body></html>