blob: 8878352bb9d741e68f544cd307d1365495cb02cb [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_v1.html">Compute Engine API</a> . <a href="compute_v1.regionDisks.html">regionDisks</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, region, 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 regional 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="#close">close()</a></code></p>
82<p class="firstline">Close httplib2 connections.</p>
83<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#createSnapshot">createSnapshot(project, region, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070085<p class="firstline">Creates a snapshot of this regional disk.</p>
86<p class="toc_element">
87 <code><a href="#delete">delete(project, region, disk, requestId=None)</a></code></p>
88<p class="firstline">Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of 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>
89<p class="toc_element">
90 <code><a href="#get">get(project, region, disk)</a></code></p>
91<p class="firstline">Returns a specified regional persistent disk.</p>
92<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070093 <code><a href="#getIamPolicy">getIamPolicy(project, region, resource, optionsRequestedPolicyVersion=None)</a></code></p>
Bu Sun Kim65020912020-05-20 12:08:20 -070094<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
95<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#insert">insert(project, region, body=None, requestId=None, sourceImage=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<p class="firstline">Creates a persistent regional disk in the specified project using the data included in the request.</p>
98<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070099 <code><a href="#list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<p class="firstline">Retrieves the list of persistent disks contained within the specified region.</p>
101<p class="toc_element">
102 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
103<p class="firstline">Retrieves the next page of results.</p>
104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#removeResourcePolicies">removeResourcePolicies(project, region, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Removes resource policies from a regional disk.</p>
107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#resize">resize(project, region, disk, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109<p class="firstline">Resizes the specified regional persistent disk.</p>
110<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -0700111 <code><a href="#setIamPolicy">setIamPolicy(project, region, resource, body=None)</a></code></p>
112<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
113<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 <code><a href="#setLabels">setLabels(project, region, resource, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700115<p class="firstline">Sets the labels on the target regional disk.</p>
116<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 <code><a href="#testIamPermissions">testIamPermissions(project, region, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
119<h3>Method Details</h3>
120<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700121 <code class="details" id="addResourcePolicies">addResourcePolicies(project, region, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700122 <pre>Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
123
124Args:
125 project: string, Project ID for this request. (required)
126 region: string, The name of the region for this request. (required)
127 disk: string, The disk name for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700128 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129 The object takes the form of:
130
131{
Bu Sun Kim65020912020-05-20 12:08:20 -0700132 &quot;resourcePolicies&quot;: [ # Resource policies to be added to this disk.
133 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700134 ],
135 }
136
137 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.
138
139For 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.
140
141The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
142
143Returns:
144 An object of the form:
145
146 { # Represents an Operation resource.
147 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700148 # Google Compute Engine has three Operation resources:
149 #
150 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
151 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700152 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
153 #
154 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700155 # - For global operations, use the `globalOperations` resource.
156 # - For regional operations, use the `regionOperations` resource.
157 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700158 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700159 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
161 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
162 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
163 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
164 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
165 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700166 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
168 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
169 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700170 },
171 ],
172 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 &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`.
174 &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.
175 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
176 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
177 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
178 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
179 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
180 &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.
181 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
182 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
183 &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.
184 &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`.
185 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
186 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
187 &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.
188 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
189 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
190 {
191 &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.
192 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
193 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
194 {
195 &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).
196 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
197 },
198 ],
199 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
200 },
201 ],
202 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700203 }</pre>
204</div>
205
206<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700207 <code class="details" id="close">close()</code>
208 <pre>Close httplib2 connections.</pre>
209</div>
210
211<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700212 <code class="details" id="createSnapshot">createSnapshot(project, region, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700213 <pre>Creates a snapshot of this regional disk.
214
215Args:
216 project: string, Project ID for this request. (required)
217 region: string, Name of the region for this request. (required)
218 disk: string, Name of the regional persistent disk to snapshot. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700219 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700220 The object takes the form of:
221
222{ # Represents a Persistent Disk Snapshot resource.
223 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700224 # You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. (== resource_for {$api_version}.snapshots ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700225 &quot;autoCreated&quot;: True or False, # [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700226 &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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700227 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
228 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
229 &quot;diskSizeGb&quot;: &quot;A String&quot;, # [Output Only] Size of the source disk, specified in GB.
230 &quot;downloadBytes&quot;: &quot;A String&quot;, # [Output Only] Number of bytes downloaded to restore a snapshot to a disk.
231 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
232 &quot;kind&quot;: &quot;compute#snapshot&quot;, # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
233 &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.
234 #
235 # To see the latest fingerprint, make a get() request to retrieve a snapshot.
236 &quot;labels&quot;: { # Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.
237 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700238 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700239 &quot;licenseCodes&quot;: [ # [Output Only] Integer license codes indicating which licenses are attached to this snapshot.
240 &quot;A String&quot;,
241 ],
242 &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).
243 &quot;A String&quot;,
244 ],
245 &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.
246 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700247 &quot;snapshotEncryptionKey&quot;: { # Encrypts the snapshot using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700248 #
249 # 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.
250 #
251 # Customer-supplied encryption keys do not protect access to metadata of the snapshot.
252 #
253 # If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later.
Bu Sun Kim65020912020-05-20 12:08:20 -0700254 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
255 &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.
256 &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.
257 &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 Kim715bd7f2019-06-14 16:50:42 -0700258 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700259 &quot;sourceDisk&quot;: &quot;A String&quot;, # The source disk used to create this snapshot.
260 &quot;sourceDiskEncryptionKey&quot;: { # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
Bu Sun Kim65020912020-05-20 12:08:20 -0700261 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
262 &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.
263 &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.
264 &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 Kim715bd7f2019-06-14 16:50:42 -0700265 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700266 &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.
267 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.
268 &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.
269 &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.
270 &quot;storageLocations&quot;: [ # Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
271 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700272 ],
273 }
274
275 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.
276
277For 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.
278
279The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
280
281Returns:
282 An object of the form:
283
284 { # Represents an Operation resource.
285 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700286 # Google Compute Engine has three Operation resources:
287 #
288 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
289 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700290 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
291 #
292 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700293 # - For global operations, use the `globalOperations` resource.
294 # - For regional operations, use the `regionOperations` resource.
295 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700296 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700297 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700298 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
299 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
300 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
301 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
302 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
303 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700304 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700305 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
306 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
307 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700308 },
309 ],
310 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700311 &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`.
312 &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.
313 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
314 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
315 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
316 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
317 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
318 &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.
319 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
320 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
321 &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.
322 &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`.
323 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
324 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
325 &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.
326 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
327 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
328 {
329 &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.
330 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
331 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
332 {
333 &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).
334 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
335 },
336 ],
337 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
338 },
339 ],
340 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700341 }</pre>
342</div>
343
344<div class="method">
345 <code class="details" id="delete">delete(project, region, disk, requestId=None)</code>
346 <pre>Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of 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.
347
348Args:
349 project: string, Project ID for this request. (required)
350 region: string, Name of the region for this request. (required)
351 disk: string, Name of the regional persistent disk to delete. (required)
352 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.
353
354For 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.
355
356The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
357
358Returns:
359 An object of the form:
360
361 { # Represents an Operation resource.
362 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700363 # Google Compute Engine has three Operation resources:
364 #
365 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
366 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700367 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
368 #
369 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700370 # - For global operations, use the `globalOperations` resource.
371 # - For regional operations, use the `regionOperations` resource.
372 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700373 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700374 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
376 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
377 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
378 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
379 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
380 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700381 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700382 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
383 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
384 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700385 },
386 ],
387 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700388 &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`.
389 &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.
390 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
391 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
392 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
393 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
394 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
395 &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.
396 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
397 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
398 &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.
399 &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`.
400 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
401 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
402 &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.
403 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
404 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
405 {
406 &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.
407 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
408 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
409 {
410 &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).
411 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
412 },
413 ],
414 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
415 },
416 ],
417 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700418 }</pre>
419</div>
420
421<div class="method">
422 <code class="details" id="get">get(project, region, disk)</code>
423 <pre>Returns a specified regional persistent disk.
424
425Args:
426 project: string, Project ID for this request. (required)
427 region: string, Name of the region for this request. (required)
428 disk: string, Name of the regional persistent disk to return. (required)
429
430Returns:
431 An object of the form:
432
433 { # Represents a Persistent Disk resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700434 #
435 # Google Compute Engine has two Disk resources:
436 #
437 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
438 #
439 # 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.
440 #
441 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
442 #
443 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
444 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
445 &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 -0700446 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700447 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700448 # 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 -0700449 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700450 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -0700451 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700452 # 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.
453 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
454 &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.
455 &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.
456 &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.
457 },
458 &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.
459 { # Guest OS features.
460 &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 -0700461 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700462 ],
463 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
464 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
465 &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.
466 #
467 # To see the latest fingerprint, make a get() request to retrieve a disk.
468 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
469 &quot;a_key&quot;: &quot;A String&quot;,
470 },
471 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
472 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
473 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
474 &quot;A String&quot;,
475 ],
476 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
477 &quot;A String&quot;,
478 ],
479 &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.
480 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700481 &quot;physicalBlockSizeBytes&quot;: &quot;A String&quot;, # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller&#x27;s project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700482 &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.
483 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
484 &quot;A String&quot;,
485 ],
486 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
487 &quot;A String&quot;,
488 ],
489 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700490 &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 -0700491 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700492 # 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 -0700493 &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:
494 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
495 # - projects/project/zones/zone/disks/disk
496 # - zones/zone/disks/disk
497 &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 -0700498 &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.
499 #
500 # 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:
501 # projects/debian-cloud/global/images/family/debian-9
502 #
503 #
504 # Alternatively, use a specific version of a public operating system image:
505 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
506 #
507 #
508 # To create a disk with a custom image that you created, specify the image name in the following format:
509 # global/images/my-custom-image
510 #
511 #
512 # 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:
513 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700514 &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 -0700515 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
516 &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.
517 &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.
518 &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.
519 },
520 &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.
521 &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:
522 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
523 # - projects/project/global/snapshots/snapshot
524 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700525 &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 -0700526 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
527 &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.
528 &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.
529 &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.
530 },
531 &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.
532 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700533 &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 -0700534 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
535 &quot;A String&quot;,
536 ],
537 &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.
538 }</pre>
539</div>
540
541<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700542 <code class="details" id="getIamPolicy">getIamPolicy(project, region, resource, optionsRequestedPolicyVersion=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700543 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
544
545Args:
546 project: string, Project ID for this request. (required)
547 region: string, The name of the region for this request. (required)
548 resource: string, Name or id of the resource for this request. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700549 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim65020912020-05-20 12:08:20 -0700550
551Returns:
552 An object of the form:
553
554 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
555 #
556 #
557 #
558 # 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.
559 #
560 # 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).
561 #
562 # **JSON example:**
563 #
564 # { &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 }
565 #
566 # **YAML example:**
567 #
568 # 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
569 #
570 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
571 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
572 { # 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.
573 #
574 # 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.
575 #
576 # Example Policy with multiple AuditConfigs:
577 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700578 # { &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 Kim65020912020-05-20 12:08:20 -0700579 #
580 # 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.
581 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
582 { # Provides the configuration for logging a type of permissions. Example:
583 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700584 # { &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 -0700585 #
586 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
587 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
588 &quot;A String&quot;,
589 ],
590 &quot;ignoreChildExemptions&quot;: True or False,
591 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
592 },
593 ],
594 &quot;exemptedMembers&quot;: [
595 &quot;A String&quot;,
596 ],
597 &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 -0700598 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700599 ],
600 &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.
601 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700602 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700603 &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.
604 #
605 # If the condition evaluates to `true`, then this binding applies to the current request.
606 #
607 # 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.
608 #
609 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
610 #
611 # Example (Comparison):
612 #
613 # 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;
614 #
615 # Example (Equality):
616 #
617 # 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;
618 #
619 # Example (Logic):
620 #
621 # 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;
622 #
623 # Example (Data Manipulation):
624 #
625 # 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;
626 #
627 # 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.
628 &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.
629 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
630 &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.
631 &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 -0700632 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700633 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
634 #
635 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
636 #
637 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
638 #
639 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
640 #
641 #
642 #
643 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
644 #
645 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
646 #
647 # * `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.
648 #
649 # * `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.
650 #
651 # * `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.
652 #
653 #
654 #
655 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
656 &quot;A String&quot;,
657 ],
658 &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 -0700659 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700660 ],
661 &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.
662 #
663 # **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.
664 &quot;iamOwned&quot;: True or False,
665 &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.
666 { # A rule to be applied in a Policy.
667 &quot;action&quot;: &quot;A String&quot;, # Required
668 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
669 { # A condition to be met.
670 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
671 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
672 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
673 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
674 &quot;values&quot;: [ # The objects of the condition.
675 &quot;A String&quot;,
676 ],
677 },
678 ],
679 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
680 &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.
681 &quot;A String&quot;,
682 ],
683 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
684 { # Specifies what kind of log the caller must write
685 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
686 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
687 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
688 },
689 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
690 },
691 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
692 #
693 # 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.
694 #
695 # Field names correspond to IAM request parameters and field values are their respective values.
696 #
697 # 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.
698 #
699 # 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]}
700 &quot;customFields&quot;: [ # Custom fields.
701 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
702 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
703 &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.
704 },
705 ],
706 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
707 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
708 },
709 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
710 &quot;logMode&quot;: &quot;A String&quot;,
711 },
712 },
713 ],
714 &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.
715 &quot;A String&quot;,
716 ],
717 &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.
718 &quot;A String&quot;,
719 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700720 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700721 ],
722 &quot;version&quot;: 42, # Specifies the format of the policy.
723 #
724 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
725 #
726 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
727 #
728 # * 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
729 #
730 # **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.
731 #
732 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
733 #
734 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
735 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700736</div>
737
738<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700739 <code class="details" id="insert">insert(project, region, body=None, requestId=None, sourceImage=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700740 <pre>Creates a persistent regional disk in the specified project using the data included in the request.
741
742Args:
743 project: string, Project ID for this request. (required)
744 region: string, Name of the region for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700745 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700746 The object takes the form of:
747
748{ # Represents a Persistent Disk resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700749 #
750 # Google Compute Engine has two Disk resources:
751 #
752 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
753 #
754 # 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.
755 #
756 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
757 #
758 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
759 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
760 &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 -0700761 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700762 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700763 # 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 -0700764 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700765 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -0700766 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700767 # 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.
768 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
769 &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.
770 &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.
771 &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.
772 },
773 &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.
774 { # Guest OS features.
775 &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 -0700776 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700777 ],
778 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
779 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
780 &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.
781 #
782 # To see the latest fingerprint, make a get() request to retrieve a disk.
783 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
784 &quot;a_key&quot;: &quot;A String&quot;,
785 },
786 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
787 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
788 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
789 &quot;A String&quot;,
790 ],
791 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
792 &quot;A String&quot;,
793 ],
794 &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.
795 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700796 &quot;physicalBlockSizeBytes&quot;: &quot;A String&quot;, # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller&#x27;s project.
Bu Sun Kim65020912020-05-20 12:08:20 -0700797 &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.
798 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
799 &quot;A String&quot;,
800 ],
801 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
802 &quot;A String&quot;,
803 ],
804 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700805 &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 -0700806 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700807 # 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 -0700808 &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:
809 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
810 # - projects/project/zones/zone/disks/disk
811 # - zones/zone/disks/disk
812 &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 -0700813 &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.
814 #
815 # 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:
816 # projects/debian-cloud/global/images/family/debian-9
817 #
818 #
819 # Alternatively, use a specific version of a public operating system image:
820 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
821 #
822 #
823 # To create a disk with a custom image that you created, specify the image name in the following format:
824 # global/images/my-custom-image
825 #
826 #
827 # 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:
828 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700829 &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 -0700830 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
831 &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.
832 &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.
833 &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.
834 },
835 &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.
836 &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:
837 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
838 # - projects/project/global/snapshots/snapshot
839 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700840 &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 -0700841 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
842 &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.
843 &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.
844 &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.
845 },
846 &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.
847 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700848 &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 -0700849 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
850 &quot;A String&quot;,
851 ],
852 &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.
853}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700854
855 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.
856
857For 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.
858
859The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
860 sourceImage: string, Optional. Source image to restore onto a disk.
861
862Returns:
863 An object of the form:
864
865 { # Represents an Operation resource.
866 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700867 # Google Compute Engine has three Operation resources:
868 #
869 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
870 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700871 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
872 #
873 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700874 # - For global operations, use the `globalOperations` resource.
875 # - For regional operations, use the `regionOperations` resource.
876 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700877 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700878 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700879 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
880 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
881 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
882 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
883 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
884 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700885 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700886 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
887 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
888 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700889 },
890 ],
891 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700892 &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`.
893 &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.
894 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
895 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
896 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
897 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
898 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
899 &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.
900 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
901 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
902 &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.
903 &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`.
904 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
905 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
906 &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.
907 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
908 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
909 {
910 &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.
911 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
912 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
913 {
914 &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).
915 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
916 },
917 ],
918 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
919 },
920 ],
921 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700922 }</pre>
923</div>
924
925<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700926 <code class="details" id="list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700927 <pre>Retrieves the list of persistent disks contained within the specified region.
928
929Args:
930 project: string, Project ID for this request. (required)
931 region: string, Name of the region for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700932 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;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700933
Dan O'Mearadd494642020-05-01 07:42:23 -0700934For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700935
Dan O'Mearadd494642020-05-01 07:42:23 -0700936You 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700937
Bu Sun Kim65020912020-05-20 12:08:20 -0700938To 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) ```
939 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`)
940 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
941
942You 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.
943
944Currently, only sorting by `name` or `creationTimestamp desc` is supported.
945 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700946 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700947
948Returns:
949 An object of the form:
950
951 { # A list of Disk resources.
Bu Sun Kim65020912020-05-20 12:08:20 -0700952 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
953 &quot;items&quot;: [ # A list of Disk resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700954 { # Represents a Persistent Disk resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700955 #
956 # Google Compute Engine has two Disk resources:
957 #
958 # * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks)
959 #
960 # 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.
961 #
962 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
963 #
964 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==)
965 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
966 &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 -0700967 &quot;diskEncryptionKey&quot;: { # Encrypts the disk using a customer-supplied encryption key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700968 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700969 # 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 -0700970 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700971 # Customer-supplied encryption keys do not protect access to metadata of the disk.
Dan O'Mearadd494642020-05-01 07:42:23 -0700972 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700973 # 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.
974 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
975 &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.
976 &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.
977 &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 Kim715bd7f2019-06-14 16:50:42 -0700978 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700979 &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.
980 { # Guest OS features.
981 &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.
982 },
983 ],
984 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
985 &quot;kind&quot;: &quot;compute#disk&quot;, # [Output Only] Type of the resource. Always compute#disk for disks.
986 &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.
987 #
988 # To see the latest fingerprint, make a get() request to retrieve a disk.
989 &quot;labels&quot;: { # Labels to apply to this disk. These can be later modified by the setLabels method.
990 &quot;a_key&quot;: &quot;A String&quot;,
991 },
992 &quot;lastAttachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last attach timestamp in RFC3339 text format.
993 &quot;lastDetachTimestamp&quot;: &quot;A String&quot;, # [Output Only] Last detach timestamp in RFC3339 text format.
994 &quot;licenseCodes&quot;: [ # Integer license codes indicating which licenses are attached to this disk.
995 &quot;A String&quot;,
996 ],
997 &quot;licenses&quot;: [ # A list of publicly visible licenses. Reserved for Google&#x27;s use.
998 &quot;A String&quot;,
999 ],
1000 &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.
1001 &quot;options&quot;: &quot;A String&quot;, # Internal use only.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001002 &quot;physicalBlockSizeBytes&quot;: &quot;A String&quot;, # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller&#x27;s project.
Bu Sun Kim65020912020-05-20 12:08:20 -07001003 &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.
1004 &quot;replicaZones&quot;: [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1005 &quot;A String&quot;,
1006 ],
1007 &quot;resourcePolicies&quot;: [ # Resource policies applied to this disk for automatic snapshot creations.
1008 &quot;A String&quot;,
1009 ],
1010 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001011 &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 -07001012 #
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001013 # 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 -07001014 &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:
1015 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
1016 # - projects/project/zones/zone/disks/disk
1017 # - zones/zone/disks/disk
1018 &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 -07001019 &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.
1020 #
1021 # 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:
1022 # projects/debian-cloud/global/images/family/debian-9
1023 #
1024 #
1025 # Alternatively, use a specific version of a public operating system image:
1026 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
1027 #
1028 #
1029 # To create a disk with a custom image that you created, specify the image name in the following format:
1030 # global/images/my-custom-image
1031 #
1032 #
1033 # 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:
1034 # global/images/family/my-image-family
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001035 &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 -07001036 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1037 &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.
1038 &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.
1039 &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.
1040 },
1041 &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.
1042 &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:
1043 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1044 # - projects/project/global/snapshots/snapshot
1045 # - global/snapshots/snapshot
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001046 &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 -07001047 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The name of the encryption key that is stored in Google Cloud KMS.
1048 &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.
1049 &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.
1050 &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.
1051 },
1052 &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.
1053 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001054 &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 -07001055 &quot;users&quot;: [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1056 &quot;A String&quot;,
1057 ],
1058 &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.
1059 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001060 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001061 &quot;kind&quot;: &quot;compute#diskList&quot;, # [Output Only] Type of resource. Always compute#diskList for lists of disks.
1062 &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.
1063 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
1064 &quot;warning&quot;: { # [Output Only] Informational warning message.
1065 &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.
1066 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1067 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001068 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001069 &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).
1070 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001071 },
1072 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001073 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001074 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001075 }</pre>
1076</div>
1077
1078<div class="method">
1079 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1080 <pre>Retrieves the next page of results.
1081
1082Args:
1083 previous_request: The request for the previous page. (required)
1084 previous_response: The response from the request for the previous page. (required)
1085
1086Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -07001087 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001088 page. Returns None if there are no more items in the collection.
1089 </pre>
1090</div>
1091
1092<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001093 <code class="details" id="removeResourcePolicies">removeResourcePolicies(project, region, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001094 <pre>Removes resource policies from a regional disk.
1095
1096Args:
1097 project: string, Project ID for this request. (required)
1098 region: string, The name of the region for this request. (required)
1099 disk: string, The disk name for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001100 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001101 The object takes the form of:
1102
1103{
Bu Sun Kim65020912020-05-20 12:08:20 -07001104 &quot;resourcePolicies&quot;: [ # Resource policies to be removed from this disk.
1105 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001106 ],
1107 }
1108
1109 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.
1110
1111For 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.
1112
1113The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1114
1115Returns:
1116 An object of the form:
1117
1118 { # Represents an Operation resource.
1119 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001120 # Google Compute Engine has three Operation resources:
1121 #
1122 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1123 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001124 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1125 #
1126 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001127 # - For global operations, use the `globalOperations` resource.
1128 # - For regional operations, use the `regionOperations` resource.
1129 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001130 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001131 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -07001132 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1133 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1134 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1135 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1136 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1137 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001138 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001139 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1140 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1141 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001142 },
1143 ],
1144 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001145 &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`.
1146 &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.
1147 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1148 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1149 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1150 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1151 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1152 &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.
1153 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1154 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1155 &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.
1156 &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`.
1157 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1158 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1159 &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.
1160 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1161 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1162 {
1163 &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.
1164 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1165 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1166 {
1167 &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).
1168 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1169 },
1170 ],
1171 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1172 },
1173 ],
1174 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001175 }</pre>
1176</div>
1177
1178<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001179 <code class="details" id="resize">resize(project, region, disk, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001180 <pre>Resizes the specified regional persistent disk.
1181
1182Args:
1183 project: string, The project ID for this request. (required)
1184 region: string, Name of the region for this request. (required)
1185 disk: string, Name of the regional persistent disk. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001186 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001187 The object takes the form of:
1188
1189{
Bu Sun Kim65020912020-05-20 12:08:20 -07001190 &quot;sizeGb&quot;: &quot;A String&quot;, # The new size of the regional persistent disk, which is specified in GB.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001191 }
1192
1193 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.
1194
1195For 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.
1196
1197The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1198
1199Returns:
1200 An object of the form:
1201
1202 { # Represents an Operation resource.
1203 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001204 # Google Compute Engine has three Operation resources:
1205 #
1206 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1207 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001208 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1209 #
1210 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001211 # - For global operations, use the `globalOperations` resource.
1212 # - For regional operations, use the `regionOperations` resource.
1213 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001214 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001215 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -07001216 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1217 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1218 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1219 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1220 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1221 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001222 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001223 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1224 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1225 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001226 },
1227 ],
1228 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001229 &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`.
1230 &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.
1231 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1232 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1233 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1234 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1235 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1236 &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.
1237 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1238 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1239 &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.
1240 &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`.
1241 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1242 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1243 &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.
1244 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1245 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1246 {
1247 &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.
1248 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1249 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1250 {
1251 &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).
1252 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1253 },
1254 ],
1255 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1256 },
1257 ],
1258 &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.
1259 }</pre>
1260</div>
1261
1262<div class="method">
1263 <code class="details" id="setIamPolicy">setIamPolicy(project, region, resource, body=None)</code>
1264 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1265
1266Args:
1267 project: string, Project ID for this request. (required)
1268 region: string, The name of the region for this request. (required)
1269 resource: string, Name or id of the resource for this request. (required)
1270 body: object, The request body.
1271 The object takes the form of:
1272
1273{
1274 &quot;bindings&quot;: [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
1275 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001276 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001277 &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.
1278 #
1279 # If the condition evaluates to `true`, then this binding applies to the current request.
1280 #
1281 # 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.
1282 #
1283 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1284 #
1285 # Example (Comparison):
1286 #
1287 # 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;
1288 #
1289 # Example (Equality):
1290 #
1291 # 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;
1292 #
1293 # Example (Logic):
1294 #
1295 # 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;
1296 #
1297 # Example (Data Manipulation):
1298 #
1299 # 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;
1300 #
1301 # 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.
1302 &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.
1303 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1304 &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.
1305 &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.
1306 },
1307 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1308 #
1309 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1310 #
1311 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1312 #
1313 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1314 #
1315 #
1316 #
1317 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1318 #
1319 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1320 #
1321 # * `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.
1322 #
1323 # * `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.
1324 #
1325 # * `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.
1326 #
1327 #
1328 #
1329 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1330 &quot;A String&quot;,
1331 ],
1332 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1333 },
1334 ],
1335 &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.
1336 &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.
1337 #
1338 #
1339 #
1340 # 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.
1341 #
1342 # 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).
1343 #
1344 # **JSON example:**
1345 #
1346 # { &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 }
1347 #
1348 # **YAML example:**
1349 #
1350 # 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
1351 #
1352 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
1353 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
1354 { # 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.
1355 #
1356 # 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.
1357 #
1358 # Example Policy with multiple AuditConfigs:
1359 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001360 # { &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 Kim65020912020-05-20 12:08:20 -07001361 #
1362 # 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.
1363 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
1364 { # Provides the configuration for logging a type of permissions. Example:
1365 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001366 # { &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 -07001367 #
1368 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1369 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1370 &quot;A String&quot;,
1371 ],
1372 &quot;ignoreChildExemptions&quot;: True or False,
1373 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
1374 },
1375 ],
1376 &quot;exemptedMembers&quot;: [
1377 &quot;A String&quot;,
1378 ],
1379 &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.
1380 },
1381 ],
1382 &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.
1383 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001384 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001385 &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.
1386 #
1387 # If the condition evaluates to `true`, then this binding applies to the current request.
1388 #
1389 # 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.
1390 #
1391 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1392 #
1393 # Example (Comparison):
1394 #
1395 # 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;
1396 #
1397 # Example (Equality):
1398 #
1399 # 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;
1400 #
1401 # Example (Logic):
1402 #
1403 # 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;
1404 #
1405 # Example (Data Manipulation):
1406 #
1407 # 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;
1408 #
1409 # 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.
1410 &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.
1411 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1412 &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.
1413 &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.
1414 },
1415 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1416 #
1417 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1418 #
1419 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1420 #
1421 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1422 #
1423 #
1424 #
1425 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1426 #
1427 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1428 #
1429 # * `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.
1430 #
1431 # * `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.
1432 #
1433 # * `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.
1434 #
1435 #
1436 #
1437 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1438 &quot;A String&quot;,
1439 ],
1440 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1441 },
1442 ],
1443 &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.
1444 #
1445 # **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.
1446 &quot;iamOwned&quot;: True or False,
1447 &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.
1448 { # A rule to be applied in a Policy.
1449 &quot;action&quot;: &quot;A String&quot;, # Required
1450 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1451 { # A condition to be met.
1452 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1453 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1454 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1455 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1456 &quot;values&quot;: [ # The objects of the condition.
1457 &quot;A String&quot;,
1458 ],
1459 },
1460 ],
1461 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1462 &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.
1463 &quot;A String&quot;,
1464 ],
1465 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1466 { # Specifies what kind of log the caller must write
1467 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1468 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1469 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1470 },
1471 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1472 },
1473 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1474 #
1475 # 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.
1476 #
1477 # Field names correspond to IAM request parameters and field values are their respective values.
1478 #
1479 # 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.
1480 #
1481 # 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]}
1482 &quot;customFields&quot;: [ # Custom fields.
1483 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1484 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1485 &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.
1486 },
1487 ],
1488 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1489 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1490 },
1491 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1492 &quot;logMode&quot;: &quot;A String&quot;,
1493 },
1494 },
1495 ],
1496 &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.
1497 &quot;A String&quot;,
1498 ],
1499 &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.
1500 &quot;A String&quot;,
1501 ],
1502 },
1503 ],
1504 &quot;version&quot;: 42, # Specifies the format of the policy.
1505 #
1506 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1507 #
1508 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1509 #
1510 # * 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
1511 #
1512 # **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.
1513 #
1514 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1515 #
1516 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1517 },
1518 }
1519
1520
1521Returns:
1522 An object of the form:
1523
1524 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
1525 #
1526 #
1527 #
1528 # 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.
1529 #
1530 # 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).
1531 #
1532 # **JSON example:**
1533 #
1534 # { &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 }
1535 #
1536 # **YAML example:**
1537 #
1538 # 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
1539 #
1540 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
1541 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
1542 { # 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.
1543 #
1544 # 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.
1545 #
1546 # Example Policy with multiple AuditConfigs:
1547 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001548 # { &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 Kim65020912020-05-20 12:08:20 -07001549 #
1550 # 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.
1551 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
1552 { # Provides the configuration for logging a type of permissions. Example:
1553 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001554 # { &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 -07001555 #
1556 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1557 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1558 &quot;A String&quot;,
1559 ],
1560 &quot;ignoreChildExemptions&quot;: True or False,
1561 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
1562 },
1563 ],
1564 &quot;exemptedMembers&quot;: [
1565 &quot;A String&quot;,
1566 ],
1567 &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.
1568 },
1569 ],
1570 &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.
1571 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001572 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001573 &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.
1574 #
1575 # If the condition evaluates to `true`, then this binding applies to the current request.
1576 #
1577 # 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.
1578 #
1579 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1580 #
1581 # Example (Comparison):
1582 #
1583 # 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;
1584 #
1585 # Example (Equality):
1586 #
1587 # 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;
1588 #
1589 # Example (Logic):
1590 #
1591 # 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;
1592 #
1593 # Example (Data Manipulation):
1594 #
1595 # 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;
1596 #
1597 # 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.
1598 &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.
1599 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1600 &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.
1601 &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.
1602 },
1603 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1604 #
1605 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1606 #
1607 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1608 #
1609 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1610 #
1611 #
1612 #
1613 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1614 #
1615 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1616 #
1617 # * `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.
1618 #
1619 # * `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.
1620 #
1621 # * `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.
1622 #
1623 #
1624 #
1625 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1626 &quot;A String&quot;,
1627 ],
1628 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1629 },
1630 ],
1631 &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.
1632 #
1633 # **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.
1634 &quot;iamOwned&quot;: True or False,
1635 &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.
1636 { # A rule to be applied in a Policy.
1637 &quot;action&quot;: &quot;A String&quot;, # Required
1638 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1639 { # A condition to be met.
1640 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1641 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1642 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1643 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1644 &quot;values&quot;: [ # The objects of the condition.
1645 &quot;A String&quot;,
1646 ],
1647 },
1648 ],
1649 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1650 &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.
1651 &quot;A String&quot;,
1652 ],
1653 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1654 { # Specifies what kind of log the caller must write
1655 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1656 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1657 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1658 },
1659 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1660 },
1661 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1662 #
1663 # 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.
1664 #
1665 # Field names correspond to IAM request parameters and field values are their respective values.
1666 #
1667 # 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.
1668 #
1669 # 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]}
1670 &quot;customFields&quot;: [ # Custom fields.
1671 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1672 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1673 &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.
1674 },
1675 ],
1676 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1677 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1678 },
1679 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1680 &quot;logMode&quot;: &quot;A String&quot;,
1681 },
1682 },
1683 ],
1684 &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.
1685 &quot;A String&quot;,
1686 ],
1687 &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.
1688 &quot;A String&quot;,
1689 ],
1690 },
1691 ],
1692 &quot;version&quot;: 42, # Specifies the format of the policy.
1693 #
1694 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1695 #
1696 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1697 #
1698 # * 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
1699 #
1700 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1701 #
1702 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1703 #
1704 # 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 -07001705 }</pre>
1706</div>
1707
1708<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001709 <code class="details" id="setLabels">setLabels(project, region, resource, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001710 <pre>Sets the labels on the target regional disk.
1711
1712Args:
1713 project: string, Project ID for this request. (required)
1714 region: string, The region for this request. (required)
1715 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001716 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001717 The object takes the form of:
1718
1719{
Bu Sun Kim65020912020-05-20 12:08:20 -07001720 &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.
1721 &quot;labels&quot;: { # The labels to set for this resource.
1722 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001723 },
1724 }
1725
1726 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.
1727
1728For 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.
1729
1730The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1731
1732Returns:
1733 An object of the form:
1734
1735 { # Represents an Operation resource.
1736 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001737 # Google Compute Engine has three Operation resources:
1738 #
1739 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1740 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001741 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1742 #
1743 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001744 # - For global operations, use the `globalOperations` resource.
1745 # - For regional operations, use the `regionOperations` resource.
1746 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001747 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001748 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -07001749 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1750 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1751 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1752 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1753 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1754 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001755 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001756 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1757 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1758 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001759 },
1760 ],
1761 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001762 &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`.
1763 &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.
1764 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1765 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1766 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1767 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1768 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1769 &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.
1770 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1771 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1772 &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.
1773 &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`.
1774 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1775 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1776 &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.
1777 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1778 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1779 {
1780 &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.
1781 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1782 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1783 {
1784 &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).
1785 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1786 },
1787 ],
1788 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1789 },
1790 ],
1791 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001792 }</pre>
1793</div>
1794
1795<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001796 <code class="details" id="testIamPermissions">testIamPermissions(project, region, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001797 <pre>Returns permissions that a caller has on the specified resource.
1798
1799Args:
1800 project: string, Project ID for this request. (required)
1801 region: string, The name of the region for this request. (required)
1802 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001803 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001804 The object takes the form of:
1805
1806{
Bu Sun Kim65020912020-05-20 12:08:20 -07001807 &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.
1808 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001809 ],
1810 }
1811
1812
1813Returns:
1814 An object of the form:
1815
1816 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001817 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1818 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001819 ],
1820 }</pre>
1821</div>
1822
1823</body></html>