1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="compute_v1.html">Compute Engine API</a> . <a href="compute_v1.instances.html">instances</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body, requestId=None)</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 all of the instances in your project across all regions and zones.</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, requestId=None)</a></code></p> 88<p class="firstline">Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.</p> 89<p class="toc_element"> 90 <code><a href="#delete">delete(project, zone, instance, requestId=None)</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, requestId=None)</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, requestId=None)</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. Gets a list of available instances by making a list() request.</p> 101<p class="toc_element"> 102 <code><a href="#getGuestAttributes">getGuestAttributes(project, zone, instance, variableKey=None, queryPath=None)</a></code></p> 103<p class="firstline">Returns the specified guest attributes entry.</p> 104<p class="toc_element"> 105 <code><a href="#getIamPolicy">getIamPolicy(project, zone, resource)</a></code></p> 106<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p> 107<p class="toc_element"> 108 <code><a href="#getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</a></code></p> 109<p class="firstline">Returns the last 1 MB of serial port output from the specified instance.</p> 110<p class="toc_element"> 111 <code><a href="#getShieldedInstanceIdentity">getShieldedInstanceIdentity(project, zone, instance)</a></code></p> 112<p class="firstline">Returns the Shielded Instance Identity of an instance</p> 113<p class="toc_element"> 114 <code><a href="#insert">insert(project, zone, body, sourceInstanceTemplate=None, requestId=None)</a></code></p> 115<p class="firstline">Creates an instance resource in the specified project using the data included in the request.</p> 116<p class="toc_element"> 117 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 118<p class="firstline">Retrieves the list of instances contained within the specified zone.</p> 119<p class="toc_element"> 120 <code><a href="#listReferrers">listReferrers(project, zone, instance, orderBy=None, filter=None, maxResults=None, pageToken=None)</a></code></p> 121<p class="firstline">Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.</p> 122<p class="toc_element"> 123 <code><a href="#listReferrers_next">listReferrers_next(previous_request, previous_response)</a></code></p> 124<p class="firstline">Retrieves the next page of results.</p> 125<p class="toc_element"> 126 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 127<p class="firstline">Retrieves the next page of results.</p> 128<p class="toc_element"> 129 <code><a href="#reset">reset(project, zone, instance, requestId=None)</a></code></p> 130<p class="firstline">Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.</p> 131<p class="toc_element"> 132 <code><a href="#setDeletionProtection">setDeletionProtection(project, zone, resource, deletionProtection=None, requestId=None)</a></code></p> 133<p class="firstline">Sets deletion protection on the instance.</p> 134<p class="toc_element"> 135 <code><a href="#setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName, requestId=None)</a></code></p> 136<p class="firstline">Sets the auto-delete flag for a disk attached to an instance.</p> 137<p class="toc_element"> 138 <code><a href="#setIamPolicy">setIamPolicy(project, zone, resource, body)</a></code></p> 139<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p> 140<p class="toc_element"> 141 <code><a href="#setLabels">setLabels(project, zone, instance, body, requestId=None)</a></code></p> 142<p class="firstline">Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.</p> 143<p class="toc_element"> 144 <code><a href="#setMachineResources">setMachineResources(project, zone, instance, body, requestId=None)</a></code></p> 145<p class="firstline">Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.</p> 146<p class="toc_element"> 147 <code><a href="#setMachineType">setMachineType(project, zone, instance, body, requestId=None)</a></code></p> 148<p class="firstline">Changes the machine type for a stopped instance to the machine type specified in the request.</p> 149<p class="toc_element"> 150 <code><a href="#setMetadata">setMetadata(project, zone, instance, body, requestId=None)</a></code></p> 151<p class="firstline">Sets metadata for the specified instance to the data included in the request.</p> 152<p class="toc_element"> 153 <code><a href="#setMinCpuPlatform">setMinCpuPlatform(project, zone, instance, body, requestId=None)</a></code></p> 154<p class="firstline">Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.</p> 155<p class="toc_element"> 156 <code><a href="#setScheduling">setScheduling(project, zone, instance, body, requestId=None)</a></code></p> 157<p class="firstline">Sets an instance's scheduling options.</p> 158<p class="toc_element"> 159 <code><a href="#setServiceAccount">setServiceAccount(project, zone, instance, body, requestId=None)</a></code></p> 160<p class="firstline">Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.</p> 161<p class="toc_element"> 162 <code><a href="#setShieldedInstanceIntegrityPolicy">setShieldedInstanceIntegrityPolicy(project, zone, instance, body, requestId=None)</a></code></p> 163<p class="firstline">Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.</p> 164<p class="toc_element"> 165 <code><a href="#setTags">setTags(project, zone, instance, body, requestId=None)</a></code></p> 166<p class="firstline">Sets network tags for the specified instance to the data included in the request.</p> 167<p class="toc_element"> 168 <code><a href="#simulateMaintenanceEvent">simulateMaintenanceEvent(project, zone, instance)</a></code></p> 169<p class="firstline">Simulates a maintenance event on the instance.</p> 170<p class="toc_element"> 171 <code><a href="#start">start(project, zone, instance, requestId=None)</a></code></p> 172<p class="firstline">Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.</p> 173<p class="toc_element"> 174 <code><a href="#startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body, requestId=None)</a></code></p> 175<p class="firstline">Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.</p> 176<p class="toc_element"> 177 <code><a href="#stop">stop(project, zone, instance, requestId=None)</a></code></p> 178<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 VM usage charges while they are stopped. However, resources that the VM 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> 179<p class="toc_element"> 180 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p> 181<p class="firstline">Returns permissions that a caller has on the specified resource.</p> 182<p class="toc_element"> 183 <code><a href="#updateAccessConfig">updateAccessConfig(project, zone, instance, networkInterface, body, requestId=None)</a></code></p> 184<p class="firstline">Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.</p> 185<p class="toc_element"> 186 <code><a href="#updateNetworkInterface">updateNetworkInterface(project, zone, instance, networkInterface, body, requestId=None)</a></code></p> 187<p class="firstline">Updates an instance's network interface. This method follows PATCH semantics.</p> 188<p class="toc_element"> 189 <code><a href="#updateShieldedInstanceConfig">updateShieldedInstanceConfig(project, zone, instance, body, requestId=None)</a></code></p> 190<p class="firstline">Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.</p> 191<h3>Method Details</h3> 192<div class="method"> 193 <code class="details" id="addAccessConfig">addAccessConfig(project, zone, instance, networkInterface, body, requestId=None)</code> 194 <pre>Adds an access config to an instance's network interface. 195 196Args: 197 project: string, Project ID for this request. (required) 198 zone: string, The name of the zone for this request. (required) 199 instance: string, The instance name for this request. (required) 200 networkInterface: string, The name of the network interface to add to this instance. (required) 201 body: object, The request body. (required) 202 The object takes the form of: 203 204{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported. 205 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs. 206 "name": "A String", # The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. 207 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. 208 # 209 # If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. 210 # 211 # If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. 212 "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. 213 "setPublicPtr": 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. 214 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT. 215 "publicPtrDomainName": "A String", # The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. 216} 217 218 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 219 220For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 221 222The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 223 224Returns: 225 An object of the form: 226 227 { # Represents an Operation resource. 228 # 229 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 230 # 231 # Operations can be global, regional or zonal. 232 # - For global operations, use the globalOperations resource. 233 # - For regional operations, use the regionOperations resource. 234 # - For zonal operations, use the zonalOperations resource. 235 # 236 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 237 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 238 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 239 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 240 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 241 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 242 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 243 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 244 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 245 "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. 246 "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. 247 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 248 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 249 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 250 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 251 { 252 "message": "A String", # [Output Only] A human-readable description of the warning code. 253 "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. 254 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 255 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 256 { 257 "value": "A String", # [Output Only] A warning data value corresponding to the key. 258 "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). 259 }, 260 ], 261 }, 262 ], 263 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 264 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 265 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 266 "name": "A String", # [Output Only] Name of the resource. 267 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 268 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 269 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 270 { 271 "message": "A String", # [Output Only] An optional, human-readable error message. 272 "code": "A String", # [Output Only] The error type identifier for this error. 273 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 274 }, 275 ], 276 }, 277 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 278 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 279 "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. 280 }</pre> 281</div> 282 283<div class="method"> 284 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 285 <pre>Retrieves aggregated list of all of the instances in your project across all regions and zones. 286 287Args: 288 project: string, Project ID for this request. (required) 289 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 290 291You 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. 292 293Currently, only sorting by name or creationTimestamp desc is supported. 294 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. Acceptable values are 0 to 500, inclusive. (Default: 500) 295 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. 296 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. 297 298For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. 299 300You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. 301 302To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). 303 304Returns: 305 An object of the form: 306 307 { 308 "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. 309 "kind": "compute#instanceAggregatedList", # [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. 310 "items": { # A list of InstancesScopedList resources. 311 "a_key": { # [Output Only] Name of the scope containing this set of instances. 312 "instances": [ # [Output Only] A list of instances contained in this scope. 313 { # Represents an Instance resource. 314 # 315 # An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances. (== resource_for beta.instances ==) (== resource_for v1.instances ==) 316 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and TERMINATED. 317 "guestAccelerators": [ # A list of the type and count of accelerator cards attached to the instance. 318 { # A specification of the type and number of accelerator cards attached to the instance. 319 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. 320 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. 321 }, 322 ], 323 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. 324 "a_key": "A String", 325 }, 326 "scheduling": { # Sets the scheduling options for an Instance. NextID: 9 # Sets the scheduling options for this instance. 327 "preemptible": True or False, # Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. 328 "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. 329 # 330 # By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. 331 "nodeAffinities": [ # A set of node affinity and anti-affinity. 332 { # Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. 333 "operator": "A String", # Defines the operation of node selection. 334 "values": [ # Corresponds to the label values of Node resource. 335 "A String", 336 ], 337 "key": "A String", # Corresponds to the label key of Node resource. 338 }, 339 ], 340 "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. 341 }, 342 "minCpuPlatform": "A String", # Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". 343 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. 344 # 345 # 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. 346 { # A service account. 347 "scopes": [ # The list of scopes to be made available for this service account. 348 "A String", 349 ], 350 "email": "A String", # Email address of the service account. 351 }, 352 ], 353 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 354 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 355 "networkInterfaces": [ # An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. 356 { # A network interface resource attached to an instance. 357 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. 358 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. 359 { # An alias IP range attached to an instance's network interface. 360 "subnetworkRangeName": "A String", # The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. 361 "ipCidrRange": "A String", # The IP alias ranges to allocate for this interface. 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 (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). 362 }, 363 ], 364 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. 365 # 366 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 367 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network 368 # - projects/project/global/networks/network 369 # - global/networks/default 370 "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. 371 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported. 372 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs. 373 "name": "A String", # The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. 374 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. 375 # 376 # If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. 377 # 378 # If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. 379 "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. 380 "setPublicPtr": 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. 381 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT. 382 "publicPtrDomainName": "A String", # The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. 383 }, 384 ], 385 "networkIP": "A String", # An IPv4 internal IP 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. 386 "fingerprint": "A String", # Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface, otherwise the request will fail with error 412 conditionNotMet. 387 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: 388 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork 389 # - regions/region/subnetworks/subnetwork 390 "name": "A String", # [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. 391 }, 392 ], 393 "startRestricted": True or False, # [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. 394 "shieldedInstanceConfig": { # A set of Shielded Instance options. 395 "enableVtpm": True or False, # Defines whether the instance has the vTPM enabled. 396 "enableIntegrityMonitoring": True or False, # Defines whether the instance has integrity monitoring enabled. 397 "enableSecureBoot": True or False, # Defines whether the instance has Secure Boot enabled. 398 }, 399 "zone": "A String", # [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. 400 "hostname": "A String", 401 "shieldedInstanceIntegrityPolicy": { # The policy describes the baseline against which Instance boot integrity is measured. 402 "updateAutoLearnPolicy": True or False, # Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. 403 }, 404 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. 405 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. 406 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB. 407 { 408 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). 409 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. 410 }, 411 ], 412 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata. 413 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. 414 # 415 # To see the latest fingerprint, make a get() request to retrieve the resource. 416 }, 417 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance. 418 "deletionProtection": True or False, # Whether the resource should be protected against deletion. 419 "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. 420 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 421 "tags": { # A set of instance tags. # 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. Multiple tags can be specified via the 'tags.items' field. 422 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. 423 "A String", 424 ], 425 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. 426 # 427 # To see the latest fingerprint, make get() request to the instance. 428 }, 429 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the label's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. 430 # 431 # To see the latest fingerprint, make get() request to the instance. 432 "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: 433 # zones/us-central1-f/machineTypes/n1-standard-1 434 # 435 # 436 # 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): 437 # zones/zone/machineTypes/custom-CPUS-MEMORY 438 # 439 # 440 # For example: zones/us-central1-f/machineTypes/custom-4-5120 441 # 442 # For a full list of restrictions, read the Specifications for custom machine types. 443 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances. 444 "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. 445 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them. 446 { # An instance-attached disk resource. 447 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key. 448 # 449 # 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. 450 # 451 # 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. 452 # 453 # 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. 454 # 455 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. 456 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 457 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 458 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 459 }, 460 "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. 461 # 462 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. 463 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. 464 "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. 465 # 466 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 467 # 468 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 469 "sourceSnapshot": "A String", # The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or disks.source is required except for local SSD. 470 # 471 # To create a disk with a snapshot that you created, specify the snapshot name in the following format: 472 # global/snapshots/my-backup 473 # 474 # 475 # If the source snapshot is deleted later, this field will not be set. 476 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance. If the disk with the instance name exists already in the given zone/region, a new name will be automatically generated. 477 "description": "A String", # An optional description. Provide this property when creating the disk. 478 "labels": { # Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. 479 "a_key": "A String", 480 }, 481 "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. 482 # 483 # 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. 484 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 485 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 486 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 487 }, 488 "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: 489 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard 490 # 491 # 492 # 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: 493 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType 494 # - projects/project/zones/zone/diskTypes/diskType 495 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. 496 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. 497 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. 498 "A String", 499 ], 500 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. 501 # 502 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: 503 # projects/debian-cloud/global/images/family/debian-9 504 # 505 # 506 # Alternatively, use a specific version of a public operating system image: 507 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD 508 # 509 # 510 # To create a disk with a custom image that you created, specify the image name in the following format: 511 # global/images/my-custom-image 512 # 513 # 514 # You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: 515 # global/images/family/my-image-family 516 # 517 # 518 # If the source image is deleted later, this field will not be set. 519 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. 520 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 521 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 522 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 523 }, 524 }, 525 "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). 526 "index": 42, # [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. 527 "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. 528 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. 529 { # Guest OS features. 530 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. 531 }, 532 ], 533 "licenses": [ # [Output Only] Any valid publicly visible licenses. 534 "A String", 535 ], 536 "mode": "A String", # The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. 537 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. TODO(b/131765817): Update documentation when NVME is supported. 538 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. 539 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. 540 # 541 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. 542 # 543 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk. 544 }, 545 ], 546 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 547 }, 548 ], 549 "warning": { # [Output Only] Informational warning which replaces the list of instances when the list is empty. 550 "message": "A String", # [Output Only] A human-readable description of the warning code. 551 "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. 552 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 553 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 554 { 555 "value": "A String", # [Output Only] A warning data value corresponding to the key. 556 "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). 557 }, 558 ], 559 }, 560 }, 561 }, 562 "warning": { # [Output Only] Informational warning message. 563 "message": "A String", # [Output Only] A human-readable description of the warning code. 564 "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. 565 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 566 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 567 { 568 "value": "A String", # [Output Only] A warning data value corresponding to the key. 569 "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). 570 }, 571 ], 572 }, 573 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. 574 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 575 }</pre> 576</div> 577 578<div class="method"> 579 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code> 580 <pre>Retrieves the next page of results. 581 582Args: 583 previous_request: The request for the previous page. (required) 584 previous_response: The response from the request for the previous page. (required) 585 586Returns: 587 A request object that you can call 'execute()' on to request the next 588 page. Returns None if there are no more items in the collection. 589 </pre> 590</div> 591 592<div class="method"> 593 <code class="details" id="attachDisk">attachDisk(project, zone, instance, body, forceAttach=None, requestId=None)</code> 594 <pre>Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. 595 596Args: 597 project: string, Project ID for this request. (required) 598 zone: string, The name of the zone for this request. (required) 599 instance: string, The instance name for this request. (required) 600 body: object, The request body. (required) 601 The object takes the form of: 602 603{ # An instance-attached disk resource. 604 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key. 605 # 606 # 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. 607 # 608 # 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. 609 # 610 # 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. 611 # 612 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. 613 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 614 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 615 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 616 }, 617 "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. 618 # 619 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. 620 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. 621 "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. 622 # 623 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 624 # 625 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 626 "sourceSnapshot": "A String", # The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or disks.source is required except for local SSD. 627 # 628 # To create a disk with a snapshot that you created, specify the snapshot name in the following format: 629 # global/snapshots/my-backup 630 # 631 # 632 # If the source snapshot is deleted later, this field will not be set. 633 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance. If the disk with the instance name exists already in the given zone/region, a new name will be automatically generated. 634 "description": "A String", # An optional description. Provide this property when creating the disk. 635 "labels": { # Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. 636 "a_key": "A String", 637 }, 638 "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. 639 # 640 # 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. 641 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 642 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 643 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 644 }, 645 "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: 646 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard 647 # 648 # 649 # 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: 650 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType 651 # - projects/project/zones/zone/diskTypes/diskType 652 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. 653 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. 654 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. 655 "A String", 656 ], 657 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. 658 # 659 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: 660 # projects/debian-cloud/global/images/family/debian-9 661 # 662 # 663 # Alternatively, use a specific version of a public operating system image: 664 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD 665 # 666 # 667 # To create a disk with a custom image that you created, specify the image name in the following format: 668 # global/images/my-custom-image 669 # 670 # 671 # You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: 672 # global/images/family/my-image-family 673 # 674 # 675 # If the source image is deleted later, this field will not be set. 676 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. 677 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 678 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 679 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 680 }, 681 }, 682 "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). 683 "index": 42, # [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. 684 "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. 685 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. 686 { # Guest OS features. 687 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. 688 }, 689 ], 690 "licenses": [ # [Output Only] Any valid publicly visible licenses. 691 "A String", 692 ], 693 "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. 694 "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. TODO(b/131765817): Update documentation when NVME is supported. 695 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. 696 "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 except for local SSD. 697 # 698 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. 699 # 700 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk. 701} 702 703 forceAttach: boolean, Whether to force attach the disk even if it's currently attached to another instance. 704 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 705 706For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 707 708The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 709 710Returns: 711 An object of the form: 712 713 { # Represents an Operation resource. 714 # 715 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 716 # 717 # Operations can be global, regional or zonal. 718 # - For global operations, use the globalOperations resource. 719 # - For regional operations, use the regionOperations resource. 720 # - For zonal operations, use the zonalOperations resource. 721 # 722 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 723 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 724 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 725 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 726 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 727 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 728 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 729 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 730 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 731 "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. 732 "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. 733 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 734 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 735 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 736 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 737 { 738 "message": "A String", # [Output Only] A human-readable description of the warning code. 739 "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. 740 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 741 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 742 { 743 "value": "A String", # [Output Only] A warning data value corresponding to the key. 744 "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). 745 }, 746 ], 747 }, 748 ], 749 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 750 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 751 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 752 "name": "A String", # [Output Only] Name of the resource. 753 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 754 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 755 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 756 { 757 "message": "A String", # [Output Only] An optional, human-readable error message. 758 "code": "A String", # [Output Only] The error type identifier for this error. 759 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 760 }, 761 ], 762 }, 763 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 764 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 765 "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. 766 }</pre> 767</div> 768 769<div class="method"> 770 <code class="details" id="delete">delete(project, zone, instance, requestId=None)</code> 771 <pre>Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. 772 773Args: 774 project: string, Project ID for this request. (required) 775 zone: string, The name of the zone for this request. (required) 776 instance: string, Name of the instance resource to delete. (required) 777 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 778 779For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 780 781The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 782 783Returns: 784 An object of the form: 785 786 { # Represents an Operation resource. 787 # 788 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 789 # 790 # Operations can be global, regional or zonal. 791 # - For global operations, use the globalOperations resource. 792 # - For regional operations, use the regionOperations resource. 793 # - For zonal operations, use the zonalOperations resource. 794 # 795 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 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] The value of `requestId` if you provided it in the request. Not present otherwise. 798 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 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 applicable 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 applicable 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. 838 "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. 839 }</pre> 840</div> 841 842<div class="method"> 843 <code class="details" id="deleteAccessConfig">deleteAccessConfig(project, zone, instance, accessConfig, networkInterface, requestId=None)</code> 844 <pre>Deletes an access config from an instance's network interface. 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, The instance name for this request. (required) 850 accessConfig: string, The name of the access config to delete. (required) 851 networkInterface: string, The name of the network interface. (required) 852 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 853 854For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 855 856The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 857 858Returns: 859 An object of the form: 860 861 { # Represents an Operation resource. 862 # 863 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 864 # 865 # Operations can be global, regional or zonal. 866 # - For global operations, use the globalOperations resource. 867 # - For regional operations, use the regionOperations resource. 868 # - For zonal operations, use the zonalOperations resource. 869 # 870 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 871 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 872 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 873 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 874 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 875 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 876 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 877 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 878 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 879 "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. 880 "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. 881 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 882 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 883 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 884 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 885 { 886 "message": "A String", # [Output Only] A human-readable description of the warning code. 887 "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. 888 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 889 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 890 { 891 "value": "A String", # [Output Only] A warning data value corresponding to the key. 892 "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). 893 }, 894 ], 895 }, 896 ], 897 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 898 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 899 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 900 "name": "A String", # [Output Only] Name of the resource. 901 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 902 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 903 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 904 { 905 "message": "A String", # [Output Only] An optional, human-readable error message. 906 "code": "A String", # [Output Only] The error type identifier for this error. 907 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 908 }, 909 ], 910 }, 911 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 912 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 913 "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. 914 }</pre> 915</div> 916 917<div class="method"> 918 <code class="details" id="detachDisk">detachDisk(project, zone, instance, deviceName, requestId=None)</code> 919 <pre>Detaches a disk from an instance. 920 921Args: 922 project: string, Project ID for this request. (required) 923 zone: string, The name of the zone for this request. (required) 924 instance: string, Instance name for this request. (required) 925 deviceName: string, The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. (required) 926 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 927 928For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 929 930The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 931 932Returns: 933 An object of the form: 934 935 { # Represents an Operation resource. 936 # 937 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 938 # 939 # Operations can be global, regional or zonal. 940 # - For global operations, use the globalOperations resource. 941 # - For regional operations, use the regionOperations resource. 942 # - For zonal operations, use the zonalOperations resource. 943 # 944 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 945 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 946 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 947 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 948 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 949 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 950 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 951 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 952 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 953 "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. 954 "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. 955 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 956 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 957 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 958 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 959 { 960 "message": "A String", # [Output Only] A human-readable description of the warning code. 961 "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. 962 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 963 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 964 { 965 "value": "A String", # [Output Only] A warning data value corresponding to the key. 966 "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). 967 }, 968 ], 969 }, 970 ], 971 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 972 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 973 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 974 "name": "A String", # [Output Only] Name of the resource. 975 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 976 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 977 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 978 { 979 "message": "A String", # [Output Only] An optional, human-readable error message. 980 "code": "A String", # [Output Only] The error type identifier for this error. 981 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 982 }, 983 ], 984 }, 985 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 986 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 987 "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. 988 }</pre> 989</div> 990 991<div class="method"> 992 <code class="details" id="get">get(project, zone, instance)</code> 993 <pre>Returns the specified Instance resource. Gets a list of available instances by making a list() request. 994 995Args: 996 project: string, Project ID for this request. (required) 997 zone: string, The name of the zone for this request. (required) 998 instance: string, Name of the instance resource to return. (required) 999 1000Returns: 1001 An object of the form: 1002 1003 { # Represents an Instance resource. 1004 # 1005 # An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances. (== resource_for beta.instances ==) (== resource_for v1.instances ==) 1006 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and TERMINATED. 1007 "guestAccelerators": [ # A list of the type and count of accelerator cards attached to the instance. 1008 { # A specification of the type and number of accelerator cards attached to the instance. 1009 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. 1010 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. 1011 }, 1012 ], 1013 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. 1014 "a_key": "A String", 1015 }, 1016 "scheduling": { # Sets the scheduling options for an Instance. NextID: 9 # Sets the scheduling options for this instance. 1017 "preemptible": True or False, # Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. 1018 "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. 1019 # 1020 # By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. 1021 "nodeAffinities": [ # A set of node affinity and anti-affinity. 1022 { # Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. 1023 "operator": "A String", # Defines the operation of node selection. 1024 "values": [ # Corresponds to the label values of Node resource. 1025 "A String", 1026 ], 1027 "key": "A String", # Corresponds to the label key of Node resource. 1028 }, 1029 ], 1030 "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. 1031 }, 1032 "minCpuPlatform": "A String", # Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". 1033 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. 1034 # 1035 # 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. 1036 { # A service account. 1037 "scopes": [ # The list of scopes to be made available for this service account. 1038 "A String", 1039 ], 1040 "email": "A String", # Email address of the service account. 1041 }, 1042 ], 1043 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 1044 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 1045 "networkInterfaces": [ # An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. 1046 { # A network interface resource attached to an instance. 1047 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. 1048 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. 1049 { # An alias IP range attached to an instance's network interface. 1050 "subnetworkRangeName": "A String", # The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. 1051 "ipCidrRange": "A String", # The IP alias ranges to allocate for this interface. 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 (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). 1052 }, 1053 ], 1054 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. 1055 # 1056 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 1057 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network 1058 # - projects/project/global/networks/network 1059 # - global/networks/default 1060 "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. 1061 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported. 1062 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs. 1063 "name": "A String", # The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. 1064 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. 1065 # 1066 # If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. 1067 # 1068 # If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. 1069 "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. 1070 "setPublicPtr": 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. 1071 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT. 1072 "publicPtrDomainName": "A String", # The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. 1073 }, 1074 ], 1075 "networkIP": "A String", # An IPv4 internal IP 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. 1076 "fingerprint": "A String", # Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface, otherwise the request will fail with error 412 conditionNotMet. 1077 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: 1078 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork 1079 # - regions/region/subnetworks/subnetwork 1080 "name": "A String", # [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. 1081 }, 1082 ], 1083 "startRestricted": True or False, # [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. 1084 "shieldedInstanceConfig": { # A set of Shielded Instance options. 1085 "enableVtpm": True or False, # Defines whether the instance has the vTPM enabled. 1086 "enableIntegrityMonitoring": True or False, # Defines whether the instance has integrity monitoring enabled. 1087 "enableSecureBoot": True or False, # Defines whether the instance has Secure Boot enabled. 1088 }, 1089 "zone": "A String", # [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. 1090 "hostname": "A String", 1091 "shieldedInstanceIntegrityPolicy": { # The policy describes the baseline against which Instance boot integrity is measured. 1092 "updateAutoLearnPolicy": True or False, # Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. 1093 }, 1094 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. 1095 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. 1096 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB. 1097 { 1098 "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 262144 bytes (256 KiB). 1099 "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. 1100 }, 1101 ], 1102 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata. 1103 "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, otherwise the request will fail with error 412 conditionNotMet. 1104 # 1105 # To see the latest fingerprint, make a get() request to retrieve the resource. 1106 }, 1107 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance. 1108 "deletionProtection": True or False, # Whether the resource should be protected against deletion. 1109 "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. 1110 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 1111 "tags": { # A set of instance tags. # 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. Multiple tags can be specified via the 'tags.items' field. 1112 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. 1113 "A String", 1114 ], 1115 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. 1116 # 1117 # To see the latest fingerprint, make get() request to the instance. 1118 }, 1119 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the label's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. 1120 # 1121 # To see the latest fingerprint, make get() request to the instance. 1122 "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: 1123 # zones/us-central1-f/machineTypes/n1-standard-1 1124 # 1125 # 1126 # 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): 1127 # zones/zone/machineTypes/custom-CPUS-MEMORY 1128 # 1129 # 1130 # For example: zones/us-central1-f/machineTypes/custom-4-5120 1131 # 1132 # For a full list of restrictions, read the Specifications for custom machine types. 1133 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances. 1134 "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. 1135 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them. 1136 { # An instance-attached disk resource. 1137 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key. 1138 # 1139 # 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. 1140 # 1141 # 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. 1142 # 1143 # 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. 1144 # 1145 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. 1146 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1147 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1148 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1149 }, 1150 "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. 1151 # 1152 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. 1153 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. 1154 "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. 1155 # 1156 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 1157 # 1158 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 1159 "sourceSnapshot": "A String", # The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or disks.source is required except for local SSD. 1160 # 1161 # To create a disk with a snapshot that you created, specify the snapshot name in the following format: 1162 # global/snapshots/my-backup 1163 # 1164 # 1165 # If the source snapshot is deleted later, this field will not be set. 1166 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance. If the disk with the instance name exists already in the given zone/region, a new name will be automatically generated. 1167 "description": "A String", # An optional description. Provide this property when creating the disk. 1168 "labels": { # Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. 1169 "a_key": "A String", 1170 }, 1171 "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. 1172 # 1173 # 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. 1174 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1175 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1176 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1177 }, 1178 "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: 1179 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard 1180 # 1181 # 1182 # 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: 1183 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType 1184 # - projects/project/zones/zone/diskTypes/diskType 1185 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. 1186 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. 1187 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. 1188 "A String", 1189 ], 1190 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. 1191 # 1192 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: 1193 # projects/debian-cloud/global/images/family/debian-9 1194 # 1195 # 1196 # Alternatively, use a specific version of a public operating system image: 1197 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD 1198 # 1199 # 1200 # To create a disk with a custom image that you created, specify the image name in the following format: 1201 # global/images/my-custom-image 1202 # 1203 # 1204 # You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: 1205 # global/images/family/my-image-family 1206 # 1207 # 1208 # If the source image is deleted later, this field will not be set. 1209 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. 1210 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1211 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1212 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1213 }, 1214 }, 1215 "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). 1216 "index": 42, # [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. 1217 "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. 1218 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. 1219 { # Guest OS features. 1220 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. 1221 }, 1222 ], 1223 "licenses": [ # [Output Only] Any valid publicly visible licenses. 1224 "A String", 1225 ], 1226 "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. 1227 "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. TODO(b/131765817): Update documentation when NVME is supported. 1228 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. 1229 "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 except for local SSD. 1230 # 1231 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. 1232 # 1233 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk. 1234 }, 1235 ], 1236 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 1237 }</pre> 1238</div> 1239 1240<div class="method"> 1241 <code class="details" id="getGuestAttributes">getGuestAttributes(project, zone, instance, variableKey=None, queryPath=None)</code> 1242 <pre>Returns the specified guest attributes entry. 1243 1244Args: 1245 project: string, Project ID for this request. (required) 1246 zone: string, The name of the zone for this request. (required) 1247 instance: string, Name of the instance scoping this request. (required) 1248 variableKey: string, Specifies the key for the guest attributes entry. 1249 queryPath: string, Specifies the guest attributes path to be queried. 1250 1251Returns: 1252 An object of the form: 1253 1254 { # A guest attributes entry. 1255 "kind": "compute#guestAttributes", # [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. 1256 "variableKey": "A String", # The key to search for. 1257 "queryValue": { # Array of guest attribute namespace/key/value tuples. # [Output Only] The value of the requested queried path. 1258 "items": [ 1259 { # A guest attributes namespace/key/value entry. 1260 "namespace": "A String", # Namespace for the guest attribute entry. 1261 "value": "A String", # Value for the guest attribute entry. 1262 "key": "A String", # Key for the guest attribute entry. 1263 }, 1264 ], 1265 }, 1266 "variableValue": "A String", # [Output Only] The value found for the requested key. 1267 "queryPath": "A String", # The path to be queried. This can be the default namespace ('/') or a nested namespace ('//') or a specified key ('//') 1268 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 1269 }</pre> 1270</div> 1271 1272<div class="method"> 1273 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource)</code> 1274 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists. 1275 1276Args: 1277 project: string, Project ID for this request. (required) 1278 zone: string, The name of the zone for this request. (required) 1279 resource: string, Name or id of the resource for this request. (required) 1280 1281Returns: 1282 An object of the form: 1283 1284 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. 1285 # 1286 # 1287 # 1288 # 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. 1289 # 1290 # **JSON Example** 1291 # 1292 # { "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"] } ] } 1293 # 1294 # **YAML Example** 1295 # 1296 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - members: - user:sean@example.com role: roles/viewer 1297 # 1298 # 1299 # 1300 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs). 1301 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. 1302 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. 1303 # 1304 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. 1305 # 1306 # Example Policy with multiple AuditConfigs: 1307 # 1308 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } 1309 # 1310 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging. 1311 "exemptedMembers": [ 1312 "A String", 1313 ], 1314 "auditLogConfigs": [ # The configuration for logging of each type of permission. 1315 { # Provides the configuration for logging a type of permissions. Example: 1316 # 1317 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } 1318 # 1319 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging. 1320 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. 1321 "A String", 1322 ], 1323 "logType": "A String", # The log type that this config enables. 1324 }, 1325 ], 1326 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. 1327 }, 1328 ], 1329 "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. 1330 { # A rule to be applied in a Policy. 1331 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. 1332 { # Specifies what kind of log the caller must write 1333 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options. 1334 # 1335 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended. 1336 # 1337 # Field names correspond to IAM request parameters and field values are their respective values. 1338 # 1339 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields. 1340 # 1341 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]} 1342 # 1343 # At this time we do not support multiple field names (though this may be supported in the future). 1344 "field": "A String", # The field value to attribute. 1345 "metric": "A String", # The metric to update. 1346 }, 1347 "dataAccess": { # Write a Data Access (Gin) log # Data access options. 1348 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now. 1349 }, 1350 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options. 1351 "logName": "A String", # The log_name to populate in the Cloud Audit Record. 1352 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline. 1353 "permissionType": "A String", # The type of the permission that was checked. 1354 }, 1355 }, 1356 }, 1357 ], 1358 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. 1359 "A String", 1360 ], 1361 "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. 1362 "A String", 1363 ], 1364 "action": "A String", # Required 1365 "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. 1366 "A String", 1367 ], 1368 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match. 1369 { # A condition to be met. 1370 "iam": "A String", # Trusted attributes supplied by the IAM system. 1371 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. 1372 "values": [ # The objects of the condition. 1373 "A String", 1374 ], 1375 "svc": "A String", # Trusted attributes discharged by the service. 1376 "op": "A String", # An operator to apply the subject with. 1377 }, 1378 ], 1379 "description": "A String", # Human-readable description of the rule. 1380 }, 1381 ], 1382 "version": 42, # Deprecated. 1383 "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. 1384 # 1385 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. 1386 "bindings": [ # Associates a list of `members` to a `role`. `bindings` with no members will result in an error. 1387 { # Associates `members` with a `role`. 1388 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 1389 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: 1390 # 1391 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. 1392 # 1393 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. 1394 # 1395 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` . 1396 # 1397 # 1398 # 1399 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. 1400 # 1401 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. 1402 # 1403 # 1404 # 1405 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. 1406 "A String", 1407 ], 1408 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. 1409 # 1410 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" 1411 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. 1412 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax. 1413 # 1414 # The application context of the containing message determines which well-known feature set of CEL is supported. 1415 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. 1416 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. 1417 }, 1418 }, 1419 ], 1420 "iamOwned": True or False, 1421 }</pre> 1422</div> 1423 1424<div class="method"> 1425 <code class="details" id="getSerialPortOutput">getSerialPortOutput(project, zone, instance, start=None, port=None)</code> 1426 <pre>Returns the last 1 MB of serial port output from the specified instance. 1427 1428Args: 1429 project: string, Project ID for this request. (required) 1430 zone: string, The name of the zone for this request. (required) 1431 instance: string, Name of the instance scoping this request. (required) 1432 start: string, Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. 1433 port: integer, Specifies which COM or serial port to retrieve data from. 1434 1435Returns: 1436 An object of the form: 1437 1438 { # An instance's serial console output. 1439 "start": "A String", # 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. 1440 "kind": "compute#serialPortOutput", # [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. 1441 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 1442 "contents": "A String", # [Output Only] The contents of the console output. 1443 "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. 1444 }</pre> 1445</div> 1446 1447<div class="method"> 1448 <code class="details" id="getShieldedInstanceIdentity">getShieldedInstanceIdentity(project, zone, instance)</code> 1449 <pre>Returns the Shielded Instance Identity of an instance 1450 1451Args: 1452 project: string, Project ID for this request. (required) 1453 zone: string, The name of the zone for this request. (required) 1454 instance: string, Name or id of the instance scoping this request. (required) 1455 1456Returns: 1457 An object of the form: 1458 1459 { # A shielded Instance identity entry. 1460 "signingKey": { # A Shielded Instance Identity Entry. # An Attestation Key (AK) issued to the Shielded Instance's vTPM. 1461 "ekPub": "A String", # A PEM-encoded public key. 1462 "ekCert": "A String", # A PEM-encoded X.509 certificate. This field can be empty. 1463 }, 1464 "kind": "compute#shieldedInstanceIdentity", # [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. 1465 "encryptionKey": { # A Shielded Instance Identity Entry. # An Endorsement Key (EK) issued to the Shielded Instance's vTPM. 1466 "ekPub": "A String", # A PEM-encoded public key. 1467 "ekCert": "A String", # A PEM-encoded X.509 certificate. This field can be empty. 1468 }, 1469 }</pre> 1470</div> 1471 1472<div class="method"> 1473 <code class="details" id="insert">insert(project, zone, body, sourceInstanceTemplate=None, requestId=None)</code> 1474 <pre>Creates an instance resource in the specified project using the data included in the request. 1475 1476Args: 1477 project: string, Project ID for this request. (required) 1478 zone: string, The name of the zone for this request. (required) 1479 body: object, The request body. (required) 1480 The object takes the form of: 1481 1482{ # Represents an Instance resource. 1483 # 1484 # An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances. (== resource_for beta.instances ==) (== resource_for v1.instances ==) 1485 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and TERMINATED. 1486 "guestAccelerators": [ # A list of the type and count of accelerator cards attached to the instance. 1487 { # A specification of the type and number of accelerator cards attached to the instance. 1488 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. 1489 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. 1490 }, 1491 ], 1492 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. 1493 "a_key": "A String", 1494 }, 1495 "scheduling": { # Sets the scheduling options for an Instance. NextID: 9 # Sets the scheduling options for this instance. 1496 "preemptible": True or False, # Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. 1497 "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. 1498 # 1499 # By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. 1500 "nodeAffinities": [ # A set of node affinity and anti-affinity. 1501 { # Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. 1502 "operator": "A String", # Defines the operation of node selection. 1503 "values": [ # Corresponds to the label values of Node resource. 1504 "A String", 1505 ], 1506 "key": "A String", # Corresponds to the label key of Node resource. 1507 }, 1508 ], 1509 "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. 1510 }, 1511 "minCpuPlatform": "A String", # Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". 1512 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. 1513 # 1514 # 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. 1515 { # A service account. 1516 "scopes": [ # The list of scopes to be made available for this service account. 1517 "A String", 1518 ], 1519 "email": "A String", # Email address of the service account. 1520 }, 1521 ], 1522 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 1523 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 1524 "networkInterfaces": [ # An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. 1525 { # A network interface resource attached to an instance. 1526 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. 1527 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. 1528 { # An alias IP range attached to an instance's network interface. 1529 "subnetworkRangeName": "A String", # The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. 1530 "ipCidrRange": "A String", # The IP alias ranges to allocate for this interface. 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 (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). 1531 }, 1532 ], 1533 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. 1534 # 1535 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 1536 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network 1537 # - projects/project/global/networks/network 1538 # - global/networks/default 1539 "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. 1540 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported. 1541 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs. 1542 "name": "A String", # The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. 1543 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. 1544 # 1545 # If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. 1546 # 1547 # If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. 1548 "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. 1549 "setPublicPtr": 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. 1550 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT. 1551 "publicPtrDomainName": "A String", # The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. 1552 }, 1553 ], 1554 "networkIP": "A String", # An IPv4 internal IP 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. 1555 "fingerprint": "A String", # Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface, otherwise the request will fail with error 412 conditionNotMet. 1556 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: 1557 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork 1558 # - regions/region/subnetworks/subnetwork 1559 "name": "A String", # [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. 1560 }, 1561 ], 1562 "startRestricted": True or False, # [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. 1563 "shieldedInstanceConfig": { # A set of Shielded Instance options. 1564 "enableVtpm": True or False, # Defines whether the instance has the vTPM enabled. 1565 "enableIntegrityMonitoring": True or False, # Defines whether the instance has integrity monitoring enabled. 1566 "enableSecureBoot": True or False, # Defines whether the instance has Secure Boot enabled. 1567 }, 1568 "zone": "A String", # [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. 1569 "hostname": "A String", 1570 "shieldedInstanceIntegrityPolicy": { # The policy describes the baseline against which Instance boot integrity is measured. 1571 "updateAutoLearnPolicy": True or False, # Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. 1572 }, 1573 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. 1574 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. 1575 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB. 1576 { 1577 "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 262144 bytes (256 KiB). 1578 "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. 1579 }, 1580 ], 1581 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata. 1582 "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, otherwise the request will fail with error 412 conditionNotMet. 1583 # 1584 # To see the latest fingerprint, make a get() request to retrieve the resource. 1585 }, 1586 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance. 1587 "deletionProtection": True or False, # Whether the resource should be protected against deletion. 1588 "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. 1589 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 1590 "tags": { # A set of instance tags. # 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. Multiple tags can be specified via the 'tags.items' field. 1591 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. 1592 "A String", 1593 ], 1594 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. 1595 # 1596 # To see the latest fingerprint, make get() request to the instance. 1597 }, 1598 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the label's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. 1599 # 1600 # To see the latest fingerprint, make get() request to the instance. 1601 "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: 1602 # zones/us-central1-f/machineTypes/n1-standard-1 1603 # 1604 # 1605 # 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): 1606 # zones/zone/machineTypes/custom-CPUS-MEMORY 1607 # 1608 # 1609 # For example: zones/us-central1-f/machineTypes/custom-4-5120 1610 # 1611 # For a full list of restrictions, read the Specifications for custom machine types. 1612 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances. 1613 "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. 1614 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them. 1615 { # An instance-attached disk resource. 1616 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key. 1617 # 1618 # 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. 1619 # 1620 # 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. 1621 # 1622 # 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. 1623 # 1624 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. 1625 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1626 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1627 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1628 }, 1629 "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. 1630 # 1631 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. 1632 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. 1633 "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. 1634 # 1635 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 1636 # 1637 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 1638 "sourceSnapshot": "A String", # The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or disks.source is required except for local SSD. 1639 # 1640 # To create a disk with a snapshot that you created, specify the snapshot name in the following format: 1641 # global/snapshots/my-backup 1642 # 1643 # 1644 # If the source snapshot is deleted later, this field will not be set. 1645 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance. If the disk with the instance name exists already in the given zone/region, a new name will be automatically generated. 1646 "description": "A String", # An optional description. Provide this property when creating the disk. 1647 "labels": { # Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. 1648 "a_key": "A String", 1649 }, 1650 "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. 1651 # 1652 # 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. 1653 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1654 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1655 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1656 }, 1657 "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: 1658 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard 1659 # 1660 # 1661 # 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: 1662 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType 1663 # - projects/project/zones/zone/diskTypes/diskType 1664 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. 1665 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. 1666 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. 1667 "A String", 1668 ], 1669 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. 1670 # 1671 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: 1672 # projects/debian-cloud/global/images/family/debian-9 1673 # 1674 # 1675 # Alternatively, use a specific version of a public operating system image: 1676 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD 1677 # 1678 # 1679 # To create a disk with a custom image that you created, specify the image name in the following format: 1680 # global/images/my-custom-image 1681 # 1682 # 1683 # You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: 1684 # global/images/family/my-image-family 1685 # 1686 # 1687 # If the source image is deleted later, this field will not be set. 1688 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. 1689 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1690 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1691 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1692 }, 1693 }, 1694 "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). 1695 "index": 42, # [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. 1696 "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. 1697 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. 1698 { # Guest OS features. 1699 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. 1700 }, 1701 ], 1702 "licenses": [ # [Output Only] Any valid publicly visible licenses. 1703 "A String", 1704 ], 1705 "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. 1706 "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. TODO(b/131765817): Update documentation when NVME is supported. 1707 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. 1708 "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 except for local SSD. 1709 # 1710 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. 1711 # 1712 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk. 1713 }, 1714 ], 1715 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 1716} 1717 1718 sourceInstanceTemplate: string, Specifies instance template to create the instance. 1719 1720This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: 1721- https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate 1722- projects/project/global/instanceTemplates/instanceTemplate 1723- global/instanceTemplates/instanceTemplate 1724 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 1725 1726For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 1727 1728The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 1729 1730Returns: 1731 An object of the form: 1732 1733 { # Represents an Operation resource. 1734 # 1735 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 1736 # 1737 # Operations can be global, regional or zonal. 1738 # - For global operations, use the globalOperations resource. 1739 # - For regional operations, use the regionOperations resource. 1740 # - For zonal operations, use the zonalOperations resource. 1741 # 1742 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 1743 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 1744 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 1745 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 1746 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 1747 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 1748 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 1749 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 1750 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 1751 "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. 1752 "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. 1753 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 1754 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 1755 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 1756 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 1757 { 1758 "message": "A String", # [Output Only] A human-readable description of the warning code. 1759 "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. 1760 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 1761 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 1762 { 1763 "value": "A String", # [Output Only] A warning data value corresponding to the key. 1764 "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). 1765 }, 1766 ], 1767 }, 1768 ], 1769 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 1770 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 1771 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 1772 "name": "A String", # [Output Only] Name of the resource. 1773 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 1774 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 1775 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 1776 { 1777 "message": "A String", # [Output Only] An optional, human-readable error message. 1778 "code": "A String", # [Output Only] The error type identifier for this error. 1779 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 1780 }, 1781 ], 1782 }, 1783 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 1784 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 1785 "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. 1786 }</pre> 1787</div> 1788 1789<div class="method"> 1790 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 1791 <pre>Retrieves the list of instances contained within the specified zone. 1792 1793Args: 1794 project: string, Project ID for this request. (required) 1795 zone: string, The name of the zone for this request. (required) 1796 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 1797 1798You 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. 1799 1800Currently, only sorting by name or creationTimestamp desc is supported. 1801 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. Acceptable values are 0 to 500, inclusive. (Default: 500) 1802 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. 1803 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. 1804 1805For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. 1806 1807You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. 1808 1809To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). 1810 1811Returns: 1812 An object of the form: 1813 1814 { # Contains a list of instances. 1815 "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. 1816 "kind": "compute#instanceList", # [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. 1817 "items": [ # A list of Instance resources. 1818 { # Represents an Instance resource. 1819 # 1820 # An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances. (== resource_for beta.instances ==) (== resource_for v1.instances ==) 1821 "status": "A String", # [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and TERMINATED. 1822 "guestAccelerators": [ # A list of the type and count of accelerator cards attached to the instance. 1823 { # A specification of the type and number of accelerator cards attached to the instance. 1824 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. 1825 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. 1826 }, 1827 ], 1828 "labels": { # Labels to apply to this instance. These can be later modified by the setLabels method. 1829 "a_key": "A String", 1830 }, 1831 "scheduling": { # Sets the scheduling options for an Instance. NextID: 9 # Sets the scheduling options for this instance. 1832 "preemptible": True or False, # Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. 1833 "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. 1834 # 1835 # By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. 1836 "nodeAffinities": [ # A set of node affinity and anti-affinity. 1837 { # Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. 1838 "operator": "A String", # Defines the operation of node selection. 1839 "values": [ # Corresponds to the label values of Node resource. 1840 "A String", 1841 ], 1842 "key": "A String", # Corresponds to the label key of Node resource. 1843 }, 1844 ], 1845 "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. 1846 }, 1847 "minCpuPlatform": "A String", # Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". 1848 "serviceAccounts": [ # A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. 1849 # 1850 # 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. 1851 { # A service account. 1852 "scopes": [ # The list of scopes to be made available for this service account. 1853 "A String", 1854 ], 1855 "email": "A String", # Email address of the service account. 1856 }, 1857 ], 1858 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 1859 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 1860 "networkInterfaces": [ # An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. 1861 { # A network interface resource attached to an instance. 1862 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. 1863 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. 1864 { # An alias IP range attached to an instance's network interface. 1865 "subnetworkRangeName": "A String", # The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. 1866 "ipCidrRange": "A String", # The IP alias ranges to allocate for this interface. 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 (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). 1867 }, 1868 ], 1869 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. 1870 # 1871 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 1872 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network 1873 # - projects/project/global/networks/network 1874 # - global/networks/default 1875 "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. 1876 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported. 1877 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs. 1878 "name": "A String", # The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. 1879 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. 1880 # 1881 # If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. 1882 # 1883 # If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. 1884 "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. 1885 "setPublicPtr": 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. 1886 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT. 1887 "publicPtrDomainName": "A String", # The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. 1888 }, 1889 ], 1890 "networkIP": "A String", # An IPv4 internal IP 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. 1891 "fingerprint": "A String", # Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface, otherwise the request will fail with error 412 conditionNotMet. 1892 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: 1893 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork 1894 # - regions/region/subnetworks/subnetwork 1895 "name": "A String", # [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. 1896 }, 1897 ], 1898 "startRestricted": True or False, # [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. 1899 "shieldedInstanceConfig": { # A set of Shielded Instance options. 1900 "enableVtpm": True or False, # Defines whether the instance has the vTPM enabled. 1901 "enableIntegrityMonitoring": True or False, # Defines whether the instance has integrity monitoring enabled. 1902 "enableSecureBoot": True or False, # Defines whether the instance has Secure Boot enabled. 1903 }, 1904 "zone": "A String", # [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. 1905 "hostname": "A String", 1906 "shieldedInstanceIntegrityPolicy": { # The policy describes the baseline against which Instance boot integrity is measured. 1907 "updateAutoLearnPolicy": True or False, # Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. 1908 }, 1909 "statusMessage": "A String", # [Output Only] An optional, human-readable explanation of the status. 1910 "metadata": { # A metadata key/value entry. # The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. 1911 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB. 1912 { 1913 "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 262144 bytes (256 KiB). 1914 "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. 1915 }, 1916 ], 1917 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata. 1918 "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, otherwise the request will fail with error 412 conditionNotMet. 1919 # 1920 # To see the latest fingerprint, make a get() request to retrieve the resource. 1921 }, 1922 "cpuPlatform": "A String", # [Output Only] The CPU platform used by this instance. 1923 "deletionProtection": True or False, # Whether the resource should be protected against deletion. 1924 "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. 1925 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 1926 "tags": { # A set of instance tags. # 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. Multiple tags can be specified via the 'tags.items' field. 1927 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. 1928 "A String", 1929 ], 1930 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. 1931 # 1932 # To see the latest fingerprint, make get() request to the instance. 1933 }, 1934 "labelFingerprint": "A String", # A fingerprint for this request, which is essentially a hash of the label's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. 1935 # 1936 # To see the latest fingerprint, make get() request to the instance. 1937 "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: 1938 # zones/us-central1-f/machineTypes/n1-standard-1 1939 # 1940 # 1941 # 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): 1942 # zones/zone/machineTypes/custom-CPUS-MEMORY 1943 # 1944 # 1945 # For example: zones/us-central1-f/machineTypes/custom-4-5120 1946 # 1947 # For a full list of restrictions, read the Specifications for custom machine types. 1948 "kind": "compute#instance", # [Output Only] Type of the resource. Always compute#instance for instances. 1949 "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. 1950 "disks": [ # Array of disks associated with this instance. Persistent disks must be created before you can assign them. 1951 { # An instance-attached disk resource. 1952 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts or decrypts a disk using a customer-supplied encryption key. 1953 # 1954 # 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. 1955 # 1956 # 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. 1957 # 1958 # 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. 1959 # 1960 # Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. 1961 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1962 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1963 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1964 }, 1965 "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. 1966 # 1967 # If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. 1968 "kind": "compute#attachedDisk", # [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. 1969 "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. 1970 # 1971 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 1972 # 1973 # This property is mutually exclusive with the source property; you can only define one or the other, but not both. 1974 "sourceSnapshot": "A String", # The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or disks.source is required except for local SSD. 1975 # 1976 # To create a disk with a snapshot that you created, specify the snapshot name in the following format: 1977 # global/snapshots/my-backup 1978 # 1979 # 1980 # If the source snapshot is deleted later, this field will not be set. 1981 "diskName": "A String", # Specifies the disk name. If not specified, the default is to use the name of the instance. If the disk with the instance name exists already in the given zone/region, a new name will be automatically generated. 1982 "description": "A String", # An optional description. Provide this property when creating the disk. 1983 "labels": { # Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. 1984 "a_key": "A String", 1985 }, 1986 "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. 1987 # 1988 # 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. 1989 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 1990 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 1991 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 1992 }, 1993 "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: 1994 # https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard 1995 # 1996 # 1997 # 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: 1998 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType 1999 # - projects/project/zones/zone/diskTypes/diskType 2000 # - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. 2001 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB. 2002 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. 2003 "A String", 2004 ], 2005 "sourceImage": "A String", # The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required except for local SSD. 2006 # 2007 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: 2008 # projects/debian-cloud/global/images/family/debian-9 2009 # 2010 # 2011 # Alternatively, use a specific version of a public operating system image: 2012 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD 2013 # 2014 # 2015 # To create a disk with a custom image that you created, specify the image name in the following format: 2016 # global/images/my-custom-image 2017 # 2018 # 2019 # You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: 2020 # global/images/family/my-image-family 2021 # 2022 # 2023 # If the source image is deleted later, this field will not be set. 2024 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. 2025 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 2026 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 2027 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 2028 }, 2029 }, 2030 "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). 2031 "index": 42, # [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. 2032 "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. 2033 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. 2034 { # Guest OS features. 2035 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. 2036 }, 2037 ], 2038 "licenses": [ # [Output Only] Any valid publicly visible licenses. 2039 "A String", 2040 ], 2041 "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. 2042 "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. TODO(b/131765817): Update documentation when NVME is supported. 2043 "type": "A String", # Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. 2044 "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 except for local SSD. 2045 # 2046 # If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. 2047 # 2048 # Note that for InstanceTemplate, specify the disk name, not the URL for the disk. 2049 }, 2050 ], 2051 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 2052 }, 2053 ], 2054 "warning": { # [Output Only] Informational warning message. 2055 "message": "A String", # [Output Only] A human-readable description of the warning code. 2056 "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. 2057 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2058 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2059 { 2060 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2061 "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). 2062 }, 2063 ], 2064 }, 2065 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. 2066 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 2067 }</pre> 2068</div> 2069 2070<div class="method"> 2071 <code class="details" id="listReferrers">listReferrers(project, zone, instance, orderBy=None, filter=None, maxResults=None, pageToken=None)</code> 2072 <pre>Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances. 2073 2074Args: 2075 project: string, Project ID for this request. (required) 2076 zone: string, The name of the zone for this request. (required) 2077 instance: string, Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. (required) 2078 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 2079 2080You 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. 2081 2082Currently, only sorting by name or creationTimestamp desc is supported. 2083 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. 2084 2085For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. 2086 2087You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. 2088 2089To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). 2090 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. Acceptable values are 0 to 500, inclusive. (Default: 500) 2091 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. 2092 2093Returns: 2094 An object of the form: 2095 2096 { # Contains a list of instance referrers. 2097 "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. 2098 "kind": "compute#instanceListReferrers", # [Output Only] Type of resource. Always compute#instanceListReferrers for lists of Instance referrers. 2099 "items": [ # A list of Reference resources. 2100 { # Represents a reference to a resource. 2101 "referrer": "A String", # URL of the resource which refers to the target. 2102 "kind": "compute#reference", # [Output Only] Type of the resource. Always compute#reference for references. 2103 "referenceType": "A String", # A description of the reference type with no implied semantics. Possible values include: 2104 # - MEMBER_OF 2105 "target": "A String", # URL of the resource to which this reference points. 2106 }, 2107 ], 2108 "warning": { # [Output Only] Informational warning message. 2109 "message": "A String", # [Output Only] A human-readable description of the warning code. 2110 "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. 2111 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2112 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2113 { 2114 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2115 "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). 2116 }, 2117 ], 2118 }, 2119 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. 2120 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 2121 }</pre> 2122</div> 2123 2124<div class="method"> 2125 <code class="details" id="listReferrers_next">listReferrers_next(previous_request, previous_response)</code> 2126 <pre>Retrieves the next page of results. 2127 2128Args: 2129 previous_request: The request for the previous page. (required) 2130 previous_response: The response from the request for the previous page. (required) 2131 2132Returns: 2133 A request object that you can call 'execute()' on to request the next 2134 page. Returns None if there are no more items in the collection. 2135 </pre> 2136</div> 2137 2138<div class="method"> 2139 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 2140 <pre>Retrieves the next page of results. 2141 2142Args: 2143 previous_request: The request for the previous page. (required) 2144 previous_response: The response from the request for the previous page. (required) 2145 2146Returns: 2147 A request object that you can call 'execute()' on to request the next 2148 page. Returns None if there are no more items in the collection. 2149 </pre> 2150</div> 2151 2152<div class="method"> 2153 <code class="details" id="reset">reset(project, zone, instance, requestId=None)</code> 2154 <pre>Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. 2155 2156Args: 2157 project: string, Project ID for this request. (required) 2158 zone: string, The name of the zone for this request. (required) 2159 instance: string, Name of the instance scoping this request. (required) 2160 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 2161 2162For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 2163 2164The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 2165 2166Returns: 2167 An object of the form: 2168 2169 { # Represents an Operation resource. 2170 # 2171 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 2172 # 2173 # Operations can be global, regional or zonal. 2174 # - For global operations, use the globalOperations resource. 2175 # - For regional operations, use the regionOperations resource. 2176 # - For zonal operations, use the zonalOperations resource. 2177 # 2178 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 2179 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 2180 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 2181 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 2182 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 2183 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 2184 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 2185 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 2186 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 2187 "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. 2188 "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. 2189 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 2190 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 2191 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 2192 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 2193 { 2194 "message": "A String", # [Output Only] A human-readable description of the warning code. 2195 "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. 2196 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2197 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2198 { 2199 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2200 "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). 2201 }, 2202 ], 2203 }, 2204 ], 2205 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 2206 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 2207 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 2208 "name": "A String", # [Output Only] Name of the resource. 2209 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 2210 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 2211 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 2212 { 2213 "message": "A String", # [Output Only] An optional, human-readable error message. 2214 "code": "A String", # [Output Only] The error type identifier for this error. 2215 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 2216 }, 2217 ], 2218 }, 2219 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 2220 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 2221 "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. 2222 }</pre> 2223</div> 2224 2225<div class="method"> 2226 <code class="details" id="setDeletionProtection">setDeletionProtection(project, zone, resource, deletionProtection=None, requestId=None)</code> 2227 <pre>Sets deletion protection on the instance. 2228 2229Args: 2230 project: string, Project ID for this request. (required) 2231 zone: string, The name of the zone for this request. (required) 2232 resource: string, Name or id of the resource for this request. (required) 2233 deletionProtection: boolean, Whether the resource should be protected against deletion. 2234 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 2235 2236For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 2237 2238The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 2239 2240Returns: 2241 An object of the form: 2242 2243 { # Represents an Operation resource. 2244 # 2245 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 2246 # 2247 # Operations can be global, regional or zonal. 2248 # - For global operations, use the globalOperations resource. 2249 # - For regional operations, use the regionOperations resource. 2250 # - For zonal operations, use the zonalOperations resource. 2251 # 2252 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 2253 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 2254 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 2255 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 2256 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 2257 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 2258 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 2259 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 2260 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 2261 "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. 2262 "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. 2263 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 2264 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 2265 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 2266 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 2267 { 2268 "message": "A String", # [Output Only] A human-readable description of the warning code. 2269 "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. 2270 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2271 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2272 { 2273 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2274 "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). 2275 }, 2276 ], 2277 }, 2278 ], 2279 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 2280 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 2281 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 2282 "name": "A String", # [Output Only] Name of the resource. 2283 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 2284 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 2285 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 2286 { 2287 "message": "A String", # [Output Only] An optional, human-readable error message. 2288 "code": "A String", # [Output Only] The error type identifier for this error. 2289 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 2290 }, 2291 ], 2292 }, 2293 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 2294 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 2295 "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. 2296 }</pre> 2297</div> 2298 2299<div class="method"> 2300 <code class="details" id="setDiskAutoDelete">setDiskAutoDelete(project, zone, instance, autoDelete, deviceName, requestId=None)</code> 2301 <pre>Sets the auto-delete flag for a disk attached to an instance. 2302 2303Args: 2304 project: string, Project ID for this request. (required) 2305 zone: string, The name of the zone for this request. (required) 2306 instance: string, The instance name for this request. (required) 2307 autoDelete: boolean, Whether to auto-delete the disk when the instance is deleted. (required) 2308 deviceName: string, The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. (required) 2309 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 2310 2311For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 2312 2313The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 2314 2315Returns: 2316 An object of the form: 2317 2318 { # Represents an Operation resource. 2319 # 2320 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 2321 # 2322 # Operations can be global, regional or zonal. 2323 # - For global operations, use the globalOperations resource. 2324 # - For regional operations, use the regionOperations resource. 2325 # - For zonal operations, use the zonalOperations resource. 2326 # 2327 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 2328 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 2329 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 2330 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 2331 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 2332 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 2333 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 2334 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 2335 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 2336 "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. 2337 "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. 2338 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 2339 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 2340 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 2341 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 2342 { 2343 "message": "A String", # [Output Only] A human-readable description of the warning code. 2344 "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. 2345 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2346 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2347 { 2348 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2349 "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). 2350 }, 2351 ], 2352 }, 2353 ], 2354 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 2355 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 2356 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 2357 "name": "A String", # [Output Only] Name of the resource. 2358 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 2359 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 2360 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 2361 { 2362 "message": "A String", # [Output Only] An optional, human-readable error message. 2363 "code": "A String", # [Output Only] The error type identifier for this error. 2364 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 2365 }, 2366 ], 2367 }, 2368 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 2369 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 2370 "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. 2371 }</pre> 2372</div> 2373 2374<div class="method"> 2375 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body)</code> 2376 <pre>Sets the access control policy on the specified resource. Replaces any existing policy. 2377 2378Args: 2379 project: string, Project ID for this request. (required) 2380 zone: string, The name of the zone for this request. (required) 2381 resource: string, Name or id of the resource for this request. (required) 2382 body: object, The request body. (required) 2383 The object takes the form of: 2384 2385{ 2386 "policy": { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. # REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. 2387 # 2388 # 2389 # 2390 # 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. 2391 # 2392 # **JSON Example** 2393 # 2394 # { "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"] } ] } 2395 # 2396 # **YAML Example** 2397 # 2398 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - members: - user:sean@example.com role: roles/viewer 2399 # 2400 # 2401 # 2402 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs). 2403 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. 2404 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. 2405 # 2406 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. 2407 # 2408 # Example Policy with multiple AuditConfigs: 2409 # 2410 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } 2411 # 2412 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging. 2413 "exemptedMembers": [ 2414 "A String", 2415 ], 2416 "auditLogConfigs": [ # The configuration for logging of each type of permission. 2417 { # Provides the configuration for logging a type of permissions. Example: 2418 # 2419 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } 2420 # 2421 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging. 2422 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. 2423 "A String", 2424 ], 2425 "logType": "A String", # The log type that this config enables. 2426 }, 2427 ], 2428 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. 2429 }, 2430 ], 2431 "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. 2432 { # A rule to be applied in a Policy. 2433 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. 2434 { # Specifies what kind of log the caller must write 2435 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options. 2436 # 2437 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended. 2438 # 2439 # Field names correspond to IAM request parameters and field values are their respective values. 2440 # 2441 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields. 2442 # 2443 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]} 2444 # 2445 # At this time we do not support multiple field names (though this may be supported in the future). 2446 "field": "A String", # The field value to attribute. 2447 "metric": "A String", # The metric to update. 2448 }, 2449 "dataAccess": { # Write a Data Access (Gin) log # Data access options. 2450 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now. 2451 }, 2452 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options. 2453 "logName": "A String", # The log_name to populate in the Cloud Audit Record. 2454 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline. 2455 "permissionType": "A String", # The type of the permission that was checked. 2456 }, 2457 }, 2458 }, 2459 ], 2460 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. 2461 "A String", 2462 ], 2463 "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. 2464 "A String", 2465 ], 2466 "action": "A String", # Required 2467 "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. 2468 "A String", 2469 ], 2470 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match. 2471 { # A condition to be met. 2472 "iam": "A String", # Trusted attributes supplied by the IAM system. 2473 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. 2474 "values": [ # The objects of the condition. 2475 "A String", 2476 ], 2477 "svc": "A String", # Trusted attributes discharged by the service. 2478 "op": "A String", # An operator to apply the subject with. 2479 }, 2480 ], 2481 "description": "A String", # Human-readable description of the rule. 2482 }, 2483 ], 2484 "version": 42, # Deprecated. 2485 "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. 2486 # 2487 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. 2488 "bindings": [ # Associates a list of `members` to a `role`. `bindings` with no members will result in an error. 2489 { # Associates `members` with a `role`. 2490 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 2491 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: 2492 # 2493 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. 2494 # 2495 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. 2496 # 2497 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` . 2498 # 2499 # 2500 # 2501 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. 2502 # 2503 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. 2504 # 2505 # 2506 # 2507 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. 2508 "A String", 2509 ], 2510 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. 2511 # 2512 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" 2513 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. 2514 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax. 2515 # 2516 # The application context of the containing message determines which well-known feature set of CEL is supported. 2517 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. 2518 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. 2519 }, 2520 }, 2521 ], 2522 "iamOwned": True or False, 2523 }, 2524 "bindings": [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. 2525 { # Associates `members` with a `role`. 2526 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 2527 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: 2528 # 2529 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. 2530 # 2531 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. 2532 # 2533 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` . 2534 # 2535 # 2536 # 2537 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. 2538 # 2539 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. 2540 # 2541 # 2542 # 2543 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. 2544 "A String", 2545 ], 2546 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. 2547 # 2548 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" 2549 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. 2550 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax. 2551 # 2552 # The application context of the containing message determines which well-known feature set of CEL is supported. 2553 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. 2554 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. 2555 }, 2556 }, 2557 ], 2558 "etag": "A String", # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. 2559 } 2560 2561 2562Returns: 2563 An object of the form: 2564 2565 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. 2566 # 2567 # 2568 # 2569 # 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. 2570 # 2571 # **JSON Example** 2572 # 2573 # { "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"] } ] } 2574 # 2575 # **YAML Example** 2576 # 2577 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - members: - user:sean@example.com role: roles/viewer 2578 # 2579 # 2580 # 2581 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs). 2582 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. 2583 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. 2584 # 2585 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. 2586 # 2587 # Example Policy with multiple AuditConfigs: 2588 # 2589 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } 2590 # 2591 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging. 2592 "exemptedMembers": [ 2593 "A String", 2594 ], 2595 "auditLogConfigs": [ # The configuration for logging of each type of permission. 2596 { # Provides the configuration for logging a type of permissions. Example: 2597 # 2598 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } 2599 # 2600 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging. 2601 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. 2602 "A String", 2603 ], 2604 "logType": "A String", # The log type that this config enables. 2605 }, 2606 ], 2607 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. 2608 }, 2609 ], 2610 "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. 2611 { # A rule to be applied in a Policy. 2612 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. 2613 { # Specifies what kind of log the caller must write 2614 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options. 2615 # 2616 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended. 2617 # 2618 # Field names correspond to IAM request parameters and field values are their respective values. 2619 # 2620 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields. 2621 # 2622 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]} 2623 # 2624 # At this time we do not support multiple field names (though this may be supported in the future). 2625 "field": "A String", # The field value to attribute. 2626 "metric": "A String", # The metric to update. 2627 }, 2628 "dataAccess": { # Write a Data Access (Gin) log # Data access options. 2629 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now. 2630 }, 2631 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options. 2632 "logName": "A String", # The log_name to populate in the Cloud Audit Record. 2633 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline. 2634 "permissionType": "A String", # The type of the permission that was checked. 2635 }, 2636 }, 2637 }, 2638 ], 2639 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. 2640 "A String", 2641 ], 2642 "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. 2643 "A String", 2644 ], 2645 "action": "A String", # Required 2646 "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. 2647 "A String", 2648 ], 2649 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match. 2650 { # A condition to be met. 2651 "iam": "A String", # Trusted attributes supplied by the IAM system. 2652 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. 2653 "values": [ # The objects of the condition. 2654 "A String", 2655 ], 2656 "svc": "A String", # Trusted attributes discharged by the service. 2657 "op": "A String", # An operator to apply the subject with. 2658 }, 2659 ], 2660 "description": "A String", # Human-readable description of the rule. 2661 }, 2662 ], 2663 "version": 42, # Deprecated. 2664 "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. 2665 # 2666 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. 2667 "bindings": [ # Associates a list of `members` to a `role`. `bindings` with no members will result in an error. 2668 { # Associates `members` with a `role`. 2669 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 2670 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: 2671 # 2672 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. 2673 # 2674 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. 2675 # 2676 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` . 2677 # 2678 # 2679 # 2680 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. 2681 # 2682 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. 2683 # 2684 # 2685 # 2686 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. 2687 "A String", 2688 ], 2689 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently. 2690 # 2691 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0" 2692 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. 2693 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax. 2694 # 2695 # The application context of the containing message determines which well-known feature set of CEL is supported. 2696 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. 2697 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. 2698 }, 2699 }, 2700 ], 2701 "iamOwned": True or False, 2702 }</pre> 2703</div> 2704 2705<div class="method"> 2706 <code class="details" id="setLabels">setLabels(project, zone, instance, body, requestId=None)</code> 2707 <pre>Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. 2708 2709Args: 2710 project: string, Project ID for this request. (required) 2711 zone: string, The name of the zone for this request. (required) 2712 instance: string, Name of the instance scoping this request. (required) 2713 body: object, The request body. (required) 2714 The object takes the form of: 2715 2716{ 2717 "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. 2718 "labels": { 2719 "a_key": "A String", 2720 }, 2721 } 2722 2723 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 2724 2725For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 2726 2727The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 2728 2729Returns: 2730 An object of the form: 2731 2732 { # Represents an Operation resource. 2733 # 2734 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 2735 # 2736 # Operations can be global, regional or zonal. 2737 # - For global operations, use the globalOperations resource. 2738 # - For regional operations, use the regionOperations resource. 2739 # - For zonal operations, use the zonalOperations resource. 2740 # 2741 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 2742 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 2743 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 2744 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 2745 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 2746 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 2747 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 2748 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 2749 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 2750 "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. 2751 "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. 2752 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 2753 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 2754 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 2755 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 2756 { 2757 "message": "A String", # [Output Only] A human-readable description of the warning code. 2758 "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. 2759 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2760 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2761 { 2762 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2763 "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). 2764 }, 2765 ], 2766 }, 2767 ], 2768 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 2769 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 2770 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 2771 "name": "A String", # [Output Only] Name of the resource. 2772 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 2773 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 2774 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 2775 { 2776 "message": "A String", # [Output Only] An optional, human-readable error message. 2777 "code": "A String", # [Output Only] The error type identifier for this error. 2778 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 2779 }, 2780 ], 2781 }, 2782 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 2783 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 2784 "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. 2785 }</pre> 2786</div> 2787 2788<div class="method"> 2789 <code class="details" id="setMachineResources">setMachineResources(project, zone, instance, body, requestId=None)</code> 2790 <pre>Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. 2791 2792Args: 2793 project: string, Project ID for this request. (required) 2794 zone: string, The name of the zone for this request. (required) 2795 instance: string, Name of the instance scoping this request. (required) 2796 body: object, The request body. (required) 2797 The object takes the form of: 2798 2799{ 2800 "guestAccelerators": [ # A list of the type and count of accelerator cards attached to the instance. 2801 { # A specification of the type and number of accelerator cards attached to the instance. 2802 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance. 2803 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. 2804 }, 2805 ], 2806 } 2807 2808 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 2809 2810For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 2811 2812The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 2813 2814Returns: 2815 An object of the form: 2816 2817 { # Represents an Operation resource. 2818 # 2819 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 2820 # 2821 # Operations can be global, regional or zonal. 2822 # - For global operations, use the globalOperations resource. 2823 # - For regional operations, use the regionOperations resource. 2824 # - For zonal operations, use the zonalOperations resource. 2825 # 2826 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 2827 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 2828 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 2829 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 2830 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 2831 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 2832 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 2833 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 2834 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 2835 "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. 2836 "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. 2837 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 2838 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 2839 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 2840 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 2841 { 2842 "message": "A String", # [Output Only] A human-readable description of the warning code. 2843 "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. 2844 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2845 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2846 { 2847 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2848 "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). 2849 }, 2850 ], 2851 }, 2852 ], 2853 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 2854 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 2855 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 2856 "name": "A String", # [Output Only] Name of the resource. 2857 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 2858 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 2859 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 2860 { 2861 "message": "A String", # [Output Only] An optional, human-readable error message. 2862 "code": "A String", # [Output Only] The error type identifier for this error. 2863 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 2864 }, 2865 ], 2866 }, 2867 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 2868 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 2869 "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. 2870 }</pre> 2871</div> 2872 2873<div class="method"> 2874 <code class="details" id="setMachineType">setMachineType(project, zone, instance, body, requestId=None)</code> 2875 <pre>Changes the machine type for a stopped instance to the machine type specified in the request. 2876 2877Args: 2878 project: string, Project ID for this request. (required) 2879 zone: string, The name of the zone for this request. (required) 2880 instance: string, Name of the instance scoping this request. (required) 2881 body: object, The request body. (required) 2882 The object takes the form of: 2883 2884{ 2885 "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 2886 } 2887 2888 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 2889 2890For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 2891 2892The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 2893 2894Returns: 2895 An object of the form: 2896 2897 { # Represents an Operation resource. 2898 # 2899 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 2900 # 2901 # Operations can be global, regional or zonal. 2902 # - For global operations, use the globalOperations resource. 2903 # - For regional operations, use the regionOperations resource. 2904 # - For zonal operations, use the zonalOperations resource. 2905 # 2906 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 2907 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 2908 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 2909 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 2910 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 2911 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 2912 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 2913 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 2914 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 2915 "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. 2916 "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. 2917 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 2918 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 2919 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 2920 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 2921 { 2922 "message": "A String", # [Output Only] A human-readable description of the warning code. 2923 "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. 2924 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 2925 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 2926 { 2927 "value": "A String", # [Output Only] A warning data value corresponding to the key. 2928 "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). 2929 }, 2930 ], 2931 }, 2932 ], 2933 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 2934 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 2935 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 2936 "name": "A String", # [Output Only] Name of the resource. 2937 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 2938 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 2939 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 2940 { 2941 "message": "A String", # [Output Only] An optional, human-readable error message. 2942 "code": "A String", # [Output Only] The error type identifier for this error. 2943 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 2944 }, 2945 ], 2946 }, 2947 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 2948 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 2949 "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. 2950 }</pre> 2951</div> 2952 2953<div class="method"> 2954 <code class="details" id="setMetadata">setMetadata(project, zone, instance, body, requestId=None)</code> 2955 <pre>Sets metadata for the specified instance to the data included in the request. 2956 2957Args: 2958 project: string, Project ID for this request. (required) 2959 zone: string, The name of the zone for this request. (required) 2960 instance: string, Name of the instance scoping this request. (required) 2961 body: object, The request body. (required) 2962 The object takes the form of: 2963 2964{ # A metadata key/value entry. 2965 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB. 2966 { 2967 "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 262144 bytes (256 KiB). 2968 "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. 2969 }, 2970 ], 2971 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata. 2972 "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, otherwise the request will fail with error 412 conditionNotMet. 2973 # 2974 # To see the latest fingerprint, make a get() request to retrieve the resource. 2975} 2976 2977 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 2978 2979For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 2980 2981The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 2982 2983Returns: 2984 An object of the form: 2985 2986 { # Represents an Operation resource. 2987 # 2988 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 2989 # 2990 # Operations can be global, regional or zonal. 2991 # - For global operations, use the globalOperations resource. 2992 # - For regional operations, use the regionOperations resource. 2993 # - For zonal operations, use the zonalOperations resource. 2994 # 2995 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 2996 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 2997 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 2998 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 2999 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3000 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3001 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3002 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3003 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3004 "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. 3005 "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. 3006 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3007 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3008 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3009 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3010 { 3011 "message": "A String", # [Output Only] A human-readable description of the warning code. 3012 "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. 3013 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3014 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3015 { 3016 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3017 "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). 3018 }, 3019 ], 3020 }, 3021 ], 3022 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3023 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3024 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3025 "name": "A String", # [Output Only] Name of the resource. 3026 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3027 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3028 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3029 { 3030 "message": "A String", # [Output Only] An optional, human-readable error message. 3031 "code": "A String", # [Output Only] The error type identifier for this error. 3032 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3033 }, 3034 ], 3035 }, 3036 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3037 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3038 "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. 3039 }</pre> 3040</div> 3041 3042<div class="method"> 3043 <code class="details" id="setMinCpuPlatform">setMinCpuPlatform(project, zone, instance, body, requestId=None)</code> 3044 <pre>Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. 3045 3046Args: 3047 project: string, Project ID for this request. (required) 3048 zone: string, The name of the zone for this request. (required) 3049 instance: string, Name of the instance scoping this request. (required) 3050 body: object, The request body. (required) 3051 The object takes the form of: 3052 3053{ 3054 "minCpuPlatform": "A String", # Minimum cpu/platform this instance should be started at. 3055 } 3056 3057 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3058 3059For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3060 3061The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3062 3063Returns: 3064 An object of the form: 3065 3066 { # Represents an Operation resource. 3067 # 3068 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3069 # 3070 # Operations can be global, regional or zonal. 3071 # - For global operations, use the globalOperations resource. 3072 # - For regional operations, use the regionOperations resource. 3073 # - For zonal operations, use the zonalOperations resource. 3074 # 3075 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3076 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3077 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3078 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3079 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3080 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3081 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3082 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3083 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3084 "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. 3085 "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. 3086 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3087 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3088 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3089 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3090 { 3091 "message": "A String", # [Output Only] A human-readable description of the warning code. 3092 "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. 3093 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3094 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3095 { 3096 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3097 "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). 3098 }, 3099 ], 3100 }, 3101 ], 3102 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3103 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3104 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3105 "name": "A String", # [Output Only] Name of the resource. 3106 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3107 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3108 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3109 { 3110 "message": "A String", # [Output Only] An optional, human-readable error message. 3111 "code": "A String", # [Output Only] The error type identifier for this error. 3112 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3113 }, 3114 ], 3115 }, 3116 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3117 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3118 "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. 3119 }</pre> 3120</div> 3121 3122<div class="method"> 3123 <code class="details" id="setScheduling">setScheduling(project, zone, instance, body, requestId=None)</code> 3124 <pre>Sets an instance's scheduling options. 3125 3126Args: 3127 project: string, Project ID for this request. (required) 3128 zone: string, The name of the zone for this request. (required) 3129 instance: string, Instance name for this request. (required) 3130 body: object, The request body. (required) 3131 The object takes the form of: 3132 3133{ # Sets the scheduling options for an Instance. NextID: 9 3134 "preemptible": True or False, # Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been created. 3135 "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. 3136 # 3137 # By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. 3138 "nodeAffinities": [ # A set of node affinity and anti-affinity. 3139 { # Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. 3140 "operator": "A String", # Defines the operation of node selection. 3141 "values": [ # Corresponds to the label values of Node resource. 3142 "A String", 3143 ], 3144 "key": "A String", # Corresponds to the label key of Node resource. 3145 }, 3146 ], 3147 "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. 3148} 3149 3150 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3151 3152For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3153 3154The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3155 3156Returns: 3157 An object of the form: 3158 3159 { # Represents an Operation resource. 3160 # 3161 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3162 # 3163 # Operations can be global, regional or zonal. 3164 # - For global operations, use the globalOperations resource. 3165 # - For regional operations, use the regionOperations resource. 3166 # - For zonal operations, use the zonalOperations resource. 3167 # 3168 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3169 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3170 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3171 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3172 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3173 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3174 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3175 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3176 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3177 "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. 3178 "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. 3179 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3180 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3181 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3182 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3183 { 3184 "message": "A String", # [Output Only] A human-readable description of the warning code. 3185 "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. 3186 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3187 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3188 { 3189 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3190 "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). 3191 }, 3192 ], 3193 }, 3194 ], 3195 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3196 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3197 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3198 "name": "A String", # [Output Only] Name of the resource. 3199 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3200 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3201 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3202 { 3203 "message": "A String", # [Output Only] An optional, human-readable error message. 3204 "code": "A String", # [Output Only] The error type identifier for this error. 3205 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3206 }, 3207 ], 3208 }, 3209 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3210 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3211 "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. 3212 }</pre> 3213</div> 3214 3215<div class="method"> 3216 <code class="details" id="setServiceAccount">setServiceAccount(project, zone, instance, body, requestId=None)</code> 3217 <pre>Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. 3218 3219Args: 3220 project: string, Project ID for this request. (required) 3221 zone: string, The name of the zone for this request. (required) 3222 instance: string, Name of the instance resource to start. (required) 3223 body: object, The request body. (required) 3224 The object takes the form of: 3225 3226{ 3227 "scopes": [ # The list of scopes to be made available for this service account. 3228 "A String", 3229 ], 3230 "email": "A String", # Email address of the service account. 3231 } 3232 3233 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3234 3235For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3236 3237The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3238 3239Returns: 3240 An object of the form: 3241 3242 { # Represents an Operation resource. 3243 # 3244 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3245 # 3246 # Operations can be global, regional or zonal. 3247 # - For global operations, use the globalOperations resource. 3248 # - For regional operations, use the regionOperations resource. 3249 # - For zonal operations, use the zonalOperations resource. 3250 # 3251 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3252 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3253 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3254 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3255 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3256 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3257 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3258 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3259 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3260 "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. 3261 "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. 3262 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3263 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3264 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3265 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3266 { 3267 "message": "A String", # [Output Only] A human-readable description of the warning code. 3268 "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. 3269 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3270 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3271 { 3272 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3273 "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). 3274 }, 3275 ], 3276 }, 3277 ], 3278 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3279 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3280 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3281 "name": "A String", # [Output Only] Name of the resource. 3282 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3283 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3284 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3285 { 3286 "message": "A String", # [Output Only] An optional, human-readable error message. 3287 "code": "A String", # [Output Only] The error type identifier for this error. 3288 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3289 }, 3290 ], 3291 }, 3292 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3293 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3294 "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. 3295 }</pre> 3296</div> 3297 3298<div class="method"> 3299 <code class="details" id="setShieldedInstanceIntegrityPolicy">setShieldedInstanceIntegrityPolicy(project, zone, instance, body, requestId=None)</code> 3300 <pre>Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. 3301 3302Args: 3303 project: string, Project ID for this request. (required) 3304 zone: string, The name of the zone for this request. (required) 3305 instance: string, Name or id of the instance scoping this request. (required) 3306 body: object, The request body. (required) 3307 The object takes the form of: 3308 3309{ # The policy describes the baseline against which Instance boot integrity is measured. 3310 "updateAutoLearnPolicy": True or False, # Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. 3311 } 3312 3313 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3314 3315For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3316 3317The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3318 3319Returns: 3320 An object of the form: 3321 3322 { # Represents an Operation resource. 3323 # 3324 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3325 # 3326 # Operations can be global, regional or zonal. 3327 # - For global operations, use the globalOperations resource. 3328 # - For regional operations, use the regionOperations resource. 3329 # - For zonal operations, use the zonalOperations resource. 3330 # 3331 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3332 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3333 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3334 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3335 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3336 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3337 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3338 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3339 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3340 "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. 3341 "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. 3342 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3343 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3344 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3345 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3346 { 3347 "message": "A String", # [Output Only] A human-readable description of the warning code. 3348 "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. 3349 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3350 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3351 { 3352 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3353 "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). 3354 }, 3355 ], 3356 }, 3357 ], 3358 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3359 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3360 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3361 "name": "A String", # [Output Only] Name of the resource. 3362 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3363 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3364 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3365 { 3366 "message": "A String", # [Output Only] An optional, human-readable error message. 3367 "code": "A String", # [Output Only] The error type identifier for this error. 3368 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3369 }, 3370 ], 3371 }, 3372 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3373 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3374 "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. 3375 }</pre> 3376</div> 3377 3378<div class="method"> 3379 <code class="details" id="setTags">setTags(project, zone, instance, body, requestId=None)</code> 3380 <pre>Sets network tags for the specified instance to the data included in the request. 3381 3382Args: 3383 project: string, Project ID for this request. (required) 3384 zone: string, The name of the zone for this request. (required) 3385 instance: string, Name of the instance scoping this request. (required) 3386 body: object, The request body. (required) 3387 The object takes the form of: 3388 3389{ # A set of instance tags. 3390 "items": [ # An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. 3391 "A String", 3392 ], 3393 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. 3394 # 3395 # To see the latest fingerprint, make get() request to the instance. 3396} 3397 3398 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3399 3400For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3401 3402The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3403 3404Returns: 3405 An object of the form: 3406 3407 { # Represents an Operation resource. 3408 # 3409 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3410 # 3411 # Operations can be global, regional or zonal. 3412 # - For global operations, use the globalOperations resource. 3413 # - For regional operations, use the regionOperations resource. 3414 # - For zonal operations, use the zonalOperations resource. 3415 # 3416 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3417 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3418 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3419 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3420 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3421 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3422 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3423 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3424 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3425 "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. 3426 "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. 3427 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3428 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3429 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3430 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3431 { 3432 "message": "A String", # [Output Only] A human-readable description of the warning code. 3433 "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. 3434 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3435 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3436 { 3437 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3438 "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). 3439 }, 3440 ], 3441 }, 3442 ], 3443 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3444 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3445 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3446 "name": "A String", # [Output Only] Name of the resource. 3447 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3448 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3449 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3450 { 3451 "message": "A String", # [Output Only] An optional, human-readable error message. 3452 "code": "A String", # [Output Only] The error type identifier for this error. 3453 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3454 }, 3455 ], 3456 }, 3457 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3458 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3459 "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. 3460 }</pre> 3461</div> 3462 3463<div class="method"> 3464 <code class="details" id="simulateMaintenanceEvent">simulateMaintenanceEvent(project, zone, instance)</code> 3465 <pre>Simulates a maintenance event on the instance. 3466 3467Args: 3468 project: string, Project ID for this request. (required) 3469 zone: string, The name of the zone for this request. (required) 3470 instance: string, Name of the instance scoping this request. (required) 3471 3472Returns: 3473 An object of the form: 3474 3475 { # Represents an Operation resource. 3476 # 3477 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3478 # 3479 # Operations can be global, regional or zonal. 3480 # - For global operations, use the globalOperations resource. 3481 # - For regional operations, use the regionOperations resource. 3482 # - For zonal operations, use the zonalOperations resource. 3483 # 3484 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3485 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3486 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3487 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3488 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3489 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3490 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3491 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3492 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3493 "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. 3494 "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. 3495 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3496 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3497 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3498 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3499 { 3500 "message": "A String", # [Output Only] A human-readable description of the warning code. 3501 "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. 3502 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3503 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3504 { 3505 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3506 "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). 3507 }, 3508 ], 3509 }, 3510 ], 3511 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3512 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3513 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3514 "name": "A String", # [Output Only] Name of the resource. 3515 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3516 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3517 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3518 { 3519 "message": "A String", # [Output Only] An optional, human-readable error message. 3520 "code": "A String", # [Output Only] The error type identifier for this error. 3521 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3522 }, 3523 ], 3524 }, 3525 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3526 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3527 "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. 3528 }</pre> 3529</div> 3530 3531<div class="method"> 3532 <code class="details" id="start">start(project, zone, instance, requestId=None)</code> 3533 <pre>Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. 3534 3535Args: 3536 project: string, Project ID for this request. (required) 3537 zone: string, The name of the zone for this request. (required) 3538 instance: string, Name of the instance resource to start. (required) 3539 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3540 3541For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3542 3543The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3544 3545Returns: 3546 An object of the form: 3547 3548 { # Represents an Operation resource. 3549 # 3550 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3551 # 3552 # Operations can be global, regional or zonal. 3553 # - For global operations, use the globalOperations resource. 3554 # - For regional operations, use the regionOperations resource. 3555 # - For zonal operations, use the zonalOperations resource. 3556 # 3557 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3558 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3559 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3560 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3561 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3562 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3563 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3564 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3565 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3566 "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. 3567 "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. 3568 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3569 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3570 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3571 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3572 { 3573 "message": "A String", # [Output Only] A human-readable description of the warning code. 3574 "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. 3575 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3576 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3577 { 3578 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3579 "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). 3580 }, 3581 ], 3582 }, 3583 ], 3584 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3585 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3586 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3587 "name": "A String", # [Output Only] Name of the resource. 3588 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3589 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3590 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3591 { 3592 "message": "A String", # [Output Only] An optional, human-readable error message. 3593 "code": "A String", # [Output Only] The error type identifier for this error. 3594 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3595 }, 3596 ], 3597 }, 3598 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3599 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3600 "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. 3601 }</pre> 3602</div> 3603 3604<div class="method"> 3605 <code class="details" id="startWithEncryptionKey">startWithEncryptionKey(project, zone, instance, body, requestId=None)</code> 3606 <pre>Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. 3607 3608Args: 3609 project: string, Project ID for this request. (required) 3610 zone: string, The name of the zone for this request. (required) 3611 instance: string, Name of the instance resource to start. (required) 3612 body: object, The request body. (required) 3613 The object takes the form of: 3614 3615{ 3616 "disks": [ # Array of disks associated with this instance that are protected with a customer-supplied encryption key. 3617 # 3618 # In order to start the instance, the disk url and its corresponding key must be provided. 3619 # 3620 # If the disk is not protected with a customer-supplied encryption key it should not be specified. 3621 { 3622 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Decrypts data associated with the disk with a customer-supplied encryption key. 3623 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. 3624 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. 3625 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS. 3626 }, 3627 "source": "A String", # Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. 3628 }, 3629 ], 3630 } 3631 3632 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3633 3634For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3635 3636The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3637 3638Returns: 3639 An object of the form: 3640 3641 { # Represents an Operation resource. 3642 # 3643 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3644 # 3645 # Operations can be global, regional or zonal. 3646 # - For global operations, use the globalOperations resource. 3647 # - For regional operations, use the regionOperations resource. 3648 # - For zonal operations, use the zonalOperations resource. 3649 # 3650 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3651 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3652 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3653 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3654 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3655 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3656 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3657 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3658 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3659 "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. 3660 "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. 3661 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3662 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3663 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3664 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3665 { 3666 "message": "A String", # [Output Only] A human-readable description of the warning code. 3667 "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. 3668 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3669 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3670 { 3671 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3672 "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). 3673 }, 3674 ], 3675 }, 3676 ], 3677 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3678 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3679 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3680 "name": "A String", # [Output Only] Name of the resource. 3681 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3682 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3683 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3684 { 3685 "message": "A String", # [Output Only] An optional, human-readable error message. 3686 "code": "A String", # [Output Only] The error type identifier for this error. 3687 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3688 }, 3689 ], 3690 }, 3691 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3692 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3693 "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. 3694 }</pre> 3695</div> 3696 3697<div class="method"> 3698 <code class="details" id="stop">stop(project, zone, instance, requestId=None)</code> 3699 <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 VM usage charges while they are stopped. However, resources that the VM 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. 3700 3701Args: 3702 project: string, Project ID for this request. (required) 3703 zone: string, The name of the zone for this request. (required) 3704 instance: string, Name of the instance resource to stop. (required) 3705 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3706 3707For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3708 3709The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3710 3711Returns: 3712 An object of the form: 3713 3714 { # Represents an Operation resource. 3715 # 3716 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3717 # 3718 # Operations can be global, regional or zonal. 3719 # - For global operations, use the globalOperations resource. 3720 # - For regional operations, use the regionOperations resource. 3721 # - For zonal operations, use the zonalOperations resource. 3722 # 3723 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3724 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3725 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3726 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3727 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3728 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3729 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3730 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3731 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3732 "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. 3733 "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. 3734 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3735 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3736 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3737 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3738 { 3739 "message": "A String", # [Output Only] A human-readable description of the warning code. 3740 "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. 3741 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3742 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3743 { 3744 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3745 "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). 3746 }, 3747 ], 3748 }, 3749 ], 3750 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3751 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3752 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3753 "name": "A String", # [Output Only] Name of the resource. 3754 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3755 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3756 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3757 { 3758 "message": "A String", # [Output Only] An optional, human-readable error message. 3759 "code": "A String", # [Output Only] The error type identifier for this error. 3760 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3761 }, 3762 ], 3763 }, 3764 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3765 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3766 "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. 3767 }</pre> 3768</div> 3769 3770<div class="method"> 3771 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code> 3772 <pre>Returns permissions that a caller has on the specified resource. 3773 3774Args: 3775 project: string, Project ID for this request. (required) 3776 zone: string, The name of the zone for this request. (required) 3777 resource: string, Name or id of the resource for this request. (required) 3778 body: object, The request body. (required) 3779 The object takes the form of: 3780 3781{ 3782 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. 3783 "A String", 3784 ], 3785 } 3786 3787 3788Returns: 3789 An object of the form: 3790 3791 { 3792 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. 3793 "A String", 3794 ], 3795 }</pre> 3796</div> 3797 3798<div class="method"> 3799 <code class="details" id="updateAccessConfig">updateAccessConfig(project, zone, instance, networkInterface, body, requestId=None)</code> 3800 <pre>Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. 3801 3802Args: 3803 project: string, Project ID for this request. (required) 3804 zone: string, The name of the zone for this request. (required) 3805 instance: string, The instance name for this request. (required) 3806 networkInterface: string, The name of the network interface where the access config is attached. (required) 3807 body: object, The request body. (required) 3808 The object takes the form of: 3809 3810{ # An access configuration attached to an instance's network interface. Only one access config per instance is supported. 3811 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs. 3812 "name": "A String", # The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. 3813 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. 3814 # 3815 # If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. 3816 # 3817 # If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. 3818 "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. 3819 "setPublicPtr": 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. 3820 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT. 3821 "publicPtrDomainName": "A String", # The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. 3822} 3823 3824 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3825 3826For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3827 3828The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3829 3830Returns: 3831 An object of the form: 3832 3833 { # Represents an Operation resource. 3834 # 3835 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3836 # 3837 # Operations can be global, regional or zonal. 3838 # - For global operations, use the globalOperations resource. 3839 # - For regional operations, use the regionOperations resource. 3840 # - For zonal operations, use the zonalOperations resource. 3841 # 3842 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3843 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3844 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3845 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3846 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3847 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3848 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3849 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3850 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3851 "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. 3852 "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. 3853 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3854 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3855 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3856 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3857 { 3858 "message": "A String", # [Output Only] A human-readable description of the warning code. 3859 "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. 3860 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3861 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3862 { 3863 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3864 "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). 3865 }, 3866 ], 3867 }, 3868 ], 3869 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3870 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3871 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3872 "name": "A String", # [Output Only] Name of the resource. 3873 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3874 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3875 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3876 { 3877 "message": "A String", # [Output Only] An optional, human-readable error message. 3878 "code": "A String", # [Output Only] The error type identifier for this error. 3879 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3880 }, 3881 ], 3882 }, 3883 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3884 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3885 "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. 3886 }</pre> 3887</div> 3888 3889<div class="method"> 3890 <code class="details" id="updateNetworkInterface">updateNetworkInterface(project, zone, instance, networkInterface, body, requestId=None)</code> 3891 <pre>Updates an instance's network interface. This method follows PATCH semantics. 3892 3893Args: 3894 project: string, Project ID for this request. (required) 3895 zone: string, The name of the zone for this request. (required) 3896 instance: string, The instance name for this request. (required) 3897 networkInterface: string, The name of the network interface to update. (required) 3898 body: object, The request body. (required) 3899 The object takes the form of: 3900 3901{ # A network interface resource attached to an instance. 3902 "kind": "compute#networkInterface", # [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. 3903 "aliasIpRanges": [ # An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. 3904 { # An alias IP range attached to an instance's network interface. 3905 "subnetworkRangeName": "A String", # The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. 3906 "ipCidrRange": "A String", # The IP alias ranges to allocate for this interface. 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 (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). 3907 }, 3908 ], 3909 "network": "A String", # URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. 3910 # 3911 # If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 3912 # - https://www.googleapis.com/compute/v1/projects/project/global/networks/network 3913 # - projects/project/global/networks/network 3914 # - global/networks/default 3915 "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. 3916 { # An access configuration attached to an instance's network interface. Only one access config per instance is supported. 3917 "kind": "compute#accessConfig", # [Output Only] Type of the resource. Always compute#accessConfig for access configs. 3918 "name": "A String", # The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. 3919 "networkTier": "A String", # This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. 3920 # 3921 # If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. 3922 # 3923 # If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. 3924 "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. 3925 "setPublicPtr": 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. 3926 "type": "ONE_TO_ONE_NAT", # The type of configuration. The default and only option is ONE_TO_ONE_NAT. 3927 "publicPtrDomainName": "A String", # The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. 3928 }, 3929 ], 3930 "networkIP": "A String", # An IPv4 internal IP 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. 3931 "fingerprint": "A String", # Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface, otherwise the request will fail with error 412 conditionNotMet. 3932 "subnetwork": "A String", # The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: 3933 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork 3934 # - regions/region/subnetworks/subnetwork 3935 "name": "A String", # [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. 3936} 3937 3938 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 3939 3940For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 3941 3942The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 3943 3944Returns: 3945 An object of the form: 3946 3947 { # Represents an Operation resource. 3948 # 3949 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 3950 # 3951 # Operations can be global, regional or zonal. 3952 # - For global operations, use the globalOperations resource. 3953 # - For regional operations, use the regionOperations resource. 3954 # - For zonal operations, use the zonalOperations resource. 3955 # 3956 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 3957 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 3958 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 3959 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 3960 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 3961 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 3962 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 3963 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 3964 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 3965 "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. 3966 "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. 3967 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 3968 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 3969 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 3970 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 3971 { 3972 "message": "A String", # [Output Only] A human-readable description of the warning code. 3973 "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. 3974 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 3975 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 3976 { 3977 "value": "A String", # [Output Only] A warning data value corresponding to the key. 3978 "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). 3979 }, 3980 ], 3981 }, 3982 ], 3983 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 3984 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 3985 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 3986 "name": "A String", # [Output Only] Name of the resource. 3987 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 3988 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 3989 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 3990 { 3991 "message": "A String", # [Output Only] An optional, human-readable error message. 3992 "code": "A String", # [Output Only] The error type identifier for this error. 3993 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 3994 }, 3995 ], 3996 }, 3997 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 3998 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 3999 "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. 4000 }</pre> 4001</div> 4002 4003<div class="method"> 4004 <code class="details" id="updateShieldedInstanceConfig">updateShieldedInstanceConfig(project, zone, instance, body, requestId=None)</code> 4005 <pre>Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. 4006 4007Args: 4008 project: string, Project ID for this request. (required) 4009 zone: string, The name of the zone for this request. (required) 4010 instance: string, Name or id of the instance scoping this request. (required) 4011 body: object, The request body. (required) 4012 The object takes the form of: 4013 4014{ # A set of Shielded Instance options. 4015 "enableVtpm": True or False, # Defines whether the instance has the vTPM enabled. 4016 "enableIntegrityMonitoring": True or False, # Defines whether the instance has integrity monitoring enabled. 4017 "enableSecureBoot": True or False, # Defines whether the instance has Secure Boot enabled. 4018} 4019 4020 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. 4021 4022For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. 4023 4024The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 4025 4026Returns: 4027 An object of the form: 4028 4029 { # Represents an Operation resource. 4030 # 4031 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 4032 # 4033 # Operations can be global, regional or zonal. 4034 # - For global operations, use the globalOperations resource. 4035 # - For regional operations, use the regionOperations resource. 4036 # - For zonal operations, use the zonalOperations resource. 4037 # 4038 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 4039 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 4040 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 4041 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 4042 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 4043 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 4044 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 4045 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 4046 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 4047 "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. 4048 "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. 4049 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 4050 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 4051 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 4052 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 4053 { 4054 "message": "A String", # [Output Only] A human-readable description of the warning code. 4055 "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. 4056 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 4057 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 4058 { 4059 "value": "A String", # [Output Only] A warning data value corresponding to the key. 4060 "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). 4061 }, 4062 ], 4063 }, 4064 ], 4065 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 4066 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 4067 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 4068 "name": "A String", # [Output Only] Name of the resource. 4069 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 4070 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 4071 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 4072 { 4073 "message": "A String", # [Output Only] An optional, human-readable error message. 4074 "code": "A String", # [Output Only] The error type identifier for this error. 4075 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 4076 }, 4077 ], 4078 }, 4079 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 4080 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 4081 "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. 4082 }</pre> 4083</div> 4084 4085</body></html>