blob: 65655d3905c82119b01ca6b113822a3c06393e2a [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.disks.html">disks</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#addResourcePolicies">addResourcePolicies(project, zone, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, returnPartialSuccess=None, filter=None, includeAllScopes=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070082<p class="firstline">Retrieves an aggregated list of persistent disks.</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">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#createSnapshot">createSnapshot(project, zone, disk, body=None, guestFlush=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070088<p class="firstline">Creates a snapshot of a specified persistent disk.</p>
89<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040090 <code><a href="#delete">delete(project, zone, disk, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070091<p class="firstline">Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.</p>
92<p class="toc_element">
93 <code><a href="#get">get(project, zone, disk)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070095<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#getIamPolicy">getIamPolicy(project, zone, resource, optionsRequestedPolicyVersion=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040097<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
98<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070099 <code><a href="#insert">insert(project, zone, body=None, requestId=None, sourceImage=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700100<p class="firstline">Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.</p>
101<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 <code><a href="#list">list(project, zone, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700103<p class="firstline">Retrieves a list of persistent disks contained within the specified zone.</p>
104<p class="toc_element">
105 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
106<p class="firstline">Retrieves the next page of results.</p>
107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#removeResourcePolicies">removeResourcePolicies(project, zone, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109<p class="firstline">Removes resource policies from a disk.</p>
110<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700111 <code><a href="#resize">resize(project, zone, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112<p class="firstline">Resizes the specified persistent disk. You can only increase the size of the disk.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700113<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 <code><a href="#setIamPolicy">setIamPolicy(project, zone, resource, body=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400115<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
116<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 <code><a href="#setLabels">setLabels(project, zone, resource, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118<p class="firstline">Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700119<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700121<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
122<h3>Method Details</h3>
123<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 <code class="details" id="addResourcePolicies">addResourcePolicies(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700125 <pre>Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
126
127Args:
128 project: string, Project ID for this request. (required)
129 zone: string, The name of the zone for this request. (required)
130 disk: string, The disk name for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700131 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700132 The object takes the form of:
133
134{
Dan O'Mearadd494642020-05-01 07:42:23 -0700135 "resourcePolicies": [ # Resource policies to be added to this disk. Currently you can only specify one policy here.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 "A String",
137 ],
138 }
139
140 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.
141
142For 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.
143
144The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
145
146Returns:
147 An object of the form:
148
149 { # Represents an Operation resource.
150 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700151 # Google Compute Engine has three Operation resources:
152 #
153 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
154 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700155 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
156 #
157 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700158 # - For global operations, use the `globalOperations` resource.
159 # - For regional operations, use the `regionOperations` resource.
160 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700162 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700163 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
164 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
165 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700166 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700167 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
168 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700169 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
170 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700171 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700172 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700173 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700174 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
176 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
177 {
178 "message": "A String", # [Output Only] A human-readable description of the warning code.
179 "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.
180 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
181 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
182 {
183 "value": "A String", # [Output Only] A warning data value corresponding to the key.
184 "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).
185 },
186 ],
187 },
188 ],
189 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700190 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700192 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
193 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700194 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
195 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
196 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
197 {
198 "message": "A String", # [Output Only] An optional, human-readable error message.
199 "code": "A String", # [Output Only] The error type identifier for this error.
200 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
201 },
202 ],
203 },
204 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
205 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
206 "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.
207 }</pre>
208</div>
209
210<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700211 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, returnPartialSuccess=None, filter=None, includeAllScopes=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700212 <pre>Retrieves an aggregated list of persistent disks.
213
214Args:
215 project: string, Project ID for this request. (required)
216 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
217
Dan O'Mearadd494642020-05-01 07:42:23 -0700218You 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700219
Dan O'Mearadd494642020-05-01 07:42:23 -0700220Currently, only sorting by `name` or `creationTimestamp desc` is supported.
221 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`)
222 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.
223 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
224 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 `=`, `!=`, `&gt;`, or `&lt;`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700225
Dan O'Mearadd494642020-05-01 07:42:23 -0700226For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700227
Dan O'Mearadd494642020-05-01 07:42:23 -0700228You 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700229
Dan O'Mearadd494642020-05-01 07:42:23 -0700230To 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) ```
231 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700232
233Returns:
234 An object of the form:
235
236 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700237 "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.
238 "kind": "compute#diskAggregatedList", # [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.
239 "items": { # A list of DisksScopedList resources.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700240 "a_key": { # [Output Only] Name of the scope containing this set of disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700241 "disks": [ # [Output Only] A list of disks contained in this scope.
242 { # Represents a Persistent Disk resource.
243 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700244 # Google Compute Engine has two Disk resources:
245 #
246 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
247 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700248 # Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks. For more information, read Persistent Disks. For more storage options, read Storage options.
249 #
250 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
251 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700252 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700253 "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.
254 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700255 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700256 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
257 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
258 #
259 # The key must meet the following requirements before you can provide it to Compute Engine:
260 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700261 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700262 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400263 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700264 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400265 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700266 "a_key": "A String",
267 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 "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.
269 { # Guest OS features.
270 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
271 },
272 ],
273 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700274 "A String",
275 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700276 "sourceStorageObject": "A String", # The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700277 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
278 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700279 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700280 "A String",
281 ],
282 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
283 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700284 # After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700285 #
286 # Customer-supplied encryption keys do not protect access to metadata of the disk.
287 #
288 # If you do not provide an encryption key when creating the disk, 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.
289 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700290 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700291 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
292 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
293 #
294 # The key must meet the following requirements before you can provide it to Compute Engine:
295 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700296 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700297 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400298 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700299 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 "sourceDisk": "A String", # The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
301 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
302 # - projects/project/zones/zone/disks/disk
303 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -0700304 "sourceInPlaceSnapshotId": "A String", # [Output Only] The unique ID of the in-place snapshot used to create this disk. This value identifies the exact in-place snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an in-place snapshot that was later deleted and recreated under the same name, the source in-place snapshot ID would identify the exact version of the in-place snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700305 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700306 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700307 "multiWriter": True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
308 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
309 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Dan O'Mearadd494642020-05-01 07:42:23 -0700310 "status": "A String", # [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700311 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
312 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
313 # - projects/project/global/snapshots/snapshot
314 # - global/snapshots/snapshot
315 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
316 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
317 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700318 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set 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, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700319 #
320 # To see the latest fingerprint, make a get() request to retrieve a disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700321 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource's resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700322 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700323 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
324 "A String",
325 ],
326 "eraseWindowsVssSignature": True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700327 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
328 "A String",
329 ],
330 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
332 "A String",
333 ],
334 "sourceDiskId": "A String", # [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700335 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700336 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700337 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
338 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700339 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
340 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Dan O'Mearadd494642020-05-01 07:42:23 -0700341 "sourceInPlaceSnapshot": "A String", # The source in-place snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
342 # - https://www.googleapis.com/compute/v1/projects/project/global/inPlaceSnapshots/inPlaceSnapshots
343 # - projects/project/global/inPlaceSnapshots/inPlaceSnapshots
344 # - global/inPlaceSnapshots/inPlaceSnapshots
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700345 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
346 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700347 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700348 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
349 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
350 #
351 # The key must meet the following requirements before you can provide it to Compute Engine:
352 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700353 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700354 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400355 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700356 },
357 "options": "A String", # Internal use only.
358 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
359 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
360 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700361 # 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:
362 # projects/debian-cloud/global/images/family/debian-9
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700363 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700364 #
365 # Alternatively, use a specific version of a public operating system image:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700366 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700367 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700368 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700369 # To create a disk with a custom image that you created, specify the image name in the following format:
370 # global/images/my-custom-image
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700371 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700372 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700373 # 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:
374 # global/images/family/my-image-family
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700375 },
376 ],
377 "warning": { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
378 "message": "A String", # [Output Only] A human-readable description of the warning code.
379 "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.
380 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
381 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
382 {
383 "value": "A String", # [Output Only] A warning data value corresponding to the key.
384 "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).
385 },
386 ],
387 },
388 },
389 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700390 "warning": { # [Output Only] Informational warning message.
391 "message": "A String", # [Output Only] A human-readable description of the warning code.
392 "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.
393 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
394 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
395 {
396 "value": "A String", # [Output Only] A warning data value corresponding to the key.
397 "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).
398 },
399 ],
400 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700401 "unreachables": [ # [Output Only] Unreachable resources.
402 "A String",
403 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700404 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700405 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
406 }</pre>
407</div>
408
409<div class="method">
410 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
411 <pre>Retrieves the next page of results.
412
413Args:
414 previous_request: The request for the previous page. (required)
415 previous_response: The response from the request for the previous page. (required)
416
417Returns:
418 A request object that you can call 'execute()' on to request the next
419 page. Returns None if there are no more items in the collection.
420 </pre>
421</div>
422
423<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700424 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body=None, guestFlush=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700425 <pre>Creates a snapshot of a specified persistent disk.
426
427Args:
428 project: string, Project ID for this request. (required)
429 zone: string, The name of the zone for this request. (required)
430 disk: string, Name of the persistent disk to snapshot. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700431 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700432 The object takes the form of:
433
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700434{ # Represents a Persistent Disk Snapshot resource.
435 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700436 # You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. (== resource_for {$api_version}.snapshots ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700437 "sourceDiskEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
438 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700439 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700440 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
441 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
442 #
443 # The key must meet the following requirements before you can provide it to Compute Engine:
444 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700445 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700446 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400447 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700448 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400449 "labels": { # Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700450 "a_key": "A String",
451 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700452 "guestOsFeatures": [ # [Output Only] 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.
453 { # Guest OS features.
454 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
455 },
456 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700457 "licenses": [ # [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image).
458 "A String",
459 ],
460 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
461 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700462 "licenseCodes": [ # [Output Only] Integer license codes indicating which licenses are attached to this snapshot.
463 "A String",
464 ],
465 "sourceDisk": "A String", # [Output Only] The source disk used to create this snapshot.
Dan O'Mearadd494642020-05-01 07:42:23 -0700466 "diskSizeGb": "A String", # [Output Only] Size of the source disk, specified in GB.
467 "storageLocations": [ # Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700468 "A String",
469 ],
470 "storageBytesStatus": "A String", # [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.
471 "status": "A String", # [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.
472 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
473 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set 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, otherwise the request will fail with error 412 conditionNotMet.
474 #
475 # To see the latest fingerprint, make a get() request to retrieve a snapshot.
476 "sourceDiskId": "A String", # [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name.
Dan O'Mearadd494642020-05-01 07:42:23 -0700477 "downloadBytes": "A String", # [Output Only] Number of bytes downloaded to restore a snapshot to a disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700478 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource's resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700479 "autoCreated": True or False, # [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700480 "kind": "compute#snapshot", # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
481 "storageBytes": "A String", # [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
482 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. 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.
483 "snapshotEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the snapshot using a customer-supplied encryption key.
484 #
485 # After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request.
486 #
487 # Customer-supplied encryption keys do not protect access to metadata of the snapshot.
488 #
489 # If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later.
490 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700491 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700492 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
493 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
494 #
495 # The key must meet the following requirements before you can provide it to Compute Engine:
496 # - The key is wrapped using a RSA public key certificate provided by Google.
497 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
498 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
499 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
500 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700501 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700502 }
503
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700504 guestFlush: boolean, [Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).
505 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.
506
507For 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.
508
509The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700510
511Returns:
512 An object of the form:
513
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700514 { # Represents an Operation resource.
515 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700516 # Google Compute Engine has three Operation resources:
517 #
518 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
519 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700520 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
521 #
522 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700523 # - For global operations, use the `globalOperations` resource.
524 # - For regional operations, use the `regionOperations` resource.
525 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700526 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700527 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700528 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700529 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400530 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700531 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700532 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700533 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700534 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
535 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700536 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700537 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700538 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700539 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700540 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
541 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
542 {
543 "message": "A String", # [Output Only] A human-readable description of the warning code.
544 "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.
545 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
546 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
547 {
548 "value": "A String", # [Output Only] A warning data value corresponding to the key.
549 "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).
550 },
551 ],
552 },
553 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700554 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700555 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700556 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700557 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
558 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700559 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700560 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
561 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
562 {
563 "message": "A String", # [Output Only] An optional, human-readable error message.
564 "code": "A String", # [Output Only] The error type identifier for this error.
565 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
566 },
567 ],
568 },
569 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
570 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800571 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700572 }</pre>
573</div>
574
575<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400576 <code class="details" id="delete">delete(project, zone, disk, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700577 <pre>Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.
578
579Args:
580 project: string, Project ID for this request. (required)
581 zone: string, The name of the zone for this request. (required)
582 disk: string, Name of the persistent disk to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700583 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.
584
585For 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.
586
587The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700588
589Returns:
590 An object of the form:
591
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700592 { # Represents an Operation resource.
593 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700594 # Google Compute Engine has three Operation resources:
595 #
596 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
597 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700598 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
599 #
600 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700601 # - For global operations, use the `globalOperations` resource.
602 # - For regional operations, use the `regionOperations` resource.
603 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700604 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700605 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700606 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700607 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400608 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700609 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700610 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700611 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700612 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
613 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700614 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700615 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700616 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700617 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700618 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
619 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
620 {
621 "message": "A String", # [Output Only] A human-readable description of the warning code.
622 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
623 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
624 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
625 {
626 "value": "A String", # [Output Only] A warning data value corresponding to the key.
627 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
628 },
629 ],
630 },
631 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700632 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700633 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700634 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700635 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
636 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700637 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700638 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
639 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
640 {
641 "message": "A String", # [Output Only] An optional, human-readable error message.
642 "code": "A String", # [Output Only] The error type identifier for this error.
643 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
644 },
645 ],
646 },
647 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
648 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800649 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700650 }</pre>
651</div>
652
653<div class="method">
654 <code class="details" id="get">get(project, zone, disk)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700655 <pre>Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700656
657Args:
658 project: string, Project ID for this request. (required)
659 zone: string, The name of the zone for this request. (required)
660 disk: string, Name of the persistent disk to return. (required)
661
662Returns:
663 An object of the form:
664
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700665 { # Represents a Persistent Disk resource.
666 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700667 # Google Compute Engine has two Disk resources:
668 #
669 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
670 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700671 # Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks. For more information, read Persistent Disks. For more storage options, read Storage options.
672 #
673 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
674 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700675 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700676 "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.
677 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700678 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700679 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
680 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
681 #
682 # The key must meet the following requirements before you can provide it to Compute Engine:
683 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700684 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700685 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400686 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700687 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400688 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700689 "a_key": "A String",
690 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700691 "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.
692 { # Guest OS features.
693 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
694 },
695 ],
696 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700697 "A String",
698 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700699 "sourceStorageObject": "A String", # The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700700 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
701 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700702 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700703 "A String",
704 ],
705 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
706 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700707 # After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700708 #
709 # Customer-supplied encryption keys do not protect access to metadata of the disk.
710 #
711 # If you do not provide an encryption key when creating the disk, 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.
712 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700713 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700714 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
715 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
716 #
717 # The key must meet the following requirements before you can provide it to Compute Engine:
718 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700719 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700720 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400721 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700722 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700723 "sourceDisk": "A String", # The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
724 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
725 # - projects/project/zones/zone/disks/disk
726 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -0700727 "sourceInPlaceSnapshotId": "A String", # [Output Only] The unique ID of the in-place snapshot used to create this disk. This value identifies the exact in-place snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an in-place snapshot that was later deleted and recreated under the same name, the source in-place snapshot ID would identify the exact version of the in-place snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700728 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700729 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700730 "multiWriter": True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
731 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
732 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Dan O'Mearadd494642020-05-01 07:42:23 -0700733 "status": "A String", # [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700734 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
735 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
736 # - projects/project/global/snapshots/snapshot
737 # - global/snapshots/snapshot
738 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
739 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
740 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700741 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set 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, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700742 #
743 # To see the latest fingerprint, make a get() request to retrieve a disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700744 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource's resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700745 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700746 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
747 "A String",
748 ],
749 "eraseWindowsVssSignature": True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700750 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
751 "A String",
752 ],
753 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700754 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
755 "A String",
756 ],
757 "sourceDiskId": "A String", # [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700758 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700759 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700760 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
761 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700762 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
763 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Dan O'Mearadd494642020-05-01 07:42:23 -0700764 "sourceInPlaceSnapshot": "A String", # The source in-place snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
765 # - https://www.googleapis.com/compute/v1/projects/project/global/inPlaceSnapshots/inPlaceSnapshots
766 # - projects/project/global/inPlaceSnapshots/inPlaceSnapshots
767 # - global/inPlaceSnapshots/inPlaceSnapshots
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700768 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
769 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700770 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700771 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
772 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
773 #
774 # The key must meet the following requirements before you can provide it to Compute Engine:
775 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700776 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700777 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400778 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700779 },
780 "options": "A String", # Internal use only.
781 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
782 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
783 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700784 # 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:
785 # projects/debian-cloud/global/images/family/debian-9
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700786 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700787 #
788 # Alternatively, use a specific version of a public operating system image:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700789 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700790 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700791 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700792 # To create a disk with a custom image that you created, specify the image name in the following format:
793 # global/images/my-custom-image
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700794 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700795 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700796 # 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:
797 # global/images/family/my-image-family
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700798 }</pre>
799</div>
800
801<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700802 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource, optionsRequestedPolicyVersion=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400803 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
804
805Args:
806 project: string, Project ID for this request. (required)
807 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700808 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700809 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400810
811Returns:
812 An object of the form:
813
Dan O'Mearadd494642020-05-01 07:42:23 -0700814 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400815 #
816 #
817 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700818 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400819 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700820 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400821 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700822 # **JSON example:**
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400823 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700824 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700825 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700826 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700827 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700828 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700829 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700830 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400831 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400832 { # 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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400833 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700834 # 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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400835 #
836 # Example Policy with multiple AuditConfigs:
837 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700838 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400839 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700840 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400841 "exemptedMembers": [
842 "A String",
843 ],
844 "auditLogConfigs": [ # The configuration for logging of each type of permission.
845 { # Provides the configuration for logging a type of permissions. Example:
846 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700847 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400848 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700849 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400850 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
851 "A String",
852 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700853 "ignoreChildExemptions": True or False,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400854 "logType": "A String", # The log type that this config enables.
855 },
856 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400857 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400858 },
859 ],
860 "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.
861 { # A rule to be applied in a Policy.
862 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
863 { # Specifies what kind of log the caller must write
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700864 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
865 #
866 # 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.
867 #
868 # Field names correspond to IAM request parameters and field values are their respective values.
869 #
870 # 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.
871 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700872 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400873 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -0700874 "customFields": [ # Custom fields.
875 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
876 "name": "A String", # Name is the field name.
877 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
878 },
879 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400880 "metric": "A String", # The metric to update.
881 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700882 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -0700883 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700884 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400885 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
886 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700887 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
888 "permissionType": "A String", # The type of the permission that was checked.
889 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400890 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400891 },
892 ],
893 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
894 "A String",
895 ],
896 "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.
897 "A String",
898 ],
899 "action": "A String", # Required
900 "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.
901 "A String",
902 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700903 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400904 { # A condition to be met.
905 "iam": "A String", # Trusted attributes supplied by the IAM system.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400906 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700907 "values": [ # The objects of the condition.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400908 "A String",
909 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700910 "svc": "A String", # Trusted attributes discharged by the service.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400911 "op": "A String", # An operator to apply the subject with.
912 },
913 ],
914 "description": "A String", # Human-readable description of the rule.
915 },
916 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700917 "version": 42, # Specifies the format of the policy.
918 #
919 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
920 #
921 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
922 #
923 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
924 #
925 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
926 #
927 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400928 "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.
929 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700930 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
931 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400932 { # Associates `members` with a `role`.
933 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
934 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
935 #
936 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
937 #
938 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
939 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700940 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400941 #
942 #
943 #
944 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
945 #
946 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
947 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700948 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
949 #
950 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
951 #
952 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
953 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400954 #
955 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700956 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400957 "A String",
958 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700959 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700960 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700961 # Example (Comparison):
962 #
963 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
964 #
965 # Example (Equality):
966 #
967 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
968 #
969 # Example (Logic):
970 #
971 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
972 #
973 # Example (Data Manipulation):
974 #
975 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
976 #
977 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
978 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700979 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -0700980 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
981 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700982 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400983 },
984 ],
985 "iamOwned": True or False,
986 }</pre>
987</div>
988
989<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700990 <code class="details" id="insert">insert(project, zone, body=None, requestId=None, sourceImage=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700991 <pre>Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.
992
993Args:
994 project: string, Project ID for this request. (required)
995 zone: string, The name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700996 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700997 The object takes the form of:
998
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700999{ # Represents a Persistent Disk resource.
1000 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001001 # Google Compute Engine has two Disk resources:
1002 #
1003 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
1004 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001005 # Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks. For more information, read Persistent Disks. For more storage options, read Storage options.
1006 #
1007 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
1008 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001009 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001010 "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.
1011 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07001012 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001013 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1014 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1015 #
1016 # The key must meet the following requirements before you can provide it to Compute Engine:
1017 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001018 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001019 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001020 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001021 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001022 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001023 "a_key": "A String",
1024 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001025 "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.
1026 { # Guest OS features.
1027 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
1028 },
1029 ],
1030 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001031 "A String",
1032 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001033 "sourceStorageObject": "A String", # The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001034 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1035 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001036 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001037 "A String",
1038 ],
1039 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
1040 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001041 # After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001042 #
1043 # Customer-supplied encryption keys do not protect access to metadata of the disk.
1044 #
1045 # If you do not provide an encryption key when creating the disk, 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.
1046 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07001047 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001048 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1049 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1050 #
1051 # The key must meet the following requirements before you can provide it to Compute Engine:
1052 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001053 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001054 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001055 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001056 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001057 "sourceDisk": "A String", # The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
1058 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
1059 # - projects/project/zones/zone/disks/disk
1060 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -07001061 "sourceInPlaceSnapshotId": "A String", # [Output Only] The unique ID of the in-place snapshot used to create this disk. This value identifies the exact in-place snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an in-place snapshot that was later deleted and recreated under the same name, the source in-place snapshot ID would identify the exact version of the in-place snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001062 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001063 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001064 "multiWriter": True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
1065 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
1066 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Dan O'Mearadd494642020-05-01 07:42:23 -07001067 "status": "A String", # [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001068 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
1069 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1070 # - projects/project/global/snapshots/snapshot
1071 # - global/snapshots/snapshot
1072 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
1073 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1074 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001075 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set 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, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001076 #
1077 # To see the latest fingerprint, make a get() request to retrieve a disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001078 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource's resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001079 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001080 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
1081 "A String",
1082 ],
1083 "eraseWindowsVssSignature": True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001084 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1085 "A String",
1086 ],
1087 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001088 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1089 "A String",
1090 ],
1091 "sourceDiskId": "A String", # [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001092 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001093 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001094 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
1095 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001096 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
1097 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Dan O'Mearadd494642020-05-01 07:42:23 -07001098 "sourceInPlaceSnapshot": "A String", # The source in-place snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
1099 # - https://www.googleapis.com/compute/v1/projects/project/global/inPlaceSnapshots/inPlaceSnapshots
1100 # - projects/project/global/inPlaceSnapshots/inPlaceSnapshots
1101 # - global/inPlaceSnapshots/inPlaceSnapshots
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001102 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
1103 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07001104 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001105 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1106 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1107 #
1108 # The key must meet the following requirements before you can provide it to Compute Engine:
1109 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001110 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001111 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001112 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001113 },
1114 "options": "A String", # Internal use only.
1115 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
1116 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
1117 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001118 # 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:
1119 # projects/debian-cloud/global/images/family/debian-9
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001120 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001121 #
1122 # Alternatively, use a specific version of a public operating system image:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001123 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001124 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001125 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001126 # To create a disk with a custom image that you created, specify the image name in the following format:
1127 # global/images/my-custom-image
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001128 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001129 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001130 # 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:
1131 # global/images/family/my-image-family
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001132 }
1133
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001134 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.
1135
1136For 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.
1137
1138The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001139 sourceImage: string, Optional. Source image to restore onto a disk.
1140
1141Returns:
1142 An object of the form:
1143
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001144 { # Represents an Operation resource.
1145 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001146 # Google Compute Engine has three Operation resources:
1147 #
1148 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1149 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001150 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1151 #
1152 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001153 # - For global operations, use the `globalOperations` resource.
1154 # - For regional operations, use the `regionOperations` resource.
1155 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001156 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001157 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001158 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001159 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001160 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07001161 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001162 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001163 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001164 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1165 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001166 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07001167 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001168 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07001169 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001170 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1171 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1172 {
1173 "message": "A String", # [Output Only] A human-readable description of the warning code.
1174 "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.
1175 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1176 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1177 {
1178 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1179 "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).
1180 },
1181 ],
1182 },
1183 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001184 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07001185 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001186 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001187 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1188 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001189 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001190 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1191 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1192 {
1193 "message": "A String", # [Output Only] An optional, human-readable error message.
1194 "code": "A String", # [Output Only] The error type identifier for this error.
1195 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1196 },
1197 ],
1198 },
1199 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1200 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001201 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001202 }</pre>
1203</div>
1204
1205<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001206 <code class="details" id="list">list(project, zone, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001207 <pre>Retrieves a list of persistent disks contained within the specified zone.
1208
1209Args:
1210 project: string, Project ID for this request. (required)
1211 zone: string, The name of the zone for this request. (required)
1212 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1213
Dan O'Mearadd494642020-05-01 07:42:23 -07001214You 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001215
Dan O'Mearadd494642020-05-01 07:42:23 -07001216Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1217 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.
1218 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`)
1219 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
1220 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 `=`, `!=`, `&gt;`, or `&lt;`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001221
Dan O'Mearadd494642020-05-01 07:42:23 -07001222For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001223
Dan O'Mearadd494642020-05-01 07:42:23 -07001224You 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001225
Dan O'Mearadd494642020-05-01 07:42:23 -07001226To 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) ```
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001227
1228Returns:
1229 An object of the form:
1230
1231 { # A list of Disk resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001232 "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.
1233 "kind": "compute#diskList", # [Output Only] Type of resource. Always compute#diskList for lists of disks.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001234 "items": [ # A list of Disk resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001235 { # Represents a Persistent Disk resource.
1236 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001237 # Google Compute Engine has two Disk resources:
1238 #
1239 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
1240 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001241 # Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks. For more information, read Persistent Disks. For more storage options, read Storage options.
1242 #
1243 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
1244 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001245 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001246 "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.
1247 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07001248 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001249 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1250 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1251 #
1252 # The key must meet the following requirements before you can provide it to Compute Engine:
1253 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001254 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001255 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001256 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001257 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001258 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001259 "a_key": "A String",
1260 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001261 "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.
1262 { # Guest OS features.
1263 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
1264 },
1265 ],
1266 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001267 "A String",
1268 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001269 "sourceStorageObject": "A String", # The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001270 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1271 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001272 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001273 "A String",
1274 ],
1275 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
1276 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001277 # After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001278 #
1279 # Customer-supplied encryption keys do not protect access to metadata of the disk.
1280 #
1281 # If you do not provide an encryption key when creating the disk, 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.
1282 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07001283 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001284 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1285 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1286 #
1287 # The key must meet the following requirements before you can provide it to Compute Engine:
1288 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001289 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001290 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001291 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001292 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001293 "sourceDisk": "A String", # The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
1294 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
1295 # - projects/project/zones/zone/disks/disk
1296 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -07001297 "sourceInPlaceSnapshotId": "A String", # [Output Only] The unique ID of the in-place snapshot used to create this disk. This value identifies the exact in-place snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an in-place snapshot that was later deleted and recreated under the same name, the source in-place snapshot ID would identify the exact version of the in-place snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001298 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001299 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001300 "multiWriter": True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
1301 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
1302 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Dan O'Mearadd494642020-05-01 07:42:23 -07001303 "status": "A String", # [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001304 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
1305 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1306 # - projects/project/global/snapshots/snapshot
1307 # - global/snapshots/snapshot
1308 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
1309 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
1310 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001311 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set 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, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001312 #
1313 # To see the latest fingerprint, make a get() request to retrieve a disk.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001314 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource's resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001315 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001316 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
1317 "A String",
1318 ],
1319 "eraseWindowsVssSignature": True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001320 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1321 "A String",
1322 ],
1323 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001324 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1325 "A String",
1326 ],
1327 "sourceDiskId": "A String", # [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001328 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001329 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001330 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
1331 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001332 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
1333 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Dan O'Mearadd494642020-05-01 07:42:23 -07001334 "sourceInPlaceSnapshot": "A String", # The source in-place snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
1335 # - https://www.googleapis.com/compute/v1/projects/project/global/inPlaceSnapshots/inPlaceSnapshots
1336 # - projects/project/global/inPlaceSnapshots/inPlaceSnapshots
1337 # - global/inPlaceSnapshots/inPlaceSnapshots
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001338 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
1339 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07001340 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001341 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1342 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1343 #
1344 # The key must meet the following requirements before you can provide it to Compute Engine:
1345 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001346 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001347 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001348 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001349 },
1350 "options": "A String", # Internal use only.
1351 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
1352 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
1353 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001354 # 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:
1355 # projects/debian-cloud/global/images/family/debian-9
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001356 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001357 #
1358 # Alternatively, use a specific version of a public operating system image:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001359 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001360 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001361 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001362 # To create a disk with a custom image that you created, specify the image name in the following format:
1363 # global/images/my-custom-image
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001364 #
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001365 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001366 # 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:
1367 # global/images/family/my-image-family
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001368 },
1369 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001370 "warning": { # [Output Only] Informational warning message.
1371 "message": "A String", # [Output Only] A human-readable description of the warning code.
1372 "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.
1373 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1374 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1375 {
1376 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1377 "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).
1378 },
1379 ],
1380 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001381 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001382 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
1383 }</pre>
1384</div>
1385
1386<div class="method">
1387 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1388 <pre>Retrieves the next page of results.
1389
1390Args:
1391 previous_request: The request for the previous page. (required)
1392 previous_response: The response from the request for the previous page. (required)
1393
1394Returns:
1395 A request object that you can call 'execute()' on to request the next
1396 page. Returns None if there are no more items in the collection.
1397 </pre>
1398</div>
1399
1400<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001401 <code class="details" id="removeResourcePolicies">removeResourcePolicies(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001402 <pre>Removes resource policies from a disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001403
1404Args:
1405 project: string, Project ID for this request. (required)
1406 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001407 disk: string, The disk name for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001408 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001409 The object takes the form of:
1410
1411{
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001412 "resourcePolicies": [ # Resource policies to be removed from this disk.
1413 "A String",
1414 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001415 }
1416
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001417 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.
1418
1419For 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.
1420
1421The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001422
1423Returns:
1424 An object of the form:
1425
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001426 { # Represents an Operation resource.
1427 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001428 # Google Compute Engine has three Operation resources:
1429 #
1430 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1431 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001432 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1433 #
1434 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001435 # - For global operations, use the `globalOperations` resource.
1436 # - For regional operations, use the `regionOperations` resource.
1437 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001438 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001439 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001440 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001441 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001442 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07001443 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001444 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001445 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001446 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1447 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001448 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07001449 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001450 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07001451 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001452 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1453 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1454 {
1455 "message": "A String", # [Output Only] A human-readable description of the warning code.
1456 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1457 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1458 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1459 {
1460 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1461 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1462 },
1463 ],
1464 },
1465 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001466 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07001467 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001468 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001469 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1470 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001471 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1472 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1473 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1474 {
1475 "message": "A String", # [Output Only] An optional, human-readable error message.
1476 "code": "A String", # [Output Only] The error type identifier for this error.
1477 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1478 },
1479 ],
1480 },
1481 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1482 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1483 "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.
1484 }</pre>
1485</div>
1486
1487<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001488 <code class="details" id="resize">resize(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001489 <pre>Resizes the specified persistent disk. You can only increase the size of the disk.
1490
1491Args:
1492 project: string, Project ID for this request. (required)
1493 zone: string, The name of the zone for this request. (required)
1494 disk: string, The name of the persistent disk. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001495 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001496 The object takes the form of:
1497
1498{
1499 "sizeGb": "A String", # The new size of the persistent disk, which is specified in GB.
1500 }
1501
1502 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.
1503
1504For 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.
1505
1506The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1507
1508Returns:
1509 An object of the form:
1510
1511 { # Represents an Operation resource.
1512 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001513 # Google Compute Engine has three Operation resources:
1514 #
1515 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1516 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001517 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1518 #
1519 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001520 # - For global operations, use the `globalOperations` resource.
1521 # - For regional operations, use the `regionOperations` resource.
1522 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001523 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001524 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001525 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1526 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1527 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07001528 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001529 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
1530 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001531 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1532 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001533 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07001534 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001535 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07001536 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001537 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1538 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1539 {
1540 "message": "A String", # [Output Only] A human-readable description of the warning code.
1541 "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.
1542 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1543 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1544 {
1545 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1546 "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).
1547 },
1548 ],
1549 },
1550 ],
1551 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07001552 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001553 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07001554 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1555 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001556 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001557 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1558 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1559 {
1560 "message": "A String", # [Output Only] An optional, human-readable error message.
1561 "code": "A String", # [Output Only] The error type identifier for this error.
1562 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1563 },
1564 ],
1565 },
1566 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1567 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001568 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001569 }</pre>
1570</div>
1571
1572<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001573 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001574 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1575
1576Args:
1577 project: string, Project ID for this request. (required)
1578 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001579 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001580 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001581 The object takes the form of:
1582
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001583{
Dan O'Mearadd494642020-05-01 07:42:23 -07001584 "policy": { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud 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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001585 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001586 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001587 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001588 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001589 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001590 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001591 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001592 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001593 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001594 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001595 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001596 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001597 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001598 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001599 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001600 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001601 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
1602 { # 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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001603 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001604 # 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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001605 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001606 # Example Policy with multiple AuditConfigs:
1607 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001608 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001609 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001610 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001611 "exemptedMembers": [
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001612 "A String",
1613 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001614 "auditLogConfigs": [ # The configuration for logging of each type of permission.
1615 { # Provides the configuration for logging a type of permissions. Example:
1616 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001617 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001618 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001619 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001620 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1621 "A String",
1622 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001623 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001624 "logType": "A String", # The log type that this config enables.
1625 },
1626 ],
1627 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001628 },
1629 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001630 "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.
1631 { # A rule to be applied in a Policy.
1632 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1633 { # Specifies what kind of log the caller must write
1634 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
1635 #
1636 # 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.
1637 #
1638 # Field names correspond to IAM request parameters and field values are their respective values.
1639 #
1640 # 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.
1641 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001642 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001643 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -07001644 "customFields": [ # Custom fields.
1645 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1646 "name": "A String", # Name is the field name.
1647 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
1648 },
1649 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001650 "metric": "A String", # The metric to update.
1651 },
1652 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -07001653 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001654 },
1655 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
1656 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
1657 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1658 "permissionType": "A String", # The type of the permission that was checked.
1659 },
1660 },
1661 },
1662 ],
1663 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1664 "A String",
1665 ],
1666 "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.
1667 "A String",
1668 ],
1669 "action": "A String", # Required
1670 "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.
1671 "A String",
1672 ],
1673 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1674 { # A condition to be met.
1675 "iam": "A String", # Trusted attributes supplied by the IAM system.
1676 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1677 "values": [ # The objects of the condition.
1678 "A String",
1679 ],
1680 "svc": "A String", # Trusted attributes discharged by the service.
1681 "op": "A String", # An operator to apply the subject with.
1682 },
1683 ],
1684 "description": "A String", # Human-readable description of the rule.
1685 },
1686 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001687 "version": 42, # Specifies the format of the policy.
1688 #
1689 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1690 #
1691 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1692 #
1693 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
1694 #
1695 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1696 #
1697 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001698 "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.
1699 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001700 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1701 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001702 { # Associates `members` with a `role`.
1703 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1704 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1705 #
1706 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1707 #
1708 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1709 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001710 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001711 #
1712 #
1713 #
1714 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1715 #
1716 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1717 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001718 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1719 #
1720 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1721 #
1722 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1723 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001724 #
1725 #
1726 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1727 "A String",
1728 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001729 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001730 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001731 # Example (Comparison):
1732 #
1733 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1734 #
1735 # Example (Equality):
1736 #
1737 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1738 #
1739 # Example (Logic):
1740 #
1741 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1742 #
1743 # Example (Data Manipulation):
1744 #
1745 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1746 #
1747 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1748 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001749 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001750 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1751 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001752 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001753 },
1754 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001755 "iamOwned": True or False,
1756 },
1757 "bindings": [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings.
1758 { # Associates `members` with a `role`.
1759 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1760 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1761 #
1762 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1763 #
1764 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1765 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001766 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001767 #
1768 #
1769 #
1770 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1771 #
1772 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1773 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001774 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1775 #
1776 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1777 #
1778 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1779 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001780 #
1781 #
1782 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1783 "A String",
1784 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001785 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001786 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001787 # Example (Comparison):
1788 #
1789 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1790 #
1791 # Example (Equality):
1792 #
1793 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1794 #
1795 # Example (Logic):
1796 #
1797 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1798 #
1799 # Example (Data Manipulation):
1800 #
1801 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1802 #
1803 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1804 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001805 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001806 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1807 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001808 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001809 },
1810 ],
1811 "etag": "A String", # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag.
1812 }
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001813
1814
1815Returns:
1816 An object of the form:
1817
Dan O'Mearadd494642020-05-01 07:42:23 -07001818 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001819 #
1820 #
1821 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001822 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001823 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001824 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001825 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001826 # **JSON example:**
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001827 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001828 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001829 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001830 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001831 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001832 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001833 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001834 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001835 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001836 { # 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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001837 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001838 # 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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001839 #
1840 # Example Policy with multiple AuditConfigs:
1841 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001842 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001843 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001844 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001845 "exemptedMembers": [
1846 "A String",
1847 ],
1848 "auditLogConfigs": [ # The configuration for logging of each type of permission.
1849 { # Provides the configuration for logging a type of permissions. Example:
1850 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001851 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001852 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001853 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001854 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1855 "A String",
1856 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001857 "ignoreChildExemptions": True or False,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001858 "logType": "A String", # The log type that this config enables.
1859 },
1860 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001861 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001862 },
1863 ],
1864 "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.
1865 { # A rule to be applied in a Policy.
1866 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1867 { # Specifies what kind of log the caller must write
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001868 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
1869 #
1870 # 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.
1871 #
1872 # Field names correspond to IAM request parameters and field values are their respective values.
1873 #
1874 # 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.
1875 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001876 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001877 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -07001878 "customFields": [ # Custom fields.
1879 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1880 "name": "A String", # Name is the field name.
1881 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
1882 },
1883 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001884 "metric": "A String", # The metric to update.
1885 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001886 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -07001887 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001888 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001889 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
1890 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001891 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1892 "permissionType": "A String", # The type of the permission that was checked.
1893 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001894 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001895 },
1896 ],
1897 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1898 "A String",
1899 ],
1900 "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.
1901 "A String",
1902 ],
1903 "action": "A String", # Required
1904 "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.
1905 "A String",
1906 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001907 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001908 { # A condition to be met.
1909 "iam": "A String", # Trusted attributes supplied by the IAM system.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001910 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001911 "values": [ # The objects of the condition.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001912 "A String",
1913 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001914 "svc": "A String", # Trusted attributes discharged by the service.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001915 "op": "A String", # An operator to apply the subject with.
1916 },
1917 ],
1918 "description": "A String", # Human-readable description of the rule.
1919 },
1920 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001921 "version": 42, # Specifies the format of the policy.
1922 #
1923 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1924 #
1925 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1926 #
1927 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
1928 #
1929 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1930 #
1931 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001932 "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.
1933 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001934 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1935 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001936 { # Associates `members` with a `role`.
1937 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1938 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1939 #
1940 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1941 #
1942 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1943 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001944 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001945 #
1946 #
1947 #
1948 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1949 #
1950 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1951 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001952 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1953 #
1954 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1955 #
1956 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1957 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001958 #
1959 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001960 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001961 "A String",
1962 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001963 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001964 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001965 # Example (Comparison):
1966 #
1967 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1968 #
1969 # Example (Equality):
1970 #
1971 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1972 #
1973 # Example (Logic):
1974 #
1975 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1976 #
1977 # Example (Data Manipulation):
1978 #
1979 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1980 #
1981 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1982 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001983 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001984 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1985 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001986 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001987 },
1988 ],
1989 "iamOwned": True or False,
1990 }</pre>
1991</div>
1992
1993<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001994 <code class="details" id="setLabels">setLabels(project, zone, resource, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001995 <pre>Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001996
1997Args:
1998 project: string, Project ID for this request. (required)
1999 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002000 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002001 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002002 The object takes the form of:
2003
2004{
2005 "labelFingerprint": "A String", # The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint.
2006 "labels": { # The labels to set for this resource.
2007 "a_key": "A String",
2008 },
2009 }
2010
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002011 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.
2012
2013For 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.
2014
2015The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002016
2017Returns:
2018 An object of the form:
2019
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002020 { # Represents an Operation resource.
2021 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002022 # Google Compute Engine has three Operation resources:
2023 #
2024 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2025 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002026 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2027 #
2028 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002029 # - For global operations, use the `globalOperations` resource.
2030 # - For regional operations, use the `regionOperations` resource.
2031 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002032 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002033 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002034 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002035 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04002036 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07002037 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002038 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002039 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002040 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2041 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002042 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07002043 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002044 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07002045 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002046 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
2047 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2048 {
2049 "message": "A String", # [Output Only] A human-readable description of the warning code.
2050 "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.
2051 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
2052 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
2053 {
2054 "value": "A String", # [Output Only] A warning data value corresponding to the key.
2055 "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).
2056 },
2057 ],
2058 },
2059 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002060 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -07002061 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002062 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -07002063 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2064 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002065 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002066 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2067 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
2068 {
2069 "message": "A String", # [Output Only] An optional, human-readable error message.
2070 "code": "A String", # [Output Only] The error type identifier for this error.
2071 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2072 },
2073 ],
2074 },
2075 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2076 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002077 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002078 }</pre>
2079</div>
2080
2081<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002082 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002083 <pre>Returns permissions that a caller has on the specified resource.
2084
2085Args:
2086 project: string, Project ID for this request. (required)
2087 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002088 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002089 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002090 The object takes the form of:
2091
2092{
2093 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
2094 "A String",
2095 ],
2096 }
2097
2098
2099Returns:
2100 An object of the form:
2101
2102 {
2103 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2104 "A String",
2105 ],
2106 }</pre>
2107</div>
2108
2109</body></html>