blob: 8fa8b1186fbb7127b7d0ff8956e8518d6390d792 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_v1.html">Compute Engine API</a> . <a href="compute_v1.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>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080082<p class="firstline">Retrieves an aggregated list of persistent disks.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<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>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080091<p class="firstline">Creates a snapshot of a specified persistent disk.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<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>
Takashi Matsuo06694102015-09-11 13:55:40 -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>
John Asmuth614db982014-04-24 15:46:26 -040095<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>
John Asmuth614db982014-04-24 15:46:26 -040098<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -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>
John Asmuth614db982014-04-24 15:46:26 -0400104<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>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800106<p class="firstline">Retrieves a list of persistent disks contained within the specified zone.</p>
John Asmuth614db982014-04-24 15:46:26 -0400107<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>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700110<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 Cheemalapati4ba8c232017-06-06 18:46:08 -0400113<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>
122<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>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
John Asmuth614db982014-04-24 15:46:26 -0400125<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{
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800138 &quot;resourcePolicies&quot;: [ # Resource policies to be added to this disk. Currently you can only specify one policy here.
139 &quot;A String&quot;,
140 ],
141}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142
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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800153 #
154 # 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 #
158 # 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.
161 # - For global operations, use the `globalOperations` resource.
162 # - For regional operations, use the `regionOperations` resource.
163 # - For zonal operations, use the `zonalOperations` resource.
164 #
165 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
166 &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 Kim65020912020-05-20 12:08:20 -0700172 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800173 &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 Kim65020912020-05-20 12:08:20 -0700176 },
177 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800178 },
179 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800185 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800186 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
187 &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.
188 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
189 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
190 &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.
191 &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`.
192 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
193 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
194 &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.
195 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
196 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
197 {
198 &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.
199 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
200 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
201 {
202 &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).
203 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
204 },
205 ],
206 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
207 },
208 ],
209 &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.
210}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700211</div>
212
213<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700214 <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800215 <pre>Retrieves an aggregated list of persistent disks.
John Asmuth614db982014-04-24 15:46:26 -0400216
217Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000218 project: string, Project ID for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700219 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;`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700220
Dan O'Mearadd494642020-05-01 07:42:23 -0700221For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700222
Dan O'Mearadd494642020-05-01 07:42:23 -0700223You 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800224
Bu Sun Kim65020912020-05-20 12:08:20 -0700225To 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 -0700226 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 -0700227 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`)
228 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
229
230You 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.
231
232Currently, only sorting by `name` or `creationTimestamp desc` is supported.
233 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800234 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
John Asmuth614db982014-04-24 15:46:26 -0400235
236Returns:
237 An object of the form:
238
239 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800240 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
241 &quot;items&quot;: { # A list of DisksScopedList resources.
242 &quot;a_key&quot;: { # [Output Only] Name of the scope containing this set of disks.
243 &quot;disks&quot;: [ # [Output Only] A list of disks contained in this scope.
244 { # Represents a Persistent Disk resource.
245 #
246 # Google Compute Engine has two Disk resources:
247 #
248 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
249 #
250 # 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.
251 #
252 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
253 #
254 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
255 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
256 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
257 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700258 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800259 # 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).
Bu Sun Kim65020912020-05-20 12:08:20 -0700260 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800261 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Bu Sun Kim65020912020-05-20 12:08:20 -0700262 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800263 # 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.
264 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
265 &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.
266 &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.
267 &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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700268 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800269 &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.
270 { # Guest OS features.
271 &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.
John Asmuth614db982014-04-24 15:46:26 -0400272 },
273 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800274 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
275 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
276 &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.
277 #
278 # To see the latest fingerprint, make a get() request to retrieve a disk.
279 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
280 &quot;a_key&quot;: &quot;A String&quot;,
281 },
282 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
283 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
284 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
285 &quot;A String&quot;,
286 ],
287 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
288 &quot;A String&quot;,
289 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800290 &quot;locationHint&quot;: &quot;A String&quot;, # An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800291 &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.
292 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
293 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800294 &quot;provisionedIops&quot;: &quot;A String&quot;, # Indicates how many IOPS must be provisioned for the disk.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800295 &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.
296 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
297 &quot;A String&quot;,
298 ],
299 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
300 &quot;A String&quot;,
301 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800302 &quot;satisfiesPzs&quot;: True or False, # [Output Only] Reserved for future use.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800303 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
304 &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.
305 #
306 # 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.
307 &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:
308 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800309 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800310 # - projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800311 # - projects/project/regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800312 # - zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800313 # - regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800314 &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.
315 &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.
316 #
317 # 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:
318 # projects/debian-cloud/global/images/family/debian-9
319 #
320 #
321 # Alternatively, use a specific version of a public operating system image:
322 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
323 #
324 #
325 # To create a disk with a custom image that you created, specify the image name in the following format:
326 # global/images/my-custom-image
327 #
328 #
329 # 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:
330 # global/images/family/my-image-family
331 &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.
332 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
333 &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.
334 &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.
335 &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.
336 },
337 &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.
338 &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:
339 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
340 # - projects/project/global/snapshots/snapshot
341 # - global/snapshots/snapshot
342 &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.
343 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
344 &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.
345 &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.
346 &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.
347 },
348 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800349 &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/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
350 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of disk creation.
351 # - CREATING: Disk is provisioning.
352 # - RESTORING: Source data is being copied into the disk.
353 # - FAILED: Disk creation failed.
354 # - READY: Disk is ready for use.
355 # - DELETING: Disk is deleting.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800356 &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
357 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
358 &quot;A String&quot;,
359 ],
360 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700361 },
362 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800363 &quot;warning&quot;: { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
364 &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.
365 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
366 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
367 {
368 &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).
369 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
370 },
371 ],
372 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
373 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700374 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800375 },
376 &quot;kind&quot;: &quot;compute#diskAggregatedList&quot;, # [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.
377 &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.
378 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
379 &quot;unreachables&quot;: [ # [Output Only] Unreachable resources.
380 &quot;A String&quot;,
381 ],
382 &quot;warning&quot;: { # [Output Only] Informational warning message.
383 &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.
384 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
385 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
386 {
387 &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).
388 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
389 },
390 ],
391 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
392 },
393}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400394</div>
395
396<div class="method">
397 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
398 <pre>Retrieves the next page of results.
399
400Args:
401 previous_request: The request for the previous page. (required)
402 previous_response: The response from the request for the previous page. (required)
403
404Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700405 A request object that you can call &#x27;execute()&#x27; on to request the next
John Asmuth614db982014-04-24 15:46:26 -0400406 page. Returns None if there are no more items in the collection.
407 </pre>
408</div>
409
410<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700411 <code class="details" id="close">close()</code>
412 <pre>Close httplib2 connections.</pre>
413</div>
414
415<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700416 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body=None, guestFlush=None, requestId=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800417 <pre>Creates a snapshot of a specified persistent disk.
John Asmuth614db982014-04-24 15:46:26 -0400418
419Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000420 project: string, Project ID for this request. (required)
421 zone: string, The name of the zone for this request. (required)
422 disk: string, Name of the persistent disk to snapshot. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700423 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400424 The object takes the form of:
425
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700426{ # Represents a Persistent Disk Snapshot resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800427 #
428 # 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 ==)
429 &quot;autoCreated&quot;: True or False, # [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk.
430 &quot;chainName&quot;: &quot;A String&quot;, # Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value.
431 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
432 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
433 &quot;diskSizeGb&quot;: &quot;A String&quot;, # [Output Only] Size of the source disk, specified in GB.
434 &quot;downloadBytes&quot;: &quot;A String&quot;, # [Output Only] Number of bytes downloaded to restore a snapshot to a disk.
435 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
436 &quot;kind&quot;: &quot;compute#snapshot&quot;, # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
437 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700438 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800439 # To see the latest fingerprint, make a get() request to retrieve a snapshot.
440 &quot;labels&quot;: { # Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.
441 &quot;a_key&quot;: &quot;A String&quot;,
442 },
443 &quot;licenseCodes&quot;: [ # [Output Only] Integer license codes indicating which licenses are attached to this snapshot.
444 &quot;A String&quot;,
445 ],
446 &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).
447 &quot;A String&quot;,
448 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800449 &quot;locationHint&quot;: &quot;A String&quot;, # An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800450 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800451 &quot;satisfiesPzs&quot;: True or False, # [Output Only] Reserved for future use.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800452 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
453 &quot;snapshotEncryptionKey&quot;: { # Encrypts the snapshot using a customer-supplied encryption key.
454 #
455 # 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.
456 #
457 # Customer-supplied encryption keys do not protect access to metadata of the snapshot.
458 #
459 # 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.
460 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
461 &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.
462 &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.
463 &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.
464 },
465 &quot;sourceDisk&quot;: &quot;A String&quot;, # The source disk used to create this snapshot.
466 &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.
467 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
468 &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.
469 &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.
470 &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.
471 },
472 &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.
473 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.
474 &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.
475 &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.
476 &quot;storageLocations&quot;: [ # Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
477 &quot;A String&quot;,
478 ],
479}
John Asmuth614db982014-04-24 15:46:26 -0400480
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700481 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 -0700482 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.
483
484For 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.
485
486The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
John Asmuth614db982014-04-24 15:46:26 -0400487
488Returns:
489 An object of the form:
490
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700491 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800492 #
493 # Google Compute Engine has three Operation resources:
494 #
495 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
496 #
497 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
498 #
499 # Operations can be global, regional or zonal.
500 # - For global operations, use the `globalOperations` resource.
501 # - For regional operations, use the `regionOperations` resource.
502 # - For zonal operations, use the `zonalOperations` resource.
503 #
504 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
505 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
506 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
507 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
508 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
509 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
510 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700511 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800512 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
513 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
514 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700515 },
516 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800517 },
518 &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`.
519 &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.
520 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
521 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
522 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
523 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800524 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800525 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
526 &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.
527 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
528 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
529 &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.
530 &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`.
531 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
532 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
533 &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.
534 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
535 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
536 {
537 &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.
538 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
539 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
540 {
541 &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).
542 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
543 },
544 ],
545 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
546 },
547 ],
548 &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.
549}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400550</div>
551
552<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700553 <code class="details" id="delete">delete(project, zone, disk, requestId=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700554 <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.
John Asmuth614db982014-04-24 15:46:26 -0400555
556Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000557 project: string, Project ID for this request. (required)
558 zone: string, The name of the zone for this request. (required)
559 disk: string, Name of the persistent disk to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700560 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.
561
562For 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.
563
564The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
John Asmuth614db982014-04-24 15:46:26 -0400565
566Returns:
567 An object of the form:
568
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700569 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800570 #
571 # Google Compute Engine has three Operation resources:
572 #
573 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
574 #
575 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
576 #
577 # Operations can be global, regional or zonal.
578 # - For global operations, use the `globalOperations` resource.
579 # - For regional operations, use the `regionOperations` resource.
580 # - For zonal operations, use the `zonalOperations` resource.
581 #
582 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
583 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
584 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
585 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
586 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
587 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
588 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700589 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800590 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
591 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
592 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700593 },
594 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800595 },
596 &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`.
597 &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.
598 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
599 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
600 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
601 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800602 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800603 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
604 &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.
605 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
606 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
607 &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.
608 &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`.
609 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
610 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
611 &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.
612 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
613 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
614 {
615 &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.
616 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
617 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
618 {
619 &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).
620 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
621 },
622 ],
623 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
624 },
625 ],
626 &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.
627}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400628</div>
629
630<div class="method">
631 <code class="details" id="get">get(project, zone, disk)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700632 <pre>Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.
John Asmuth614db982014-04-24 15:46:26 -0400633
634Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000635 project: string, Project ID for this request. (required)
636 zone: string, The name of the zone for this request. (required)
637 disk: string, Name of the persistent disk to return. (required)
John Asmuth614db982014-04-24 15:46:26 -0400638
639Returns:
640 An object of the form:
641
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700642 { # Represents a Persistent Disk resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800643 #
644 # Google Compute Engine has two Disk resources:
645 #
646 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
647 #
648 # 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.
649 #
650 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
651 #
652 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
653 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
654 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
655 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700656 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800657 # 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).
Bu Sun Kim65020912020-05-20 12:08:20 -0700658 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800659 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Bu Sun Kim65020912020-05-20 12:08:20 -0700660 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800661 # 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.
662 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
663 &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.
664 &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.
665 &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.
666 },
667 &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.
668 { # Guest OS features.
669 &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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700670 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800671 ],
672 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
673 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
674 &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.
675 #
676 # To see the latest fingerprint, make a get() request to retrieve a disk.
677 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
678 &quot;a_key&quot;: &quot;A String&quot;,
679 },
680 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
681 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
682 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
683 &quot;A String&quot;,
684 ],
685 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
686 &quot;A String&quot;,
687 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800688 &quot;locationHint&quot;: &quot;A String&quot;, # An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800689 &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.
690 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
691 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800692 &quot;provisionedIops&quot;: &quot;A String&quot;, # Indicates how many IOPS must be provisioned for the disk.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800693 &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.
694 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
695 &quot;A String&quot;,
696 ],
697 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
698 &quot;A String&quot;,
699 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800700 &quot;satisfiesPzs&quot;: True or False, # [Output Only] Reserved for future use.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800701 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
702 &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.
703 #
704 # 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.
705 &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:
706 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800707 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800708 # - projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800709 # - projects/project/regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800710 # - zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800711 # - regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800712 &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.
713 &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.
714 #
715 # 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:
716 # projects/debian-cloud/global/images/family/debian-9
717 #
718 #
719 # Alternatively, use a specific version of a public operating system image:
720 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
721 #
722 #
723 # To create a disk with a custom image that you created, specify the image name in the following format:
724 # global/images/my-custom-image
725 #
726 #
727 # 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:
728 # global/images/family/my-image-family
729 &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.
730 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
731 &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.
732 &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.
733 &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.
734 },
735 &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.
736 &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:
737 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
738 # - projects/project/global/snapshots/snapshot
739 # - global/snapshots/snapshot
740 &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.
741 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
742 &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.
743 &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.
744 &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.
745 },
746 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800747 &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/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
748 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of disk creation.
749 # - CREATING: Disk is provisioning.
750 # - RESTORING: Source data is being copied into the disk.
751 # - FAILED: Disk creation failed.
752 # - READY: Disk is ready for use.
753 # - DELETING: Disk is deleting.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800754 &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
755 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
756 &quot;A String&quot;,
757 ],
758 &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.
759}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400760</div>
761
762<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700763 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource, optionsRequestedPolicyVersion=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700764 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
765
766Args:
767 project: string, Project ID for this request. (required)
768 zone: string, The name of the zone for this request. (required)
769 resource: string, Name or id of the resource for this request. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700770 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700771
772Returns:
773 An object of the form:
774
Dan O'Mearadd494642020-05-01 07:42:23 -0700775 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800776 #
777 #
778 #
779 # 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.
780 #
781 # 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).
782 #
783 # **JSON example:**
784 #
785 # { &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 }
786 #
787 # **YAML example:**
788 #
789 # 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
790 #
791 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
792 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
793 { # 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.
794 #
795 # 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.
796 #
797 # Example Policy with multiple AuditConfigs:
798 #
799 # { &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; ] } ] } ] }
800 #
801 # 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.
802 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
803 { # Provides the configuration for logging a type of permissions. Example:
Bu Sun Kim65020912020-05-20 12:08:20 -0700804 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800805 # { &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 Kim65020912020-05-20 12:08:20 -0700806 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800807 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
808 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
809 &quot;A String&quot;,
810 ],
811 &quot;ignoreChildExemptions&quot;: True or False,
812 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim65020912020-05-20 12:08:20 -0700813 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800814 ],
815 &quot;exemptedMembers&quot;: [
816 &quot;A String&quot;,
817 ],
818 &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.
819 },
820 ],
821 &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.
822 { # Associates `members` with a `role`.
823 &quot;bindingId&quot;: &quot;A String&quot;,
824 &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.
825 #
826 # If the condition evaluates to `true`, then this binding applies to the current request.
827 #
828 # 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.
829 #
830 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
831 #
832 # Example (Comparison):
833 #
834 # 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;
835 #
836 # Example (Equality):
837 #
838 # 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;
839 #
840 # Example (Logic):
841 #
842 # 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;
843 #
844 # Example (Data Manipulation):
845 #
846 # 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;
847 #
848 # 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.
849 &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.
850 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
851 &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.
852 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700853 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800854 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
855 #
856 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
857 #
858 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
859 #
860 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
861 #
862 #
863 #
864 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
865 #
866 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
867 #
868 # * `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.
869 #
870 # * `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.
871 #
872 # * `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.
873 #
874 #
875 #
876 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
877 &quot;A String&quot;,
878 ],
879 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
880 },
881 ],
882 &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.
883 #
884 # **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.
885 &quot;iamOwned&quot;: True or False,
886 &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.
887 { # A rule to be applied in a Policy.
888 &quot;action&quot;: &quot;A String&quot;, # Required
889 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
890 { # A condition to be met.
891 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
892 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
893 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
894 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
895 &quot;values&quot;: [ # The objects of the condition.
896 &quot;A String&quot;,
897 ],
898 },
899 ],
900 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
901 &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.
902 &quot;A String&quot;,
903 ],
904 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
905 { # Specifies what kind of log the caller must write
906 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
907 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
908 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
909 },
910 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
Bu Sun Kim65020912020-05-20 12:08:20 -0700911 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800912 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
913 #
914 # 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.
915 #
916 # Field names correspond to IAM request parameters and field values are their respective values.
917 #
918 # 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.
919 #
920 # 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]}
921 &quot;customFields&quot;: [ # Custom fields.
922 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
923 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
924 &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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700925 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800926 ],
927 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
928 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
Bu Sun Kim65020912020-05-20 12:08:20 -0700929 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800930 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
931 &quot;logMode&quot;: &quot;A String&quot;,
932 },
933 },
934 ],
935 &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.
936 &quot;A String&quot;,
937 ],
938 &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.
939 &quot;A String&quot;,
940 ],
941 },
942 ],
943 &quot;version&quot;: 42, # Specifies the format of the policy.
944 #
945 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
946 #
947 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
948 #
949 # * 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
950 #
951 # **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.
952 #
953 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
954 #
955 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
956}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700957</div>
958
959<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700960 <code class="details" id="insert">insert(project, zone, body=None, requestId=None, sourceImage=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700961 <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.
John Asmuth614db982014-04-24 15:46:26 -0400962
963Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000964 project: string, Project ID for this request. (required)
965 zone: string, The name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700966 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400967 The object takes the form of:
968
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700969{ # Represents a Persistent Disk resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700970 #
971 # Google Compute Engine has two Disk resources:
972 #
973 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
974 #
975 # 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.
976 #
977 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
978 #
979 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
980 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
981 &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 -0700982 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700983 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700984 # 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 -0700985 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700986 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -0700987 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700988 # 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.
989 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
990 &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.
991 &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.
992 &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.
993 },
994 &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.
995 { # Guest OS features.
996 &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.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700997 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700998 ],
999 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1000 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
1001 &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.
1002 #
1003 # To see the latest fingerprint, make a get() request to retrieve a disk.
1004 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
1005 &quot;a_key&quot;: &quot;A String&quot;,
1006 },
1007 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
1008 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
1009 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
1010 &quot;A String&quot;,
1011 ],
1012 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
1013 &quot;A String&quot;,
1014 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001015 &quot;locationHint&quot;: &quot;A String&quot;, # An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001016 &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.
1017 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001018 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001019 &quot;provisionedIops&quot;: &quot;A String&quot;, # Indicates how many IOPS must be provisioned for the disk.
Bu Sun Kim65020912020-05-20 12:08:20 -07001020 &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.
1021 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1022 &quot;A String&quot;,
1023 ],
1024 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
1025 &quot;A String&quot;,
1026 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001027 &quot;satisfiesPzs&quot;: True or False, # [Output Only] Reserved for future use.
Bu Sun Kim65020912020-05-20 12:08:20 -07001028 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001029 &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 -07001030 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001031 # 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 -07001032 &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:
1033 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001034 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/disks/disk
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001035 # - projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001036 # - projects/project/regions/region/disks/disk
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001037 # - zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001038 # - regions/region/disks/disk
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001039 &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 -07001040 &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.
1041 #
1042 # 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:
1043 # projects/debian-cloud/global/images/family/debian-9
1044 #
1045 #
1046 # Alternatively, use a specific version of a public operating system image:
1047 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
1048 #
1049 #
1050 # To create a disk with a custom image that you created, specify the image name in the following format:
1051 # global/images/my-custom-image
1052 #
1053 #
1054 # 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:
1055 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001056 &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 -07001057 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1058 &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.
1059 &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.
1060 &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.
1061 },
1062 &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.
1063 &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:
1064 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1065 # - projects/project/global/snapshots/snapshot
1066 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001067 &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 -07001068 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1069 &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.
1070 &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.
1071 &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.
1072 },
1073 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001074 &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/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
1075 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of disk creation.
1076 # - CREATING: Disk is provisioning.
1077 # - RESTORING: Source data is being copied into the disk.
1078 # - FAILED: Disk creation failed.
1079 # - READY: Disk is ready for use.
1080 # - DELETING: Disk is deleting.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001081 &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 -07001082 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1083 &quot;A String&quot;,
1084 ],
1085 &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.
1086}
John Asmuth614db982014-04-24 15:46:26 -04001087
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001088 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.
1089
1090For 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.
1091
1092The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001093 sourceImage: string, Source image to restore onto a disk. This field is optional.
John Asmuth614db982014-04-24 15:46:26 -04001094
1095Returns:
1096 An object of the form:
1097
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001098 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001099 #
1100 # Google Compute Engine has three Operation resources:
1101 #
1102 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1103 #
1104 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1105 #
1106 # Operations can be global, regional or zonal.
1107 # - For global operations, use the `globalOperations` resource.
1108 # - For regional operations, use the `regionOperations` resource.
1109 # - For zonal operations, use the `zonalOperations` resource.
1110 #
1111 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1112 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1113 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1114 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1115 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1116 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1117 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001118 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001119 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1120 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1121 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001122 },
1123 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001124 },
1125 &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`.
1126 &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.
1127 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1128 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1129 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1130 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001131 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001132 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1133 &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.
1134 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1135 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1136 &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.
1137 &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`.
1138 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1139 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1140 &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.
1141 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1142 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1143 {
1144 &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.
1145 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1146 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1147 {
1148 &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).
1149 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1150 },
1151 ],
1152 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1153 },
1154 ],
1155 &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.
1156}</pre>
John Asmuth614db982014-04-24 15:46:26 -04001157</div>
1158
1159<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001160 <code class="details" id="list">list(project, zone, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001161 <pre>Retrieves a list of persistent disks contained within the specified zone.
John Asmuth614db982014-04-24 15:46:26 -04001162
1163Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001164 project: string, Project ID for this request. (required)
1165 zone: string, The name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001166 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;`.
Takashi Matsuo06694102015-09-11 13:55:40 -07001167
Dan O'Mearadd494642020-05-01 07:42:23 -07001168For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Takashi Matsuo06694102015-09-11 13:55:40 -07001169
Dan O'Mearadd494642020-05-01 07:42:23 -07001170You 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001171
Bu Sun Kim65020912020-05-20 12:08:20 -07001172To 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) ```
1173 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`)
1174 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1175
1176You 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.
1177
1178Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1179 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001180 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
John Asmuth614db982014-04-24 15:46:26 -04001181
1182Returns:
1183 An object of the form:
1184
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001185 { # A list of Disk resources.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001186 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
1187 &quot;items&quot;: [ # A list of Disk resources.
1188 { # Represents a Persistent Disk resource.
1189 #
1190 # Google Compute Engine has two Disk resources:
1191 #
1192 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
1193 #
1194 # 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.
1195 #
1196 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
1197 #
1198 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
1199 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1200 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
1201 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -07001202 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001203 # 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).
Bu Sun Kim65020912020-05-20 12:08:20 -07001204 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001205 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Bu Sun Kim65020912020-05-20 12:08:20 -07001206 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001207 # 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.
1208 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1209 &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.
1210 &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.
1211 &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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001212 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001213 &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.
1214 { # Guest OS features.
1215 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001216 },
1217 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001218 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1219 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
1220 &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.
1221 #
1222 # To see the latest fingerprint, make a get() request to retrieve a disk.
1223 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
1224 &quot;a_key&quot;: &quot;A String&quot;,
1225 },
1226 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
1227 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
1228 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
1229 &quot;A String&quot;,
1230 ],
1231 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
1232 &quot;A String&quot;,
1233 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001234 &quot;locationHint&quot;: &quot;A String&quot;, # An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001235 &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.
1236 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
1237 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001238 &quot;provisionedIops&quot;: &quot;A String&quot;, # Indicates how many IOPS must be provisioned for the disk.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001239 &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.
1240 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1241 &quot;A String&quot;,
1242 ],
1243 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
1244 &quot;A String&quot;,
1245 ],
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001246 &quot;satisfiesPzs&quot;: True or False, # [Output Only] Reserved for future use.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001247 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
1248 &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.
1249 #
1250 # 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.
1251 &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:
1252 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001253 # - https://www.googleapis.com/compute/v1/projects/project/regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001254 # - projects/project/zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001255 # - projects/project/regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001256 # - zones/zone/disks/disk
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001257 # - regions/region/disks/disk
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001258 &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.
1259 &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.
1260 #
1261 # 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:
1262 # projects/debian-cloud/global/images/family/debian-9
1263 #
1264 #
1265 # Alternatively, use a specific version of a public operating system image:
1266 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
1267 #
1268 #
1269 # To create a disk with a custom image that you created, specify the image name in the following format:
1270 # global/images/my-custom-image
1271 #
1272 #
1273 # 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:
1274 # global/images/family/my-image-family
1275 &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.
1276 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1277 &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.
1278 &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.
1279 &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.
1280 },
1281 &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.
1282 &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:
1283 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1284 # - projects/project/global/snapshots/snapshot
1285 # - global/snapshots/snapshot
1286 &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.
1287 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1288 &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.
1289 &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.
1290 &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.
1291 },
1292 &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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001293 &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/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
1294 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of disk creation.
1295 # - CREATING: Disk is provisioning.
1296 # - RESTORING: Source data is being copied into the disk.
1297 # - FAILED: Disk creation failed.
1298 # - READY: Disk is ready for use.
1299 # - DELETING: Disk is deleting.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001300 &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
1301 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1302 &quot;A String&quot;,
1303 ],
1304 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001305 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001306 ],
1307 &quot;kind&quot;: &quot;compute#diskList&quot;, # [Output Only] Type of resource. Always compute#diskList for lists of disks.
1308 &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.
1309 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
1310 &quot;warning&quot;: { # [Output Only] Informational warning message.
1311 &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.
1312 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1313 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1314 {
1315 &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).
1316 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1317 },
1318 ],
1319 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1320 },
1321}</pre>
John Asmuth614db982014-04-24 15:46:26 -04001322</div>
1323
1324<div class="method">
1325 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1326 <pre>Retrieves the next page of results.
1327
1328Args:
1329 previous_request: The request for the previous page. (required)
1330 previous_response: The response from the request for the previous page. (required)
1331
1332Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -07001333 A request object that you can call &#x27;execute()&#x27; on to request the next
John Asmuth614db982014-04-24 15:46:26 -04001334 page. Returns None if there are no more items in the collection.
1335 </pre>
1336</div>
1337
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001338<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001339 <code class="details" id="removeResourcePolicies">removeResourcePolicies(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001340 <pre>Removes resource policies from a disk.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001341
1342Args:
1343 project: string, Project ID for this request. (required)
1344 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001345 disk: string, The disk name for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001346 body: object, The request body.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001347 The object takes the form of:
1348
1349{
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001350 &quot;resourcePolicies&quot;: [ # Resource policies to be removed from this disk.
1351 &quot;A String&quot;,
1352 ],
1353}
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001354
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001355 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.
1356
1357For 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.
1358
1359The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001360
1361Returns:
1362 An object of the form:
1363
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001364 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001365 #
1366 # Google Compute Engine has three Operation resources:
1367 #
1368 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1369 #
1370 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1371 #
1372 # Operations can be global, regional or zonal.
1373 # - For global operations, use the `globalOperations` resource.
1374 # - For regional operations, use the `regionOperations` resource.
1375 # - For zonal operations, use the `zonalOperations` resource.
1376 #
1377 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1378 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1379 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1380 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1381 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1382 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1383 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001384 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001385 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1386 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1387 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001388 },
1389 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001390 },
1391 &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`.
1392 &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.
1393 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1394 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1395 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1396 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001397 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001398 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1399 &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.
1400 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1401 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1402 &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.
1403 &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`.
1404 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1405 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1406 &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.
1407 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1408 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1409 {
1410 &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.
1411 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1412 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1413 {
1414 &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).
1415 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1416 },
1417 ],
1418 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1419 },
1420 ],
1421 &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.
1422}</pre>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001423</div>
1424
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001425<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001426 <code class="details" id="resize">resize(project, zone, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001427 <pre>Resizes the specified persistent disk. You can only increase the size of the disk.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001428
1429Args:
1430 project: string, Project ID for this request. (required)
1431 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001432 disk: string, The name of the persistent disk. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001433 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001434 The object takes the form of:
1435
1436{
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001437 &quot;sizeGb&quot;: &quot;A String&quot;, # The new size of the persistent disk, which is specified in GB.
1438}
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001439
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001440 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.
1441
1442For 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.
1443
1444The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001445
1446Returns:
1447 An object of the form:
1448
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001449 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001450 #
1451 # Google Compute Engine has three Operation resources:
1452 #
1453 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1454 #
1455 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1456 #
1457 # Operations can be global, regional or zonal.
1458 # - For global operations, use the `globalOperations` resource.
1459 # - For regional operations, use the `regionOperations` resource.
1460 # - For zonal operations, use the `zonalOperations` resource.
1461 #
1462 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1463 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1464 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1465 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1466 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1467 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1468 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001469 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001470 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1471 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1472 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001473 },
1474 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001475 },
1476 &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`.
1477 &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.
1478 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1479 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1480 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1481 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001482 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001483 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1484 &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.
1485 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1486 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1487 &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.
1488 &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`.
1489 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1490 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1491 &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.
1492 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1493 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1494 {
1495 &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.
1496 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1497 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1498 {
1499 &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).
1500 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1501 },
1502 ],
1503 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1504 },
1505 ],
1506 &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.
1507}</pre>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001508</div>
1509
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001510<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001511 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001512 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1513
1514Args:
1515 project: string, Project ID for this request. (required)
1516 zone: string, The name of the zone for this request. (required)
1517 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001518 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001519 The object takes the form of:
1520
1521{
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001522 &quot;bindings&quot;: [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
1523 { # Associates `members` with a `role`.
1524 &quot;bindingId&quot;: &quot;A String&quot;,
1525 &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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001526 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001527 # If the condition evaluates to `true`, then this binding applies to the current request.
Bu Sun Kim65020912020-05-20 12:08:20 -07001528 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001529 # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001530 #
1531 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001532 #
1533 # Example (Comparison):
1534 #
1535 # 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;
1536 #
1537 # Example (Equality):
1538 #
1539 # 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;
1540 #
1541 # Example (Logic):
1542 #
1543 # 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;
1544 #
1545 # Example (Data Manipulation):
1546 #
1547 # 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;
1548 #
1549 # 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.
1550 &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.
1551 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1552 &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.
1553 &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.
1554 },
1555 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1556 #
1557 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1558 #
1559 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1560 #
1561 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1562 #
1563 #
1564 #
1565 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1566 #
1567 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1568 #
1569 # * `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.
1570 #
1571 # * `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.
1572 #
1573 # * `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.
1574 #
1575 #
1576 #
1577 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1578 &quot;A String&quot;,
1579 ],
1580 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001581 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001582 ],
1583 &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.
1584 &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 -07001585 #
1586 #
1587 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001588 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001589 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001590 # 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 -07001591 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001592 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001593 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001594 # { &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 -07001595 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001596 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001597 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001598 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001599 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001600 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -07001601 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001602 { # 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.
1603 #
1604 # 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.
1605 #
1606 # Example Policy with multiple AuditConfigs:
1607 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001608 # { &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 -07001609 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001610 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim65020912020-05-20 12:08:20 -07001611 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001612 { # Provides the configuration for logging a type of permissions. Example:
1613 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001614 # { &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 -07001615 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001616 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1617 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1618 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001619 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001620 &quot;ignoreChildExemptions&quot;: True or False,
1621 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001622 },
1623 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001624 &quot;exemptedMembers&quot;: [
1625 &quot;A String&quot;,
1626 ],
1627 &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 -07001628 },
1629 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001630 &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 -07001631 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001632 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07001633 &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.
1634 #
1635 # If the condition evaluates to `true`, then this binding applies to the current request.
1636 #
1637 # 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.
1638 #
1639 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1640 #
1641 # Example (Comparison):
1642 #
1643 # 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;
1644 #
1645 # Example (Equality):
1646 #
1647 # 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;
1648 #
1649 # Example (Logic):
1650 #
1651 # 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;
1652 #
1653 # Example (Data Manipulation):
1654 #
1655 # 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;
1656 #
1657 # 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.
1658 &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.
1659 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1660 &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.
1661 &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.
1662 },
1663 &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 -07001664 #
1665 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1666 #
1667 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1668 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001669 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001670 #
1671 #
1672 #
1673 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1674 #
1675 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1676 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001677 # * `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.
1678 #
1679 # * `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.
1680 #
1681 # * `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.
1682 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001683 #
1684 #
1685 # * `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 -07001686 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001687 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001688 &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 -07001689 },
1690 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001691 &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.
1692 #
1693 # **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.
1694 &quot;iamOwned&quot;: True or False,
1695 &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.
1696 { # A rule to be applied in a Policy.
1697 &quot;action&quot;: &quot;A String&quot;, # Required
1698 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1699 { # A condition to be met.
1700 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1701 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1702 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1703 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1704 &quot;values&quot;: [ # The objects of the condition.
1705 &quot;A String&quot;,
1706 ],
1707 },
1708 ],
1709 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1710 &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.
1711 &quot;A String&quot;,
1712 ],
1713 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1714 { # Specifies what kind of log the caller must write
1715 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1716 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1717 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1718 },
1719 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1720 },
1721 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1722 #
1723 # 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.
1724 #
1725 # Field names correspond to IAM request parameters and field values are their respective values.
1726 #
1727 # 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.
1728 #
1729 # 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]}
1730 &quot;customFields&quot;: [ # Custom fields.
1731 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1732 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1733 &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.
1734 },
1735 ],
1736 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1737 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1738 },
1739 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1740 &quot;logMode&quot;: &quot;A String&quot;,
1741 },
1742 },
1743 ],
1744 &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.
1745 &quot;A String&quot;,
1746 ],
1747 &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.
1748 &quot;A String&quot;,
1749 ],
1750 },
1751 ],
1752 &quot;version&quot;: 42, # Specifies the format of the policy.
1753 #
1754 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1755 #
1756 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1757 #
1758 # * 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
1759 #
1760 # **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.
1761 #
1762 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1763 #
1764 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001765 },
1766}
1767
1768
1769Returns:
1770 An object of the form:
1771
1772 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
1773 #
1774 #
1775 #
1776 # 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.
1777 #
1778 # 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).
1779 #
1780 # **JSON example:**
1781 #
1782 # { &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 }
1783 #
1784 # **YAML example:**
1785 #
1786 # 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
1787 #
1788 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
1789 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
1790 { # 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.
1791 #
1792 # 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.
1793 #
1794 # Example Policy with multiple AuditConfigs:
1795 #
1796 # { &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; ] } ] } ] }
1797 #
1798 # 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.
1799 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
1800 { # Provides the configuration for logging a type of permissions. Example:
1801 #
1802 # { &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; } ] }
1803 #
1804 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1805 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1806 &quot;A String&quot;,
1807 ],
1808 &quot;ignoreChildExemptions&quot;: True or False,
1809 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
1810 },
1811 ],
1812 &quot;exemptedMembers&quot;: [
1813 &quot;A String&quot;,
1814 ],
1815 &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.
1816 },
1817 ],
1818 &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.
1819 { # Associates `members` with a `role`.
1820 &quot;bindingId&quot;: &quot;A String&quot;,
1821 &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.
1822 #
1823 # If the condition evaluates to `true`, then this binding applies to the current request.
1824 #
1825 # 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.
1826 #
1827 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1828 #
1829 # Example (Comparison):
1830 #
1831 # 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;
1832 #
1833 # Example (Equality):
1834 #
1835 # 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;
1836 #
1837 # Example (Logic):
1838 #
1839 # 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;
1840 #
1841 # Example (Data Manipulation):
1842 #
1843 # 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;
1844 #
1845 # 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.
1846 &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.
1847 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1848 &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.
1849 &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.
1850 },
1851 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1852 #
1853 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1854 #
1855 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1856 #
1857 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1858 #
1859 #
1860 #
1861 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1862 #
1863 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1864 #
1865 # * `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.
1866 #
1867 # * `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.
1868 #
1869 # * `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.
1870 #
1871 #
1872 #
1873 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1874 &quot;A String&quot;,
1875 ],
1876 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1877 },
1878 ],
1879 &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.
1880 #
1881 # **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.
1882 &quot;iamOwned&quot;: True or False,
1883 &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.
1884 { # A rule to be applied in a Policy.
1885 &quot;action&quot;: &quot;A String&quot;, # Required
1886 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1887 { # A condition to be met.
1888 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1889 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1890 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1891 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1892 &quot;values&quot;: [ # The objects of the condition.
1893 &quot;A String&quot;,
1894 ],
1895 },
1896 ],
1897 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1898 &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.
1899 &quot;A String&quot;,
1900 ],
1901 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1902 { # Specifies what kind of log the caller must write
1903 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1904 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1905 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1906 },
1907 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1908 },
1909 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1910 #
1911 # 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.
1912 #
1913 # Field names correspond to IAM request parameters and field values are their respective values.
1914 #
1915 # 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.
1916 #
1917 # 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]}
1918 &quot;customFields&quot;: [ # Custom fields.
1919 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1920 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1921 &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.
1922 },
1923 ],
1924 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1925 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1926 },
1927 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1928 &quot;logMode&quot;: &quot;A String&quot;,
1929 },
1930 },
1931 ],
1932 &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.
1933 &quot;A String&quot;,
1934 ],
1935 &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.
1936 &quot;A String&quot;,
1937 ],
1938 },
1939 ],
1940 &quot;version&quot;: 42, # Specifies the format of the policy.
1941 #
1942 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1943 #
1944 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1945 #
1946 # * 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
1947 #
1948 # **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.
1949 #
1950 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1951 #
1952 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1953}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001954</div>
1955
1956<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001957 <code class="details" id="setLabels">setLabels(project, zone, resource, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001958 <pre>Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
1959
1960Args:
1961 project: string, Project ID for this request. (required)
1962 zone: string, The name of the zone for this request. (required)
1963 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001964 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001965 The object takes the form of:
1966
1967{
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001968 &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.
1969 &quot;labels&quot;: { # The labels to set for this resource.
1970 &quot;a_key&quot;: &quot;A String&quot;,
1971 },
1972}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001973
1974 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.
1975
1976For 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.
1977
1978The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1979
1980Returns:
1981 An object of the form:
1982
1983 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001984 #
1985 # Google Compute Engine has three Operation resources:
1986 #
1987 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1988 #
1989 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1990 #
1991 # Operations can be global, regional or zonal.
1992 # - For global operations, use the `globalOperations` resource.
1993 # - For regional operations, use the `regionOperations` resource.
1994 # - For zonal operations, use the `zonalOperations` resource.
1995 #
1996 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1997 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1998 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1999 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
2000 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
2001 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
2002 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -07002003 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08002004 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
2005 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
2006 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -07002007 },
2008 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08002009 },
2010 &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`.
2011 &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.
2012 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
2013 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
2014 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
2015 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08002016 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08002017 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
2018 &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.
2019 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
2020 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
2021 &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.
2022 &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`.
2023 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
2024 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
2025 &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.
2026 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
2027 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
2028 {
2029 &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.
2030 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
2031 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
2032 {
2033 &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).
2034 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
2035 },
2036 ],
2037 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
2038 },
2039 ],
2040 &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.
2041}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002042</div>
2043
2044<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002045 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002046 <pre>Returns permissions that a caller has on the specified resource.
2047
2048Args:
2049 project: string, Project ID for this request. (required)
2050 zone: string, The name of the zone for this request. (required)
2051 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002052 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002053 The object takes the form of:
2054
2055{
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08002056 &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.
2057 &quot;A String&quot;,
2058 ],
2059}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002060
2061
2062Returns:
2063 An object of the form:
2064
2065 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08002066 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2067 &quot;A String&quot;,
2068 ],
2069}</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002070</div>
2071
John Asmuth614db982014-04-24 15:46:26 -04002072</body></html>