blob: b23003019dec2fee0cdb4078ae3c1300c4a81685 [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_beta.html">Compute Engine API</a> . <a href="compute_beta.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">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070081 <code><a href="#aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=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">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070087 <code><a href="#close">close()</a></code></p>
88<p class="firstline">Close httplib2 connections.</p>
89<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#createSnapshot">createSnapshot(project, zone, disk, body=None, guestFlush=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070091<p class="firstline">Creates a snapshot of a specified persistent disk.</p>
92<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070093 <code><a href="#delete">delete(project, zone, disk, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070094<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>
95<p class="toc_element">
96 <code><a href="#get">get(project, zone, disk)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<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 -070098<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070099 <code><a href="#getIamPolicy">getIamPolicy(project, zone, resource, optionsRequestedPolicyVersion=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
101<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 <code><a href="#insert">insert(project, zone, body=None, requestId=None, sourceImage=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700103<p class="firstline">Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) 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>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700104<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700105 <code><a href="#list">list(project, zone, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700106<p class="firstline">Retrieves a list of persistent disks contained within the specified zone.</p>
107<p class="toc_element">
108 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
109<p class="firstline">Retrieves the next page of results.</p>
110<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700111 <code><a href="#removeResourcePolicies">removeResourcePolicies(project, zone, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112<p class="firstline">Removes resource policies from a 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="#resize">resize(project, zone, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700115<p class="firstline">Resizes the specified persistent disk. You can only increase the size of the disk.</p>
116<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 <code><a href="#setIamPolicy">setIamPolicy(project, zone, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
119<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 <code><a href="#setLabels">setLabels(project, zone, resource, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700121<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 -0700122<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700123 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700124<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
125<h3>Method Details</h3>
126<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700127 <code class="details" id="addResourcePolicies">addResourcePolicies(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700128 <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.
129
130Args:
131 project: string, Project ID for this request. (required)
132 zone: string, The name of the zone for this request. (required)
133 disk: string, The disk name for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700134 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700135 The object takes the form of:
136
137{
Bu Sun Kim65020912020-05-20 12:08:20 -0700138 &quot;resourcePolicies&quot;: [ # Resource policies to be added to this disk. Currently you can only specify one policy here.
139 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700140 ],
141 }
142
143 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.
144
145For 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.
146
147The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
148
149Returns:
150 An object of the form:
151
152 { # Represents an Operation resource.
153 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700154 # Google Compute Engine has three Operation resources:
155 #
156 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
157 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700158 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
159 #
160 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700161 # - For global operations, use the `globalOperations` resource.
162 # - For regional operations, use the `regionOperations` resource.
163 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700164 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700165 # 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 Kim65020912020-05-20 12:08:20 -0700166 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
167 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
168 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
169 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
170 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
171 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700172 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
174 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
175 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700176 },
177 ],
178 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700179 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
180 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
181 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
182 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
183 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
184 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
185 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
186 &quot;progress&quot;: 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.
187 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
188 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
189 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
190 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
191 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
192 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
193 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
194 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
195 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
196 {
197 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
198 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
199 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
200 {
201 &quot;key&quot;: &quot;A String&quot;, # [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).
202 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
203 },
204 ],
205 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
206 },
207 ],
208 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700209 }</pre>
210</div>
211
212<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700213 <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700214 <pre>Retrieves an aggregated list of persistent disks.
215
216Args:
217 project: string, Project ID for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700218 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 -0700219
Dan O'Mearadd494642020-05-01 07:42:23 -0700220For 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 -0700221
Dan O'Mearadd494642020-05-01 07:42:23 -0700222You 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 -0700223
Bu Sun Kim65020912020-05-20 12:08:20 -0700224To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
Dan O'Mearadd494642020-05-01 07:42:23 -0700225 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700226 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`)
227 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
228
229You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. 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.
230
231Currently, only sorting by `name` or `creationTimestamp desc` is supported.
232 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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700233 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700234
235Returns:
236 An object of the form:
237
238 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700239 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
240 &quot;items&quot;: { # A list of DisksScopedList resources.
241 &quot;a_key&quot;: { # [Output Only] Name of the scope containing this set of disks.
242 &quot;disks&quot;: [ # [Output Only] A list of disks contained in this scope.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700243 { # Represents a Persistent Disk resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700244 #
245 # Google Compute Engine has two Disk resources:
246 #
247 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
248 #
249 # 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.
250 #
251 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
252 #
253 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
254 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
255 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700256 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700257 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700258 # 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).
Dan O'Mearadd494642020-05-01 07:42:23 -0700259 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700260 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -0700261 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700262 # 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.
263 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
264 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
265 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
266 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700267 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700268 # The key must meet the following requirements before you can provide it to Compute Engine:
269 # - The key is wrapped using a RSA public key certificate provided by Google.
270 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
271 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
272 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700273 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700274 &quot;eraseWindowsVssSignature&quot;: True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
275 &quot;guestOsFeatures&quot;: [ # 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.
276 { # Guest OS features.
277 &quot;type&quot;: &quot;A String&quot;, # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
278 },
279 ],
280 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700281 &quot;interface&quot;: &quot;A String&quot;, # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
Bu Sun Kim65020912020-05-20 12:08:20 -0700282 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
283 &quot;labelFingerprint&quot;: &quot;A String&quot;, # 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.
284 #
285 # To see the latest fingerprint, make a get() request to retrieve a disk.
286 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
287 &quot;a_key&quot;: &quot;A String&quot;,
288 },
289 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
290 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
291 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
292 &quot;A String&quot;,
293 ],
294 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
295 &quot;A String&quot;,
296 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700297 &quot;multiWriter&quot;: True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
Bu Sun Kim65020912020-05-20 12:08:20 -0700298 &quot;name&quot;: &quot;A String&quot;, # 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.
299 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700300 &quot;physicalBlockSizeBytes&quot;: &quot;A String&quot;, # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, 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&#x27;s project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700301 &quot;region&quot;: &quot;A String&quot;, # [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.
302 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
303 &quot;A String&quot;,
304 ],
305 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
306 &quot;A String&quot;,
307 ],
308 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700309 &quot;sizeGb&quot;: &quot;A String&quot;, # Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk.
Bu Sun Kim65020912020-05-20 12:08:20 -0700310 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700311 # If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are 1 to 65536, inclusive.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700312 &quot;sourceDisk&quot;: &quot;A String&quot;, # 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:
313 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
314 # - projects/project/zones/zone/disks/disk
315 # - zones/zone/disks/disk
316 &quot;sourceDiskId&quot;: &quot;A String&quot;, # [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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700317 &quot;sourceImage&quot;: &quot;A String&quot;, # The source image used to create this disk. If the source image is deleted, this field will not be set.
318 #
319 # 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:
320 # projects/debian-cloud/global/images/family/debian-9
321 #
322 #
323 # Alternatively, use a specific version of a public operating system image:
324 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
325 #
326 #
327 # To create a disk with a custom image that you created, specify the image name in the following format:
328 # global/images/my-custom-image
329 #
330 #
331 # 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:
332 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700333 &quot;sourceImageEncryptionKey&quot;: { # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700334 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
335 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
336 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
337 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
338 #
339 # The key must meet the following requirements before you can provide it to Compute Engine:
340 # - The key is wrapped using a RSA public key certificate provided by Google.
341 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
342 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
343 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
344 },
345 &quot;sourceImageId&quot;: &quot;A String&quot;, # [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.
346 &quot;sourceSnapshot&quot;: &quot;A String&quot;, # 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:
347 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
348 # - projects/project/global/snapshots/snapshot
349 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700350 &quot;sourceSnapshotEncryptionKey&quot;: { # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700351 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
352 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
353 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
354 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
355 #
356 # The key must meet the following requirements before you can provide it to Compute Engine:
357 # - The key is wrapped using a RSA public key certificate provided by Google.
358 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
359 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
360 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
361 },
362 &quot;sourceSnapshotId&quot;: &quot;A String&quot;, # [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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700363 &quot;sourceStorageObject&quot;: &quot;A String&quot;, # 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/.
Bu Sun Kim65020912020-05-20 12:08:20 -0700364 &quot;status&quot;: &quot;A String&quot;, # [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.
365 &quot;storageType&quot;: &quot;A String&quot;, # [Deprecated] Storage type of the persistent disk.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700366 &quot;type&quot;: &quot;A String&quot;, # 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
Bu Sun Kim65020912020-05-20 12:08:20 -0700367 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
368 &quot;A String&quot;,
369 ],
370 &quot;zone&quot;: &quot;A String&quot;, # [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.
371 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700372 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700373 &quot;warning&quot;: { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
374 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
375 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
376 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700377 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700378 &quot;key&quot;: &quot;A String&quot;, # [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).
379 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700380 },
381 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700382 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700383 },
384 },
385 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700386 &quot;kind&quot;: &quot;compute#diskAggregatedList&quot;, # [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.
387 &quot;nextPageToken&quot;: &quot;A String&quot;, # [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.
388 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700389 &quot;unreachables&quot;: [ # [Output Only] Unreachable resources.
390 &quot;A String&quot;,
391 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700392 &quot;warning&quot;: { # [Output Only] Informational warning message.
393 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
394 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
395 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700396 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700397 &quot;key&quot;: &quot;A String&quot;, # [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 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 },
400 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700401 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700403 }</pre>
404</div>
405
406<div class="method">
407 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
408 <pre>Retrieves the next page of results.
409
410Args:
411 previous_request: The request for the previous page. (required)
412 previous_response: The response from the request for the previous page. (required)
413
414Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700415 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700416 page. Returns None if there are no more items in the collection.
417 </pre>
418</div>
419
420<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700421 <code class="details" id="close">close()</code>
422 <pre>Close httplib2 connections.</pre>
423</div>
424
425<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700426 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body=None, guestFlush=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700427 <pre>Creates a snapshot of a specified persistent disk.
428
429Args:
430 project: string, Project ID for this request. (required)
431 zone: string, The name of the zone for this request. (required)
432 disk: string, Name of the persistent disk to snapshot. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700434 The object takes the form of:
435
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700436{ # Represents a Persistent Disk Snapshot resource.
437 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700438 # 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 ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700439 &quot;autoCreated&quot;: True or False, # [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700440 &quot;chainName&quot;: &quot;A String&quot;, # Chain name should conform to RFC1035.
Bu Sun Kim65020912020-05-20 12:08:20 -0700441 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
442 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
443 &quot;diskSizeGb&quot;: &quot;A String&quot;, # [Output Only] Size of the source disk, specified in GB.
444 &quot;downloadBytes&quot;: &quot;A String&quot;, # [Output Only] Number of bytes downloaded to restore a snapshot to a disk.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700445 &quot;guestFlush&quot;: True or False, # [Input Only] Whether to attempt 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).
Bu Sun Kim65020912020-05-20 12:08:20 -0700446 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
447 &quot;kind&quot;: &quot;compute#snapshot&quot;, # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
448 &quot;labelFingerprint&quot;: &quot;A String&quot;, # 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.
449 #
450 # To see the latest fingerprint, make a get() request to retrieve a snapshot.
451 &quot;labels&quot;: { # Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.
452 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700453 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700454 &quot;licenseCodes&quot;: [ # [Output Only] Integer license codes indicating which licenses are attached to this snapshot.
455 &quot;A String&quot;,
456 ],
457 &quot;licenses&quot;: [ # [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 &quot;A String&quot;,
459 ],
460 &quot;name&quot;: &quot;A String&quot;, # 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.
461 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700462 &quot;snapshotEncryptionKey&quot;: { # Encrypts the snapshot using a customer-supplied encryption key.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700463 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700464 # 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700465 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700466 # Customer-supplied encryption keys do not protect access to metadata of the snapshot.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700467 #
468 # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700469 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
470 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
471 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
472 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700473 #
474 # The key must meet the following requirements before you can provide it to Compute Engine:
475 # - The key is wrapped using a RSA public key certificate provided by Google.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700476 # - 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 -0700477 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
Bu Sun Kim65020912020-05-20 12:08:20 -0700478 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700479 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700480 &quot;sourceDisk&quot;: &quot;A String&quot;, # The source disk used to create this snapshot.
481 &quot;sourceDiskEncryptionKey&quot;: { # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700482 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
483 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
484 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
485 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
486 #
487 # The key must meet the following requirements before you can provide it to Compute Engine:
488 # - The key is wrapped using a RSA public key certificate provided by Google.
489 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
490 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
491 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700492 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700493 &quot;sourceDiskId&quot;: &quot;A String&quot;, # [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.
494 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.
495 &quot;storageBytes&quot;: &quot;A String&quot;, # [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.
496 &quot;storageBytesStatus&quot;: &quot;A String&quot;, # [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.
497 &quot;storageLocations&quot;: [ # Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
498 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700499 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700500 }
501
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700502 guestFlush: boolean, [Input Only] Whether to attempt 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).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700503 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.
504
505For 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.
506
507The 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 -0700508
509Returns:
510 An object of the form:
511
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700512 { # Represents an Operation resource.
513 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700514 # Google Compute Engine has three Operation resources:
515 #
516 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
517 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700518 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
519 #
520 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700521 # - For global operations, use the `globalOperations` resource.
522 # - For regional operations, use the `regionOperations` resource.
523 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700524 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700525 # 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 Kim65020912020-05-20 12:08:20 -0700526 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
527 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
528 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
529 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
530 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
531 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700532 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700533 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
534 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
535 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700536 },
537 ],
538 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700539 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
540 &quot;httpErrorStatusCode&quot;: 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.
541 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
542 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
543 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
544 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
545 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
546 &quot;progress&quot;: 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.
547 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
548 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
549 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
550 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
551 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
552 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
553 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
554 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
555 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
556 {
557 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
558 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
559 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
560 {
561 &quot;key&quot;: &quot;A String&quot;, # [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).
562 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
563 },
564 ],
565 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
566 },
567 ],
568 &quot;zone&quot;: &quot;A String&quot;, # [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 -0700569 }</pre>
570</div>
571
572<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700573 <code class="details" id="delete">delete(project, zone, disk, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700574 <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.
575
576Args:
577 project: string, Project ID for this request. (required)
578 zone: string, The name of the zone for this request. (required)
579 disk: string, Name of the persistent disk to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700580 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.
581
582For 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.
583
584The 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 -0700585
586Returns:
587 An object of the form:
588
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700589 { # Represents an Operation resource.
590 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700591 # Google Compute Engine has three Operation resources:
592 #
593 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
594 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700595 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
596 #
597 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700598 # - For global operations, use the `globalOperations` resource.
599 # - For regional operations, use the `regionOperations` resource.
600 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700601 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700602 # 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 Kim65020912020-05-20 12:08:20 -0700603 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
604 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
605 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
606 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
607 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
608 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700609 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700610 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
611 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
612 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700613 },
614 ],
615 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700616 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
617 &quot;httpErrorStatusCode&quot;: 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.
618 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
619 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
620 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
621 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
622 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
623 &quot;progress&quot;: 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.
624 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
625 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
626 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
627 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
628 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
629 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
630 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
631 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
632 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
633 {
634 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
635 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
636 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
637 {
638 &quot;key&quot;: &quot;A String&quot;, # [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).
639 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
640 },
641 ],
642 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
643 },
644 ],
645 &quot;zone&quot;: &quot;A String&quot;, # [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 -0700646 }</pre>
647</div>
648
649<div class="method">
650 <code class="details" id="get">get(project, zone, disk)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700651 <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 -0700652
653Args:
654 project: string, Project ID for this request. (required)
655 zone: string, The name of the zone for this request. (required)
656 disk: string, Name of the persistent disk to return. (required)
657
658Returns:
659 An object of the form:
660
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700661 { # Represents a Persistent Disk resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700662 #
663 # Google Compute Engine has two Disk resources:
664 #
665 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
666 #
667 # 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.
668 #
669 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
670 #
671 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
672 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
673 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700674 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700675 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700676 # 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).
Dan O'Mearadd494642020-05-01 07:42:23 -0700677 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700678 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -0700679 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700680 # 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.
681 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
682 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
683 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
684 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
685 #
686 # The key must meet the following requirements before you can provide it to Compute Engine:
687 # - The key is wrapped using a RSA public key certificate provided by Google.
688 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
689 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
690 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
691 },
692 &quot;eraseWindowsVssSignature&quot;: True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
693 &quot;guestOsFeatures&quot;: [ # 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.
694 { # Guest OS features.
695 &quot;type&quot;: &quot;A String&quot;, # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700696 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700697 ],
698 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700699 &quot;interface&quot;: &quot;A String&quot;, # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
Bu Sun Kim65020912020-05-20 12:08:20 -0700700 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
701 &quot;labelFingerprint&quot;: &quot;A String&quot;, # 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.
702 #
703 # To see the latest fingerprint, make a get() request to retrieve a disk.
704 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
705 &quot;a_key&quot;: &quot;A String&quot;,
706 },
707 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
708 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
709 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
710 &quot;A String&quot;,
711 ],
712 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
713 &quot;A String&quot;,
714 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700715 &quot;multiWriter&quot;: True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
Bu Sun Kim65020912020-05-20 12:08:20 -0700716 &quot;name&quot;: &quot;A String&quot;, # 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.
717 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700718 &quot;physicalBlockSizeBytes&quot;: &quot;A String&quot;, # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, 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&#x27;s project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700719 &quot;region&quot;: &quot;A String&quot;, # [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.
720 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
721 &quot;A String&quot;,
722 ],
723 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
724 &quot;A String&quot;,
725 ],
726 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700727 &quot;sizeGb&quot;: &quot;A String&quot;, # Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk.
Bu Sun Kim65020912020-05-20 12:08:20 -0700728 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700729 # If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are 1 to 65536, inclusive.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700730 &quot;sourceDisk&quot;: &quot;A String&quot;, # 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:
731 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
732 # - projects/project/zones/zone/disks/disk
733 # - zones/zone/disks/disk
734 &quot;sourceDiskId&quot;: &quot;A String&quot;, # [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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700735 &quot;sourceImage&quot;: &quot;A String&quot;, # The source image used to create this disk. If the source image is deleted, this field will not be set.
736 #
737 # 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:
738 # projects/debian-cloud/global/images/family/debian-9
739 #
740 #
741 # Alternatively, use a specific version of a public operating system image:
742 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
743 #
744 #
745 # To create a disk with a custom image that you created, specify the image name in the following format:
746 # global/images/my-custom-image
747 #
748 #
749 # 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:
750 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700751 &quot;sourceImageEncryptionKey&quot;: { # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700752 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
753 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
754 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
755 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700756 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700757 # The key must meet the following requirements before you can provide it to Compute Engine:
758 # - The key is wrapped using a RSA public key certificate provided by Google.
759 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
760 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
761 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
762 },
763 &quot;sourceImageId&quot;: &quot;A String&quot;, # [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.
764 &quot;sourceSnapshot&quot;: &quot;A String&quot;, # 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:
765 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
766 # - projects/project/global/snapshots/snapshot
767 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700768 &quot;sourceSnapshotEncryptionKey&quot;: { # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700769 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
770 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
771 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
772 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700773 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700774 # 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.
776 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
777 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
778 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
779 },
780 &quot;sourceSnapshotId&quot;: &quot;A String&quot;, # [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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700781 &quot;sourceStorageObject&quot;: &quot;A String&quot;, # 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/.
Bu Sun Kim65020912020-05-20 12:08:20 -0700782 &quot;status&quot;: &quot;A String&quot;, # [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.
783 &quot;storageType&quot;: &quot;A String&quot;, # [Deprecated] Storage type of the persistent disk.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700784 &quot;type&quot;: &quot;A String&quot;, # 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
Bu Sun Kim65020912020-05-20 12:08:20 -0700785 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
786 &quot;A String&quot;,
787 ],
788 &quot;zone&quot;: &quot;A String&quot;, # [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.
789 }</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700790</div>
791
792<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700793 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource, optionsRequestedPolicyVersion=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700794 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
795
796Args:
797 project: string, Project ID for this request. (required)
798 zone: string, The name of the zone for this request. (required)
799 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700800 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700801
802Returns:
803 An object of the form:
804
Dan O'Mearadd494642020-05-01 07:42:23 -0700805 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700806 #
807 #
808 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700809 # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700810 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700811 # For some types of Google Cloud resources, a `binding` can also 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700812 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700813 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700814 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700815 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700816 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700817 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700818 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700819 # 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(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700820 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700821 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700822 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700823 { # 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.
824 #
825 # 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.
826 #
827 # Example Policy with multiple AuditConfigs:
828 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700829 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700830 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700831 # 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 Kim65020912020-05-20 12:08:20 -0700832 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700833 { # Provides the configuration for logging a type of permissions. Example:
834 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700835 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700836 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700837 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
838 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
839 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700840 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700841 &quot;ignoreChildExemptions&quot;: True or False,
842 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700843 },
844 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700845 &quot;exemptedMembers&quot;: [
846 &quot;A String&quot;,
847 ],
848 &quot;service&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700849 },
850 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700851 &quot;bindings&quot;: [ # 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 -0700852 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700853 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700854 &quot;condition&quot;: { # 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.
855 #
856 # If the condition evaluates to `true`, then this binding applies to the current request.
857 #
858 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
859 #
860 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
861 #
862 # Example (Comparison):
863 #
864 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
865 #
866 # Example (Equality):
867 #
868 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
869 #
870 # Example (Logic):
871 #
872 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
873 #
874 # Example (Data Manipulation):
875 #
876 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
877 #
878 # 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.
879 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
880 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
881 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
882 &quot;title&quot;: &quot;A String&quot;, # 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.
883 },
884 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700885 #
886 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
887 #
888 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
889 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700890 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700891 #
892 #
893 #
894 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
895 #
896 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
897 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700898 # * `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.
899 #
900 # * `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.
901 #
902 # * `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.
903 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700904 #
905 #
906 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700907 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700908 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700909 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700910 },
911 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700912 &quot;etag&quot;: &quot;A String&quot;, # `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.
913 #
914 # **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.
915 &quot;iamOwned&quot;: True or False,
916 &quot;rules&quot;: [ # 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.
917 { # A rule to be applied in a Policy.
918 &quot;action&quot;: &quot;A String&quot;, # Required
919 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
920 { # A condition to be met.
921 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
922 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
923 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
924 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
925 &quot;values&quot;: [ # The objects of the condition.
926 &quot;A String&quot;,
927 ],
928 },
929 ],
930 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
931 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
932 &quot;A String&quot;,
933 ],
934 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
935 { # Specifies what kind of log the caller must write
936 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
937 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
938 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
939 },
940 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
941 },
942 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
943 #
944 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
945 #
946 # Field names correspond to IAM request parameters and field values are their respective values.
947 #
948 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
949 #
950 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
951 &quot;customFields&quot;: [ # Custom fields.
952 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
953 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
954 &quot;value&quot;: &quot;A String&quot;, # 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.
955 },
956 ],
957 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
958 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
959 },
960 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
961 &quot;logMode&quot;: &quot;A String&quot;,
962 },
963 },
964 ],
965 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
966 &quot;A String&quot;,
967 ],
968 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
969 &quot;A String&quot;,
970 ],
971 },
972 ],
973 &quot;version&quot;: 42, # Specifies the format of the policy.
974 #
975 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
976 #
977 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
978 #
979 # * 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
980 #
981 # **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.
982 #
983 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
984 #
985 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700986 }</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>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700991 <pre>Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700992
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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001000 #
1001 # 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 #
1005 # 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 #
1009 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
1010 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1011 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001012 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001013 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001014 # 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).
Dan O'Mearadd494642020-05-01 07:42:23 -07001015 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001016 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -07001017 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001018 # 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.
1019 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1020 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
1021 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1022 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1023 #
1024 # The key must meet the following requirements before you can provide it to Compute Engine:
1025 # - The key is wrapped using a RSA public key certificate provided by Google.
1026 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
1027 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1028 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1029 },
1030 &quot;eraseWindowsVssSignature&quot;: True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
1031 &quot;guestOsFeatures&quot;: [ # 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.
1032 { # Guest OS features.
1033 &quot;type&quot;: &quot;A String&quot;, # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001034 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001035 ],
1036 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001037 &quot;interface&quot;: &quot;A String&quot;, # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
Bu Sun Kim65020912020-05-20 12:08:20 -07001038 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
1039 &quot;labelFingerprint&quot;: &quot;A String&quot;, # 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.
1040 #
1041 # To see the latest fingerprint, make a get() request to retrieve a disk.
1042 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
1043 &quot;a_key&quot;: &quot;A String&quot;,
1044 },
1045 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
1046 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
1047 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
1048 &quot;A String&quot;,
1049 ],
1050 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
1051 &quot;A String&quot;,
1052 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001053 &quot;multiWriter&quot;: True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
Bu Sun Kim65020912020-05-20 12:08:20 -07001054 &quot;name&quot;: &quot;A String&quot;, # 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.
1055 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001056 &quot;physicalBlockSizeBytes&quot;: &quot;A String&quot;, # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, 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&#x27;s project.
Bu Sun Kim65020912020-05-20 12:08:20 -07001057 &quot;region&quot;: &quot;A String&quot;, # [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.
1058 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1059 &quot;A String&quot;,
1060 ],
1061 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
1062 &quot;A String&quot;,
1063 ],
1064 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001065 &quot;sizeGb&quot;: &quot;A String&quot;, # Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk.
Bu Sun Kim65020912020-05-20 12:08:20 -07001066 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001067 # If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are 1 to 65536, inclusive.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001068 &quot;sourceDisk&quot;: &quot;A String&quot;, # 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:
1069 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
1070 # - projects/project/zones/zone/disks/disk
1071 # - zones/zone/disks/disk
1072 &quot;sourceDiskId&quot;: &quot;A String&quot;, # [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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001073 &quot;sourceImage&quot;: &quot;A String&quot;, # The source image used to create this disk. If the source image is deleted, this field will not be set.
1074 #
1075 # 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:
1076 # projects/debian-cloud/global/images/family/debian-9
1077 #
1078 #
1079 # Alternatively, use a specific version of a public operating system image:
1080 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
1081 #
1082 #
1083 # To create a disk with a custom image that you created, specify the image name in the following format:
1084 # global/images/my-custom-image
1085 #
1086 #
1087 # 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:
1088 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001089 &quot;sourceImageEncryptionKey&quot;: { # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -07001090 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1091 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
1092 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1093 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1094 #
1095 # The key must meet the following requirements before you can provide it to Compute Engine:
1096 # - The key is wrapped using a RSA public key certificate provided by Google.
1097 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
1098 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1099 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1100 },
1101 &quot;sourceImageId&quot;: &quot;A String&quot;, # [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.
1102 &quot;sourceSnapshot&quot;: &quot;A String&quot;, # 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:
1103 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1104 # - projects/project/global/snapshots/snapshot
1105 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001106 &quot;sourceSnapshotEncryptionKey&quot;: { # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -07001107 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1108 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
1109 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1110 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1111 #
1112 # The key must meet the following requirements before you can provide it to Compute Engine:
1113 # - The key is wrapped using a RSA public key certificate provided by Google.
1114 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
1115 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1116 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1117 },
1118 &quot;sourceSnapshotId&quot;: &quot;A String&quot;, # [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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001119 &quot;sourceStorageObject&quot;: &quot;A String&quot;, # 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/.
Bu Sun Kim65020912020-05-20 12:08:20 -07001120 &quot;status&quot;: &quot;A String&quot;, # [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.
1121 &quot;storageType&quot;: &quot;A String&quot;, # [Deprecated] Storage type of the persistent disk.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001122 &quot;type&quot;: &quot;A String&quot;, # 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
Bu Sun Kim65020912020-05-20 12:08:20 -07001123 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1124 &quot;A String&quot;,
1125 ],
1126 &quot;zone&quot;: &quot;A String&quot;, # [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.
1127}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001128
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001129 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.
1130
1131For 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.
1132
1133The 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 -07001134 sourceImage: string, Optional. Source image to restore onto a disk.
1135
1136Returns:
1137 An object of the form:
1138
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001139 { # Represents an Operation resource.
1140 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001141 # Google Compute Engine has three Operation resources:
1142 #
1143 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1144 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001145 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1146 #
1147 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001148 # - For global operations, use the `globalOperations` resource.
1149 # - For regional operations, use the `regionOperations` resource.
1150 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001151 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001152 # 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 Kim65020912020-05-20 12:08:20 -07001153 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1154 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1155 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1156 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1157 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1158 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001159 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001160 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1161 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1162 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001163 },
1164 ],
1165 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001166 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
1167 &quot;httpErrorStatusCode&quot;: 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.
1168 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1169 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1170 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1171 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1172 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1173 &quot;progress&quot;: 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.
1174 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1175 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1176 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1177 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
1178 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1179 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1180 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
1181 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1182 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1183 {
1184 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1185 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1186 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1187 {
1188 &quot;key&quot;: &quot;A String&quot;, # [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).
1189 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1190 },
1191 ],
1192 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1193 },
1194 ],
1195 &quot;zone&quot;: &quot;A String&quot;, # [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 -07001196 }</pre>
1197</div>
1198
1199<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001200 <code class="details" id="list">list(project, zone, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001201 <pre>Retrieves a list of persistent disks contained within the specified zone.
1202
1203Args:
1204 project: string, Project ID for this request. (required)
1205 zone: string, The name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001206 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 -07001207
Dan O'Mearadd494642020-05-01 07:42:23 -07001208For 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 -07001209
Dan O'Mearadd494642020-05-01 07:42:23 -07001210You 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 -07001211
Bu Sun Kim65020912020-05-20 12:08:20 -07001212To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
1213 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`)
1214 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1215
1216You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. 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.
1217
1218Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1219 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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001220 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001221
1222Returns:
1223 An object of the form:
1224
1225 { # A list of Disk resources.
Bu Sun Kim65020912020-05-20 12:08:20 -07001226 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
1227 &quot;items&quot;: [ # A list of Disk resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001228 { # Represents a Persistent Disk resource.
Bu Sun Kim65020912020-05-20 12:08:20 -07001229 #
1230 # Google Compute Engine has two Disk resources:
1231 #
1232 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
1233 #
1234 # 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.
1235 #
1236 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
1237 #
1238 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
1239 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1240 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001241 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001242 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001243 # 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).
Dan O'Mearadd494642020-05-01 07:42:23 -07001244 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001245 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -07001246 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001247 # 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.
1248 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1249 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
1250 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1251 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001252 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001253 # The key must meet the following requirements before you can provide it to Compute Engine:
1254 # - The key is wrapped using a RSA public key certificate provided by Google.
1255 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
1256 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1257 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001258 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001259 &quot;eraseWindowsVssSignature&quot;: True or False, # Specifies whether the disk restored from a source snapshot should erase Windows specific VSS signature.
1260 &quot;guestOsFeatures&quot;: [ # 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.
1261 { # Guest OS features.
1262 &quot;type&quot;: &quot;A String&quot;, # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
1263 },
1264 ],
1265 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001266 &quot;interface&quot;: &quot;A String&quot;, # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
Bu Sun Kim65020912020-05-20 12:08:20 -07001267 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
1268 &quot;labelFingerprint&quot;: &quot;A String&quot;, # 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.
1269 #
1270 # To see the latest fingerprint, make a get() request to retrieve a disk.
1271 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
1272 &quot;a_key&quot;: &quot;A String&quot;,
1273 },
1274 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
1275 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
1276 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
1277 &quot;A String&quot;,
1278 ],
1279 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
1280 &quot;A String&quot;,
1281 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001282 &quot;multiWriter&quot;: True or False, # Indicates whether or not the disk can be read/write attached to more than one instance.
Bu Sun Kim65020912020-05-20 12:08:20 -07001283 &quot;name&quot;: &quot;A String&quot;, # 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.
1284 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001285 &quot;physicalBlockSizeBytes&quot;: &quot;A String&quot;, # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, 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&#x27;s project.
Bu Sun Kim65020912020-05-20 12:08:20 -07001286 &quot;region&quot;: &quot;A String&quot;, # [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.
1287 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1288 &quot;A String&quot;,
1289 ],
1290 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
1291 &quot;A String&quot;,
1292 ],
1293 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001294 &quot;sizeGb&quot;: &quot;A String&quot;, # Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk.
Bu Sun Kim65020912020-05-20 12:08:20 -07001295 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001296 # If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are 1 to 65536, inclusive.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001297 &quot;sourceDisk&quot;: &quot;A String&quot;, # 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:
1298 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
1299 # - projects/project/zones/zone/disks/disk
1300 # - zones/zone/disks/disk
1301 &quot;sourceDiskId&quot;: &quot;A String&quot;, # [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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001302 &quot;sourceImage&quot;: &quot;A String&quot;, # The source image used to create this disk. If the source image is deleted, this field will not be set.
1303 #
1304 # 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:
1305 # projects/debian-cloud/global/images/family/debian-9
1306 #
1307 #
1308 # Alternatively, use a specific version of a public operating system image:
1309 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
1310 #
1311 #
1312 # To create a disk with a custom image that you created, specify the image name in the following format:
1313 # global/images/my-custom-image
1314 #
1315 #
1316 # 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:
1317 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001318 &quot;sourceImageEncryptionKey&quot;: { # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -07001319 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1320 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
1321 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1322 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1323 #
1324 # The key must meet the following requirements before you can provide it to Compute Engine:
1325 # - The key is wrapped using a RSA public key certificate provided by Google.
1326 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
1327 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1328 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1329 },
1330 &quot;sourceImageId&quot;: &quot;A String&quot;, # [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.
1331 &quot;sourceSnapshot&quot;: &quot;A String&quot;, # 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:
1332 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1333 # - projects/project/global/snapshots/snapshot
1334 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001335 &quot;sourceSnapshotEncryptionKey&quot;: { # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -07001336 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1337 &quot;kmsKeyServiceAccount&quot;: &quot;A String&quot;, # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
1338 &quot;rawKey&quot;: &quot;A String&quot;, # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1339 &quot;rsaEncryptedKey&quot;: &quot;A String&quot;, # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
1340 #
1341 # The key must meet the following requirements before you can provide it to Compute Engine:
1342 # - The key is wrapped using a RSA public key certificate provided by Google.
1343 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at:
1344 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
1345 &quot;sha256&quot;: &quot;A String&quot;, # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1346 },
1347 &quot;sourceSnapshotId&quot;: &quot;A String&quot;, # [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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001348 &quot;sourceStorageObject&quot;: &quot;A String&quot;, # 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/.
Bu Sun Kim65020912020-05-20 12:08:20 -07001349 &quot;status&quot;: &quot;A String&quot;, # [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.
1350 &quot;storageType&quot;: &quot;A String&quot;, # [Deprecated] Storage type of the persistent disk.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001351 &quot;type&quot;: &quot;A String&quot;, # 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
Bu Sun Kim65020912020-05-20 12:08:20 -07001352 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1353 &quot;A String&quot;,
1354 ],
1355 &quot;zone&quot;: &quot;A String&quot;, # [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.
1356 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001357 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001358 &quot;kind&quot;: &quot;compute#diskList&quot;, # [Output Only] Type of resource. Always compute#diskList for lists of disks.
1359 &quot;nextPageToken&quot;: &quot;A String&quot;, # [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.
1360 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
1361 &quot;warning&quot;: { # [Output Only] Informational warning message.
1362 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1363 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1364 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001365 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001366 &quot;key&quot;: &quot;A String&quot;, # [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).
1367 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001368 },
1369 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001370 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001371 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001372 }</pre>
1373</div>
1374
1375<div class="method">
1376 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1377 <pre>Retrieves the next page of results.
1378
1379Args:
1380 previous_request: The request for the previous page. (required)
1381 previous_response: The response from the request for the previous page. (required)
1382
1383Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -07001384 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001385 page. Returns None if there are no more items in the collection.
1386 </pre>
1387</div>
1388
1389<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001390 <code class="details" id="removeResourcePolicies">removeResourcePolicies(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001391 <pre>Removes resource policies from a disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001392
1393Args:
1394 project: string, Project ID for this request. (required)
1395 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001396 disk: string, The disk name for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001397 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001398 The object takes the form of:
1399
1400{
Bu Sun Kim65020912020-05-20 12:08:20 -07001401 &quot;resourcePolicies&quot;: [ # Resource policies to be removed from this disk.
1402 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001403 ],
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001404 }
1405
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001406 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.
1407
1408For 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.
1409
1410The 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 -07001411
1412Returns:
1413 An object of the form:
1414
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001415 { # Represents an Operation resource.
1416 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001417 # Google Compute Engine has three Operation resources:
1418 #
1419 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1420 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001421 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1422 #
1423 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001424 # - For global operations, use the `globalOperations` resource.
1425 # - For regional operations, use the `regionOperations` resource.
1426 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001427 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001428 # 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 Kim65020912020-05-20 12:08:20 -07001429 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1430 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1431 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1432 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1433 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1434 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001435 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001436 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1437 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1438 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001439 },
1440 ],
1441 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001442 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
1443 &quot;httpErrorStatusCode&quot;: 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.
1444 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1445 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1446 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1447 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1448 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1449 &quot;progress&quot;: 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.
1450 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1451 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1452 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1453 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
1454 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1455 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1456 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
1457 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1458 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1459 {
1460 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1461 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1462 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1463 {
1464 &quot;key&quot;: &quot;A String&quot;, # [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).
1465 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1466 },
1467 ],
1468 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1469 },
1470 ],
1471 &quot;zone&quot;: &quot;A String&quot;, # [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 -07001472 }</pre>
1473</div>
1474
1475<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001476 <code class="details" id="resize">resize(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001477 <pre>Resizes the specified persistent disk. You can only increase the size of the disk.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001478
1479Args:
1480 project: string, Project ID for this request. (required)
1481 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001482 disk: string, The name of the persistent disk. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001483 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001484 The object takes the form of:
1485
1486{
Bu Sun Kim65020912020-05-20 12:08:20 -07001487 &quot;sizeGb&quot;: &quot;A String&quot;, # The new size of the persistent disk, which is specified in GB.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001488 }
1489
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001490 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.
1491
1492For 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.
1493
1494The 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 -07001495
1496Returns:
1497 An object of the form:
1498
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001499 { # Represents an Operation resource.
1500 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001501 # Google Compute Engine has three Operation resources:
1502 #
1503 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1504 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001505 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1506 #
1507 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001508 # - For global operations, use the `globalOperations` resource.
1509 # - For regional operations, use the `regionOperations` resource.
1510 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001511 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001512 # 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 Kim65020912020-05-20 12:08:20 -07001513 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1514 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1515 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1516 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1517 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1518 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001519 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001520 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1521 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1522 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001523 },
1524 ],
1525 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001526 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
1527 &quot;httpErrorStatusCode&quot;: 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.
1528 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1529 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1530 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1531 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1532 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1533 &quot;progress&quot;: 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.
1534 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1535 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1536 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1537 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
1538 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1539 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1540 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
1541 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1542 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1543 {
1544 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1545 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1546 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1547 {
1548 &quot;key&quot;: &quot;A String&quot;, # [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).
1549 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1550 },
1551 ],
1552 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1553 },
1554 ],
1555 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001556 }</pre>
1557</div>
1558
1559<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001560 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001561 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1562
1563Args:
1564 project: string, Project ID for this request. (required)
1565 zone: string, The name of the zone for this request. (required)
1566 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001567 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001568 The object takes the form of:
1569
1570{
Bu Sun Kim65020912020-05-20 12:08:20 -07001571 &quot;bindings&quot;: [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
1572 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001573 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001574 &quot;condition&quot;: { # 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.
1575 #
1576 # If the condition evaluates to `true`, then this binding applies to the current request.
1577 #
1578 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
1579 #
1580 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1581 #
1582 # Example (Comparison):
1583 #
1584 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
1585 #
1586 # Example (Equality):
1587 #
1588 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
1589 #
1590 # Example (Logic):
1591 #
1592 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1593 #
1594 # Example (Data Manipulation):
1595 #
1596 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1597 #
1598 # 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.
1599 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1600 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1601 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1602 &quot;title&quot;: &quot;A String&quot;, # 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.
1603 },
1604 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1605 #
1606 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1607 #
1608 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1609 #
1610 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1611 #
1612 #
1613 #
1614 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1615 #
1616 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1617 #
1618 # * `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.
1619 #
1620 # * `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.
1621 #
1622 # * `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.
1623 #
1624 #
1625 #
1626 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1627 &quot;A String&quot;,
1628 ],
1629 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1630 },
1631 ],
1632 &quot;etag&quot;: &quot;A String&quot;, # Flatten Policy to create a backward compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify the etag.
1633 &quot;policy&quot;: { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. # REQUIRED: The complete policy to be applied to the &#x27;resource&#x27;. 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001634 #
1635 #
1636 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001637 # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001638 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001639 # For some types of Google Cloud resources, a `binding` can also 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001640 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001641 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001642 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001643 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001644 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001645 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001646 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001647 # 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(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001648 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001649 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -07001650 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001651 { # 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.
1652 #
1653 # 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.
1654 #
1655 # Example Policy with multiple AuditConfigs:
1656 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001657 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001658 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001659 # 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 Kim65020912020-05-20 12:08:20 -07001660 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001661 { # Provides the configuration for logging a type of permissions. Example:
1662 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001663 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001664 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001665 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1666 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1667 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001668 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001669 &quot;ignoreChildExemptions&quot;: True or False,
1670 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001671 },
1672 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001673 &quot;exemptedMembers&quot;: [
1674 &quot;A String&quot;,
1675 ],
1676 &quot;service&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001677 },
1678 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001679 &quot;bindings&quot;: [ # 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 -07001680 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001681 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001682 &quot;condition&quot;: { # 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.
1683 #
1684 # If the condition evaluates to `true`, then this binding applies to the current request.
1685 #
1686 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
1687 #
1688 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1689 #
1690 # Example (Comparison):
1691 #
1692 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
1693 #
1694 # Example (Equality):
1695 #
1696 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
1697 #
1698 # Example (Logic):
1699 #
1700 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1701 #
1702 # Example (Data Manipulation):
1703 #
1704 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1705 #
1706 # 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.
1707 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1708 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1709 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1710 &quot;title&quot;: &quot;A String&quot;, # 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.
1711 },
1712 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001713 #
1714 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1715 #
1716 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1717 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001718 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001719 #
1720 #
1721 #
1722 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1723 #
1724 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1725 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001726 # * `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.
1727 #
1728 # * `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.
1729 #
1730 # * `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.
1731 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001732 #
1733 #
1734 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001735 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001736 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001737 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001738 },
1739 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001740 &quot;etag&quot;: &quot;A String&quot;, # `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.
1741 #
1742 # **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.
1743 &quot;iamOwned&quot;: True or False,
1744 &quot;rules&quot;: [ # 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.
1745 { # A rule to be applied in a Policy.
1746 &quot;action&quot;: &quot;A String&quot;, # Required
1747 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1748 { # A condition to be met.
1749 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1750 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1751 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1752 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1753 &quot;values&quot;: [ # The objects of the condition.
1754 &quot;A String&quot;,
1755 ],
1756 },
1757 ],
1758 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1759 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1760 &quot;A String&quot;,
1761 ],
1762 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1763 { # Specifies what kind of log the caller must write
1764 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1765 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1766 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1767 },
1768 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1769 },
1770 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1771 #
1772 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
1773 #
1774 # Field names correspond to IAM request parameters and field values are their respective values.
1775 #
1776 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
1777 #
1778 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
1779 &quot;customFields&quot;: [ # Custom fields.
1780 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1781 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1782 &quot;value&quot;: &quot;A String&quot;, # 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.
1783 },
1784 ],
1785 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1786 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1787 },
1788 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1789 &quot;logMode&quot;: &quot;A String&quot;,
1790 },
1791 },
1792 ],
1793 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1794 &quot;A String&quot;,
1795 ],
1796 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
1797 &quot;A String&quot;,
1798 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001799 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001800 ],
1801 &quot;version&quot;: 42, # Specifies the format of the policy.
1802 #
1803 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1804 #
1805 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1806 #
1807 # * 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
1808 #
1809 # **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.
1810 #
1811 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1812 #
1813 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1814 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001815 }
1816
1817
1818Returns:
1819 An object of the form:
1820
Dan O'Mearadd494642020-05-01 07:42:23 -07001821 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001822 #
1823 #
1824 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001825 # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001826 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001827 # For some types of Google Cloud resources, a `binding` can also 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001828 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001829 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001830 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001831 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001832 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001833 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001834 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001835 # 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(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001836 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001837 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -07001838 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001839 { # 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.
1840 #
1841 # 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.
1842 #
1843 # Example Policy with multiple AuditConfigs:
1844 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001845 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001846 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001847 # 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 Kim65020912020-05-20 12:08:20 -07001848 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001849 { # Provides the configuration for logging a type of permissions. Example:
1850 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001851 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001852 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001853 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1854 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1855 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001856 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001857 &quot;ignoreChildExemptions&quot;: True or False,
1858 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001859 },
1860 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001861 &quot;exemptedMembers&quot;: [
1862 &quot;A String&quot;,
1863 ],
1864 &quot;service&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001865 },
1866 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001867 &quot;bindings&quot;: [ # 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 -07001868 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001869 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001870 &quot;condition&quot;: { # 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.
1871 #
1872 # If the condition evaluates to `true`, then this binding applies to the current request.
1873 #
1874 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
1875 #
1876 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1877 #
1878 # Example (Comparison):
1879 #
1880 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
1881 #
1882 # Example (Equality):
1883 #
1884 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
1885 #
1886 # Example (Logic):
1887 #
1888 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1889 #
1890 # Example (Data Manipulation):
1891 #
1892 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1893 #
1894 # 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.
1895 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1896 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1897 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1898 &quot;title&quot;: &quot;A String&quot;, # 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.
1899 },
1900 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001901 #
1902 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1903 #
1904 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1905 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001906 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001907 #
1908 #
1909 #
1910 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1911 #
1912 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1913 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001914 # * `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.
1915 #
1916 # * `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.
1917 #
1918 # * `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.
1919 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001920 #
1921 #
1922 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001923 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001924 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001925 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001926 },
1927 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001928 &quot;etag&quot;: &quot;A String&quot;, # `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.
1929 #
1930 # **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.
1931 &quot;iamOwned&quot;: True or False,
1932 &quot;rules&quot;: [ # 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.
1933 { # A rule to be applied in a Policy.
1934 &quot;action&quot;: &quot;A String&quot;, # Required
1935 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1936 { # A condition to be met.
1937 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1938 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1939 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1940 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1941 &quot;values&quot;: [ # The objects of the condition.
1942 &quot;A String&quot;,
1943 ],
1944 },
1945 ],
1946 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1947 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1948 &quot;A String&quot;,
1949 ],
1950 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1951 { # Specifies what kind of log the caller must write
1952 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1953 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1954 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1955 },
1956 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1957 },
1958 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1959 #
1960 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
1961 #
1962 # Field names correspond to IAM request parameters and field values are their respective values.
1963 #
1964 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
1965 #
1966 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
1967 &quot;customFields&quot;: [ # Custom fields.
1968 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1969 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1970 &quot;value&quot;: &quot;A String&quot;, # 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.
1971 },
1972 ],
1973 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1974 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1975 },
1976 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1977 &quot;logMode&quot;: &quot;A String&quot;,
1978 },
1979 },
1980 ],
1981 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1982 &quot;A String&quot;,
1983 ],
1984 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
1985 &quot;A String&quot;,
1986 ],
1987 },
1988 ],
1989 &quot;version&quot;: 42, # Specifies the format of the policy.
1990 #
1991 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1992 #
1993 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1994 #
1995 # * 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
1996 #
1997 # **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.
1998 #
1999 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
2000 #
2001 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002002 }</pre>
2003</div>
2004
2005<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002006 <code class="details" id="setLabels">setLabels(project, zone, resource, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002007 <pre>Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
2008
2009Args:
2010 project: string, Project ID for this request. (required)
2011 zone: string, The name of the zone for this request. (required)
2012 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002013 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002014 The object takes the form of:
2015
2016{
Bu Sun Kim65020912020-05-20 12:08:20 -07002017 &quot;labelFingerprint&quot;: &quot;A String&quot;, # 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.
2018 &quot;labels&quot;: { # The labels to set for this resource.
2019 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002020 },
2021 }
2022
2023 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.
2024
2025For 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.
2026
2027The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
2028
2029Returns:
2030 An object of the form:
2031
2032 { # Represents an Operation resource.
2033 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002034 # Google Compute Engine has three Operation resources:
2035 #
2036 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
2037 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002038 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
2039 #
2040 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07002041 # - For global operations, use the `globalOperations` resource.
2042 # - For regional operations, use the `regionOperations` resource.
2043 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002044 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002045 # 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 Kim65020912020-05-20 12:08:20 -07002046 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
2047 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
2048 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
2049 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2050 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2051 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002052 {
Bu Sun Kim65020912020-05-20 12:08:20 -07002053 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
2054 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2055 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002056 },
2057 ],
2058 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002059 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
2060 &quot;httpErrorStatusCode&quot;: 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.
2061 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
2062 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2063 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2064 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
2065 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2066 &quot;progress&quot;: 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.
2067 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
2068 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
2069 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
2070 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
2071 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
2072 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2073 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
2074 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
2075 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2076 {
2077 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
2078 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
2079 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
2080 {
2081 &quot;key&quot;: &quot;A String&quot;, # [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).
2082 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
2083 },
2084 ],
2085 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
2086 },
2087 ],
2088 &quot;zone&quot;: &quot;A String&quot;, # [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 -07002089 }</pre>
2090</div>
2091
2092<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002093 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002094 <pre>Returns permissions that a caller has on the specified resource.
2095
2096Args:
2097 project: string, Project ID for this request. (required)
2098 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002099 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002100 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002101 The object takes the form of:
2102
2103{
Bu Sun Kim65020912020-05-20 12:08:20 -07002104 &quot;permissions&quot;: [ # The set of permissions to check for the &#x27;resource&#x27;. Permissions with wildcards (such as &#x27;*&#x27; or &#x27;storage.*&#x27;) are not allowed.
2105 &quot;A String&quot;,
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002106 ],
2107 }
2108
2109
2110Returns:
2111 An object of the form:
2112
2113 {
Bu Sun Kim65020912020-05-20 12:08:20 -07002114 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2115 &quot;A String&quot;,
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002116 ],
2117 }</pre>
2118</div>
2119
2120</body></html>