blob: 54e7108cd7a297ef5b1359c234fb3360e0a4752e [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_v1.html">Compute Engine API</a> . <a href="compute_v1.disks.html">disks</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="#addResourcePolicies">addResourcePolicies(project, zone, disk, body, requestId=None)</a></code></p>
79<p class="firstline">Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.</p>
80<p class="toc_element">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070081 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080082<p class="firstline">Retrieves an aggregated list of persistent disks.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<p class="toc_element">
84 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
85<p class="firstline">Retrieves the next page of results.</p>
86<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None, requestId=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080088<p class="firstline">Creates a snapshot of a specified persistent disk.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 <code><a href="#delete">delete(project, zone, disk, requestId=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070091<p class="firstline">Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
93 <code><a href="#get">get(project, zone, disk)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.</p>
John Asmuth614db982014-04-24 15:46:26 -040095<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070096 <code><a href="#getIamPolicy">getIamPolicy(project, zone, resource)</a></code></p>
97<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
98<p class="toc_element">
99 <code><a href="#insert">insert(project, zone, body, requestId=None, sourceImage=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700100<p class="firstline">Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.</p>
John Asmuth614db982014-04-24 15:46:26 -0400101<p class="toc_element">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700102 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800103<p class="firstline">Retrieves a list of persistent disks contained within the specified zone.</p>
John Asmuth614db982014-04-24 15:46:26 -0400104<p class="toc_element">
105 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
106<p class="firstline">Retrieves the next page of results.</p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700107<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700108 <code><a href="#removeResourcePolicies">removeResourcePolicies(project, zone, disk, body, requestId=None)</a></code></p>
109<p class="firstline">Removes resource policies from a disk.</p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400110<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700111 <code><a href="#resize">resize(project, zone, disk, body, requestId=None)</a></code></p>
112<p class="firstline">Resizes the specified persistent disk. You can only increase the size of the disk.</p>
113<p class="toc_element">
114 <code><a href="#setIamPolicy">setIamPolicy(project, zone, resource, body)</a></code></p>
115<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
116<p class="toc_element">
117 <code><a href="#setLabels">setLabels(project, zone, resource, body, requestId=None)</a></code></p>
118<p class="firstline">Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.</p>
119<p class="toc_element">
120 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p>
121<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
John Asmuth614db982014-04-24 15:46:26 -0400122<h3>Method Details</h3>
123<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124 <code class="details" id="addResourcePolicies">addResourcePolicies(project, zone, disk, body, requestId=None)</code>
125 <pre>Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.
126
127Args:
128 project: string, Project ID for this request. (required)
129 zone: string, The name of the zone for this request. (required)
130 disk: string, The disk name for this request. (required)
131 body: object, The request body. (required)
132 The object takes the form of:
133
134{
135 "resourcePolicies": [ # Resource policies to be added to this disk.
136 "A String",
137 ],
138 }
139
140 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
141
142For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
143
144The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
145
146Returns:
147 An object of the form:
148
149 { # Represents an Operation resource.
150 #
151 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
152 #
153 # Operations can be global, regional or zonal.
154 # - For global operations, use the globalOperations resource.
155 # - For regional operations, use the regionOperations resource.
156 # - For zonal operations, use the zonalOperations resource.
157 #
158 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
159 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
160 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
161 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
162 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
163 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
164 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
165 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
166 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
167 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
168 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
169 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
170 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
171 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
172 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
173 {
174 "message": "A String", # [Output Only] A human-readable description of the warning code.
175 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
176 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
177 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
178 {
179 "value": "A String", # [Output Only] A warning data value corresponding to the key.
180 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
181 },
182 ],
183 },
184 ],
185 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
186 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
187 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
188 "name": "A String", # [Output Only] Name of the resource.
189 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
190 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
191 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
192 {
193 "message": "A String", # [Output Only] An optional, human-readable error message.
194 "code": "A String", # [Output Only] The error type identifier for this error.
195 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
196 },
197 ],
198 },
199 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
200 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
201 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
202 }</pre>
203</div>
204
205<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700206 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800207 <pre>Retrieves an aggregated list of persistent disks.
John Asmuth614db982014-04-24 15:46:26 -0400208
209Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000210 project: string, Project ID for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700211 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
212
213You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
214
215Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400216 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)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800217 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700218 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <.
Takashi Matsuo06694102015-09-11 13:55:40 -0700219
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700220For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.
Takashi Matsuo06694102015-09-11 13:55:40 -0700221
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700222You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800223
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700224To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true).
John Asmuth614db982014-04-24 15:46:26 -0400225
226Returns:
227 An object of the form:
228
229 {
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700230 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
231 "kind": "compute#diskAggregatedList", # [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.
232 "items": { # A list of DisksScopedList resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000233 "a_key": { # [Output Only] Name of the scope containing this set of disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700234 "disks": [ # [Output Only] A list of disks contained in this scope.
235 { # Represents a Persistent Disk resource.
236 #
237 # 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.
238 #
239 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
240 #
241 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for beta.disks ==) (== resource_for v1.disks ==) (== resource_for v1.regionDisks ==) (== resource_for beta.regionDisks ==)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700242 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
243 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
244 "sha256": "A String", # [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 -0700245 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700246 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400247 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
248 "a_key": "A String",
249 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700250 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
251 { # Guest OS features.
252 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
253 },
254 ],
255 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700256 "A String",
257 ],
258 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
259 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700260 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700261 "A String",
262 ],
263 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
264 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700265 # 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).
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700266 #
267 # Customer-supplied encryption keys do not protect access to metadata of the disk.
268 #
269 # 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.
270 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
271 "sha256": "A String", # [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 -0700272 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700273 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700274 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
275 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700276 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700277 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700278 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000279 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
280 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
281 # - projects/project/global/snapshots/snapshot
282 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700283 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800284 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700285 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400286 #
287 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800288 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700289 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
290 "A String",
291 ],
292 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
293 "A String",
294 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700295 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700296 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
297 "A String",
298 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700299 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700301 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
302 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700303 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
304 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700305 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
306 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
307 "sha256": "A String", # [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 -0700308 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700309 },
310 "options": "A String", # Internal use only.
311 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700312 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
313 #
314 # 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:
315 # projects/debian-cloud/global/images/family/debian-9
316 #
317 #
318 # Alternatively, use a specific version of a public operating system image:
319 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
320 #
321 #
322 # To create a disk with a custom image that you created, specify the image name in the following format:
323 # global/images/my-custom-image
324 #
325 #
326 # 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:
327 # global/images/family/my-image-family
John Asmuth614db982014-04-24 15:46:26 -0400328 },
329 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000330 "warning": { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800331 "message": "A String", # [Output Only] A human-readable description of the warning code.
332 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
333 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
334 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400335 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000336 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700337 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
John Asmuth614db982014-04-24 15:46:26 -0400338 },
339 ],
340 },
341 },
342 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700343 "warning": { # [Output Only] Informational warning message.
344 "message": "A String", # [Output Only] A human-readable description of the warning code.
345 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
346 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
347 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
348 {
349 "value": "A String", # [Output Only] A warning data value corresponding to the key.
350 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
351 },
352 ],
353 },
354 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Takashi Matsuo06694102015-09-11 13:55:40 -0700355 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400356 }</pre>
357</div>
358
359<div class="method">
360 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
361 <pre>Retrieves the next page of results.
362
363Args:
364 previous_request: The request for the previous page. (required)
365 previous_response: The response from the request for the previous page. (required)
366
367Returns:
368 A request object that you can call 'execute()' on to request the next
369 page. Returns None if there are no more items in the collection.
370 </pre>
371</div>
372
373<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700374 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None, requestId=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800375 <pre>Creates a snapshot of a specified persistent disk.
John Asmuth614db982014-04-24 15:46:26 -0400376
377Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000378 project: string, Project ID for this request. (required)
379 zone: string, The name of the zone for this request. (required)
380 disk: string, Name of the persistent disk to snapshot. (required)
John Asmuth614db982014-04-24 15:46:26 -0400381 body: object, The request body. (required)
382 The object takes the form of:
383
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700384{ # Represents a Persistent Disk Snapshot resource.
385 #
386 # You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==)
387 "autoCreated": True or False, # [Output Only] Set to true if snapshots are automatically by applying resource policy on the target disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800388 "status": "A String", # [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.
Takashi Matsuo06694102015-09-11 13:55:40 -0700389 "kind": "compute#snapshot", # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700390 "sourceDiskEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
391 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
392 "sha256": "A String", # [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 -0700393 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700394 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700395 "storageBytes": "A String", # [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800396 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
397 "sourceDisk": "A String", # [Output Only] The source disk used to create this snapshot.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700398 "snapshotEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the snapshot using a customer-supplied encryption key.
399 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700400 # 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.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700401 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 # Customer-supplied encryption keys do not protect access to metadata of the snapshot.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700403 #
404 # 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.
405 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
406 "sha256": "A String", # [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 -0700407 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700408 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800409 "storageBytesStatus": "A String", # [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700410 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400411 #
412 # To see the latest fingerprint, make a get() request to retrieve a snapshot.
413 "labels": { # Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.
414 "a_key": "A String",
415 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700416 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Takashi Matsuo06694102015-09-11 13:55:40 -0700417 "diskSizeGb": "A String", # [Output Only] Size of the snapshot, specified in GB.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700418 "storageLocations": [ # GCS bucket storage location of the snapshot (regional or multi-regional).
419 "A String",
420 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800421 "licenses": [ # [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image).
Craig Citro065b5302014-08-14 00:47:23 -0700422 "A String",
423 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700424 "sourceDiskId": "A String", # [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name.
Takashi Matsuo06694102015-09-11 13:55:40 -0700425 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800426 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Takashi Matsuo06694102015-09-11 13:55:40 -0700427 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700428 "licenseCodes": [ # [Output Only] Integer license codes indicating which licenses are attached to this snapshot.
429 "A String",
430 ],
John Asmuth614db982014-04-24 15:46:26 -0400431 }
432
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700433 guestFlush: boolean, [Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).
434 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.
435
436For 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.
437
438The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
John Asmuth614db982014-04-24 15:46:26 -0400439
440Returns:
441 An object of the form:
442
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700443 { # Represents an Operation resource.
444 #
445 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
446 #
447 # Operations can be global, regional or zonal.
448 # - For global operations, use the globalOperations resource.
449 # - For regional operations, use the regionOperations resource.
450 # - For zonal operations, use the zonalOperations resource.
451 #
452 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800453 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700454 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400455 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800456 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700457 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800458 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
459 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000460 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800461 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
462 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
Craig Citroe633be12015-03-02 13:40:36 -0800463 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800464 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
465 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000466 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400467 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800468 "message": "A String", # [Output Only] A human-readable description of the warning code.
469 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
470 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
471 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400472 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000473 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700474 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
John Asmuth614db982014-04-24 15:46:26 -0400475 },
476 ],
477 },
478 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000479 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800480 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
481 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000482 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700483 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000484 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800485 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400486 {
Craig Citroe633be12015-03-02 13:40:36 -0800487 "message": "A String", # [Output Only] An optional, human-readable error message.
488 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700489 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400490 },
491 ],
492 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800493 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700494 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800495 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400496 }</pre>
497</div>
498
499<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700500 <code class="details" id="delete">delete(project, zone, disk, requestId=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700501 <pre>Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.
John Asmuth614db982014-04-24 15:46:26 -0400502
503Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000504 project: string, Project ID for this request. (required)
505 zone: string, The name of the zone for this request. (required)
506 disk: string, Name of the persistent disk to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700507 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.
508
509For 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.
510
511The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
John Asmuth614db982014-04-24 15:46:26 -0400512
513Returns:
514 An object of the form:
515
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700516 { # Represents an Operation resource.
517 #
518 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
519 #
520 # Operations can be global, regional or zonal.
521 # - For global operations, use the globalOperations resource.
522 # - For regional operations, use the regionOperations resource.
523 # - For zonal operations, use the zonalOperations resource.
524 #
525 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800526 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700527 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400528 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800529 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700530 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800531 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
532 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000533 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800534 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
535 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
Craig Citroe633be12015-03-02 13:40:36 -0800536 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800537 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
538 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000539 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400540 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800541 "message": "A String", # [Output Only] A human-readable description of the warning code.
542 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
543 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
544 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400545 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000546 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700547 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
John Asmuth614db982014-04-24 15:46:26 -0400548 },
549 ],
550 },
551 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000552 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800553 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
554 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000555 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700556 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000557 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800558 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400559 {
Craig Citroe633be12015-03-02 13:40:36 -0800560 "message": "A String", # [Output Only] An optional, human-readable error message.
561 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700562 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400563 },
564 ],
565 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800566 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700567 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800568 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400569 }</pre>
570</div>
571
572<div class="method">
573 <code class="details" id="get">get(project, zone, disk)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700574 <pre>Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.
John Asmuth614db982014-04-24 15:46:26 -0400575
576Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000577 project: string, Project ID for this request. (required)
578 zone: string, The name of the zone for this request. (required)
579 disk: string, Name of the persistent disk to return. (required)
John Asmuth614db982014-04-24 15:46:26 -0400580
581Returns:
582 An object of the form:
583
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700584 { # Represents a Persistent Disk resource.
585 #
586 # 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.
587 #
588 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
589 #
590 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for beta.disks ==) (== resource_for v1.disks ==) (== resource_for v1.regionDisks ==) (== resource_for beta.regionDisks ==)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700591 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
592 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
593 "sha256": "A String", # [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 -0700594 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700595 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400596 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
597 "a_key": "A String",
598 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700599 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
600 { # Guest OS features.
601 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
602 },
603 ],
604 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700605 "A String",
606 ],
607 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
608 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700609 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700610 "A String",
611 ],
612 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
613 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700614 # 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).
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700615 #
616 # Customer-supplied encryption keys do not protect access to metadata of the disk.
617 #
618 # 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.
619 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
620 "sha256": "A String", # [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 -0700621 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700622 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700623 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
624 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700625 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700626 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700627 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000628 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
629 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
630 # - projects/project/global/snapshots/snapshot
631 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700632 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800633 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700634 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400635 #
636 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800637 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700638 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
639 "A String",
640 ],
641 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
642 "A String",
643 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700644 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700645 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
646 "A String",
647 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700648 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700649 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700650 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
651 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700652 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
653 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700654 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
655 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
656 "sha256": "A String", # [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 -0700657 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700658 },
659 "options": "A String", # Internal use only.
660 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700661 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
662 #
663 # 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:
664 # projects/debian-cloud/global/images/family/debian-9
665 #
666 #
667 # Alternatively, use a specific version of a public operating system image:
668 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
669 #
670 #
671 # To create a disk with a custom image that you created, specify the image name in the following format:
672 # global/images/my-custom-image
673 #
674 #
675 # 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:
676 # global/images/family/my-image-family
John Asmuth614db982014-04-24 15:46:26 -0400677 }</pre>
678</div>
679
680<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700681 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource)</code>
682 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
683
684Args:
685 project: string, Project ID for this request. (required)
686 zone: string, The name of the zone for this request. (required)
687 resource: string, Name or id of the resource for this request. (required)
688
689Returns:
690 An object of the form:
691
692 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
693 #
694 #
695 #
696 # A `Policy` consists of a list of `bindings`. A `binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.
697 #
698 # **JSON Example**
699 #
700 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] }
701 #
702 # **YAML Example**
703 #
704 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - members: - user:sean@example.com role: roles/viewer
705 #
706 #
707 #
708 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs).
709 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
710 { # 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.
711 #
712 # 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.
713 #
714 # Example Policy with multiple AuditConfigs:
715 #
716 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar@gmail.com" ] } ] } ] }
717 #
718 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging.
719 "exemptedMembers": [
720 "A String",
721 ],
722 "auditLogConfigs": [ # The configuration for logging of each type of permission.
723 { # Provides the configuration for logging a type of permissions. Example:
724 #
725 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] }
726 #
727 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging.
728 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
729 "A String",
730 ],
731 "logType": "A String", # The log type that this config enables.
732 },
733 ],
734 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
735 },
736 ],
737 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
738 { # A rule to be applied in a Policy.
739 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
740 { # Specifies what kind of log the caller must write
741 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
742 #
743 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
744 #
745 # Field names correspond to IAM request parameters and field values are their respective values.
746 #
747 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
748 #
749 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}
750 #
751 # At this time we do not support multiple field names (though this may be supported in the future).
752 "field": "A String", # The field value to attribute.
753 "metric": "A String", # The metric to update.
754 },
755 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
756 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now.
757 },
758 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
759 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
760 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
761 "permissionType": "A String", # The type of the permission that was checked.
762 },
763 },
764 },
765 ],
766 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
767 "A String",
768 ],
769 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
770 "A String",
771 ],
772 "action": "A String", # Required
773 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
774 "A String",
775 ],
776 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
777 { # A condition to be met.
778 "iam": "A String", # Trusted attributes supplied by the IAM system.
779 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
780 "values": [ # The objects of the condition.
781 "A String",
782 ],
783 "svc": "A String", # Trusted attributes discharged by the service.
784 "op": "A String", # An operator to apply the subject with.
785 },
786 ],
787 "description": "A String", # Human-readable description of the rule.
788 },
789 ],
790 "version": 42, # Deprecated.
791 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
792 #
793 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
794 "bindings": [ # Associates a list of `members` to a `role`. `bindings` with no members will result in an error.
795 { # Associates `members` with a `role`.
796 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
797 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
798 #
799 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
800 #
801 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
802 #
803 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` .
804 #
805 #
806 #
807 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
808 #
809 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
810 #
811 #
812 #
813 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
814 "A String",
815 ],
816 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
817 #
818 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0"
819 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
820 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
821 #
822 # The application context of the containing message determines which well-known feature set of CEL is supported.
823 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
824 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
825 },
826 },
827 ],
828 "iamOwned": True or False,
829 }</pre>
830</div>
831
832<div class="method">
833 <code class="details" id="insert">insert(project, zone, body, requestId=None, sourceImage=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700834 <pre>Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.
John Asmuth614db982014-04-24 15:46:26 -0400835
836Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000837 project: string, Project ID for this request. (required)
838 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400839 body: object, The request body. (required)
840 The object takes the form of:
841
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700842{ # Represents a Persistent Disk resource.
843 #
844 # 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.
845 #
846 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
847 #
848 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for beta.disks ==) (== resource_for v1.disks ==) (== resource_for v1.regionDisks ==) (== resource_for beta.regionDisks ==)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700849 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
850 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
851 "sha256": "A String", # [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 -0700852 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700853 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400854 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
855 "a_key": "A String",
856 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700857 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
858 { # Guest OS features.
859 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
860 },
861 ],
862 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700863 "A String",
864 ],
865 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
866 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700867 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700868 "A String",
869 ],
870 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
871 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700872 # 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).
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700873 #
874 # Customer-supplied encryption keys do not protect access to metadata of the disk.
875 #
876 # 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.
877 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
878 "sha256": "A String", # [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 -0700879 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700880 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700881 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
882 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700883 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700884 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700885 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000886 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
887 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
888 # - projects/project/global/snapshots/snapshot
889 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700890 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800891 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700892 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400893 #
894 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800895 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700896 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
897 "A String",
898 ],
899 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
900 "A String",
901 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700902 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700903 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
904 "A String",
905 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700906 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700907 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700908 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
909 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700910 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
911 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700912 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
913 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
914 "sha256": "A String", # [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 -0700915 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700916 },
917 "options": "A String", # Internal use only.
918 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700919 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
920 #
921 # 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:
922 # projects/debian-cloud/global/images/family/debian-9
923 #
924 #
925 # Alternatively, use a specific version of a public operating system image:
926 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
927 #
928 #
929 # To create a disk with a custom image that you created, specify the image name in the following format:
930 # global/images/my-custom-image
931 #
932 #
933 # 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:
934 # global/images/family/my-image-family
John Asmuth614db982014-04-24 15:46:26 -0400935 }
936
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700937 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.
938
939For 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.
940
941The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
John Asmuth614db982014-04-24 15:46:26 -0400942 sourceImage: string, Optional. Source image to restore onto a disk.
943
944Returns:
945 An object of the form:
946
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700947 { # Represents an Operation resource.
948 #
949 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
950 #
951 # Operations can be global, regional or zonal.
952 # - For global operations, use the globalOperations resource.
953 # - For regional operations, use the regionOperations resource.
954 # - For zonal operations, use the zonalOperations resource.
955 #
956 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800957 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700958 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400959 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800960 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700961 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800962 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
963 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000964 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800965 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
966 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
Craig Citroe633be12015-03-02 13:40:36 -0800967 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800968 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
969 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000970 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400971 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800972 "message": "A String", # [Output Only] A human-readable description of the warning code.
973 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
974 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
975 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400976 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000977 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700978 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
John Asmuth614db982014-04-24 15:46:26 -0400979 },
980 ],
981 },
982 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000983 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800984 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
985 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000986 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700987 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000988 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800989 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400990 {
Craig Citroe633be12015-03-02 13:40:36 -0800991 "message": "A String", # [Output Only] An optional, human-readable error message.
992 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700993 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400994 },
995 ],
996 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800997 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700998 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800999 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -04001000 }</pre>
1001</div>
1002
1003<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001004 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001005 <pre>Retrieves a list of persistent disks contained within the specified zone.
John Asmuth614db982014-04-24 15:46:26 -04001006
1007Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001008 project: string, Project ID for this request. (required)
1009 zone: string, The name of the zone for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001010 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1011
1012You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
1013
1014Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001015 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)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001016 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001017 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <.
Takashi Matsuo06694102015-09-11 13:55:40 -07001018
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001019For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.
Takashi Matsuo06694102015-09-11 13:55:40 -07001020
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001021You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001022
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001023To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true).
John Asmuth614db982014-04-24 15:46:26 -04001024
1025Returns:
1026 An object of the form:
1027
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001028 { # A list of Disk resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001029 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
1030 "kind": "compute#diskList", # [Output Only] Type of resource. Always compute#diskList for lists of disks.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001031 "items": [ # A list of Disk resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001032 { # Represents a Persistent Disk resource.
1033 #
1034 # 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.
1035 #
1036 # The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks.
1037 #
1038 # The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for beta.disks ==) (== resource_for v1.disks ==) (== resource_for v1.regionDisks ==) (== resource_for beta.regionDisks ==)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001039 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
1040 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1041 "sha256": "A String", # [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 -07001042 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001043 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001044 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
1045 "a_key": "A String",
1046 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001047 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
1048 { # Guest OS features.
1049 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
1050 },
1051 ],
1052 "licenses": [ # A list of publicly visible licenses. Reserved for Google's use.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001053 "A String",
1054 ],
1055 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
1056 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001057 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this disk.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001058 "A String",
1059 ],
1060 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
1061 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001062 # 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).
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001063 #
1064 # Customer-supplied encryption keys do not protect access to metadata of the disk.
1065 #
1066 # 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.
1067 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1068 "sha256": "A String", # [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 -07001069 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001070 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001071 "zone": "A String", # [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
1072 "physicalBlockSizeBytes": "A String", # Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001073 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001074 "type": "A String", # URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001075 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001076 "sourceSnapshot": "A String", # The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
1077 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
1078 # - projects/project/global/snapshots/snapshot
1079 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -07001080 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001081 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001082 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001083 #
1084 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001085 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001086 "resourcePolicies": [ # Resource policies applied to this disk for automatic snapshot creations.
1087 "A String",
1088 ],
1089 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
1090 "A String",
1091 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001092 "sourceSnapshotId": "A String", # [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001093 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
1094 "A String",
1095 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001096 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001097 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001098 "sizeGb": "A String", # Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.
1099 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001100 # If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot. Acceptable values are 1 to 65536, inclusive.
1101 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001102 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
1103 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
1104 "sha256": "A String", # [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 -07001105 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001106 },
1107 "options": "A String", # Internal use only.
1108 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001109 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
1110 #
1111 # 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:
1112 # projects/debian-cloud/global/images/family/debian-9
1113 #
1114 #
1115 # Alternatively, use a specific version of a public operating system image:
1116 # projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
1117 #
1118 #
1119 # To create a disk with a custom image that you created, specify the image name in the following format:
1120 # global/images/my-custom-image
1121 #
1122 #
1123 # 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:
1124 # global/images/family/my-image-family
John Asmuth614db982014-04-24 15:46:26 -04001125 },
1126 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001127 "warning": { # [Output Only] Informational warning message.
1128 "message": "A String", # [Output Only] A human-readable description of the warning code.
1129 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1130 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1131 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1132 {
1133 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1134 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1135 },
1136 ],
1137 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001138 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Takashi Matsuo06694102015-09-11 13:55:40 -07001139 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -04001140 }</pre>
1141</div>
1142
1143<div class="method">
1144 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1145 <pre>Retrieves the next page of results.
1146
1147Args:
1148 previous_request: The request for the previous page. (required)
1149 previous_response: The response from the request for the previous page. (required)
1150
1151Returns:
1152 A request object that you can call 'execute()' on to request the next
1153 page. Returns None if there are no more items in the collection.
1154 </pre>
1155</div>
1156
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001157<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001158 <code class="details" id="removeResourcePolicies">removeResourcePolicies(project, zone, disk, body, requestId=None)</code>
1159 <pre>Removes resource policies from a disk.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001160
1161Args:
1162 project: string, Project ID for this request. (required)
1163 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001164 disk: string, The disk name for this request. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001165 body: object, The request body. (required)
1166 The object takes the form of:
1167
1168{
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001169 "resourcePolicies": [ # Resource policies to be removed from this disk.
1170 "A String",
1171 ],
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001172 }
1173
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001174 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.
1175
1176For 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.
1177
1178The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001179
1180Returns:
1181 An object of the form:
1182
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001183 { # Represents an Operation resource.
1184 #
1185 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1186 #
1187 # Operations can be global, regional or zonal.
1188 # - For global operations, use the globalOperations resource.
1189 # - For regional operations, use the regionOperations resource.
1190 # - For zonal operations, use the zonalOperations resource.
1191 #
1192 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001193 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001194 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001195 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001196 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001197 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001198 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1199 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1200 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1201 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
1202 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
1203 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1204 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1205 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1206 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1207 {
1208 "message": "A String", # [Output Only] A human-readable description of the warning code.
1209 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1210 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1211 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1212 {
1213 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1214 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1215 },
1216 ],
1217 },
1218 ],
1219 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1220 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1221 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1222 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001223 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001224 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1225 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1226 {
1227 "message": "A String", # [Output Only] An optional, human-readable error message.
1228 "code": "A String", # [Output Only] The error type identifier for this error.
1229 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1230 },
1231 ],
1232 },
1233 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1234 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001235 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001236 }</pre>
1237</div>
1238
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001239<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001240 <code class="details" id="resize">resize(project, zone, disk, body, requestId=None)</code>
1241 <pre>Resizes the specified persistent disk. You can only increase the size of the disk.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001242
1243Args:
1244 project: string, Project ID for this request. (required)
1245 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001246 disk: string, The name of the persistent disk. (required)
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001247 body: object, The request body. (required)
1248 The object takes the form of:
1249
1250{
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001251 "sizeGb": "A String", # The new size of the persistent disk, which is specified in GB.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001252 }
1253
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001254 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.
1255
1256For 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.
1257
1258The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001259
1260Returns:
1261 An object of the form:
1262
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001263 { # Represents an Operation resource.
1264 #
1265 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1266 #
1267 # Operations can be global, regional or zonal.
1268 # - For global operations, use the globalOperations resource.
1269 # - For regional operations, use the regionOperations resource.
1270 # - For zonal operations, use the zonalOperations resource.
1271 #
1272 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001273 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001274 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001275 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
1276 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001277 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001278 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1279 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1280 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1281 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
1282 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
1283 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1284 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1285 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1286 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1287 {
1288 "message": "A String", # [Output Only] A human-readable description of the warning code.
1289 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1290 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1291 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1292 {
1293 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1294 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1295 },
1296 ],
1297 },
1298 ],
1299 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1300 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1301 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1302 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001303 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001304 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1305 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1306 {
1307 "message": "A String", # [Output Only] An optional, human-readable error message.
1308 "code": "A String", # [Output Only] The error type identifier for this error.
1309 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1310 },
1311 ],
1312 },
1313 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1314 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1315 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
1316 }</pre>
1317</div>
1318
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001319<div class="method">
1320 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body)</code>
1321 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1322
1323Args:
1324 project: string, Project ID for this request. (required)
1325 zone: string, The name of the zone for this request. (required)
1326 resource: string, Name or id of the resource for this request. (required)
1327 body: object, The request body. (required)
1328 The object takes the form of:
1329
1330{
1331 "policy": { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. # REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them.
1332 #
1333 #
1334 #
1335 # A `Policy` consists of a list of `bindings`. A `binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.
1336 #
1337 # **JSON Example**
1338 #
1339 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] }
1340 #
1341 # **YAML Example**
1342 #
1343 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - members: - user:sean@example.com role: roles/viewer
1344 #
1345 #
1346 #
1347 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs).
1348 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
1349 { # 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.
1350 #
1351 # 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.
1352 #
1353 # Example Policy with multiple AuditConfigs:
1354 #
1355 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar@gmail.com" ] } ] } ] }
1356 #
1357 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging.
1358 "exemptedMembers": [
1359 "A String",
1360 ],
1361 "auditLogConfigs": [ # The configuration for logging of each type of permission.
1362 { # Provides the configuration for logging a type of permissions. Example:
1363 #
1364 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] }
1365 #
1366 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging.
1367 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1368 "A String",
1369 ],
1370 "logType": "A String", # The log type that this config enables.
1371 },
1372 ],
1373 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
1374 },
1375 ],
1376 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1377 { # A rule to be applied in a Policy.
1378 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1379 { # Specifies what kind of log the caller must write
1380 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
1381 #
1382 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
1383 #
1384 # Field names correspond to IAM request parameters and field values are their respective values.
1385 #
1386 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
1387 #
1388 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}
1389 #
1390 # At this time we do not support multiple field names (though this may be supported in the future).
1391 "field": "A String", # The field value to attribute.
1392 "metric": "A String", # The metric to update.
1393 },
1394 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
1395 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now.
1396 },
1397 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
1398 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
1399 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1400 "permissionType": "A String", # The type of the permission that was checked.
1401 },
1402 },
1403 },
1404 ],
1405 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1406 "A String",
1407 ],
1408 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1409 "A String",
1410 ],
1411 "action": "A String", # Required
1412 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1413 "A String",
1414 ],
1415 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1416 { # A condition to be met.
1417 "iam": "A String", # Trusted attributes supplied by the IAM system.
1418 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1419 "values": [ # The objects of the condition.
1420 "A String",
1421 ],
1422 "svc": "A String", # Trusted attributes discharged by the service.
1423 "op": "A String", # An operator to apply the subject with.
1424 },
1425 ],
1426 "description": "A String", # Human-readable description of the rule.
1427 },
1428 ],
1429 "version": 42, # Deprecated.
1430 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1431 #
1432 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
1433 "bindings": [ # Associates a list of `members` to a `role`. `bindings` with no members will result in an error.
1434 { # Associates `members` with a `role`.
1435 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1436 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1437 #
1438 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1439 #
1440 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1441 #
1442 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` .
1443 #
1444 #
1445 #
1446 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1447 #
1448 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1449 #
1450 #
1451 #
1452 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1453 "A String",
1454 ],
1455 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
1456 #
1457 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0"
1458 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1459 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
1460 #
1461 # The application context of the containing message determines which well-known feature set of CEL is supported.
1462 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1463 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1464 },
1465 },
1466 ],
1467 "iamOwned": True or False,
1468 },
1469 "bindings": [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings.
1470 { # Associates `members` with a `role`.
1471 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1472 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1473 #
1474 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1475 #
1476 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1477 #
1478 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` .
1479 #
1480 #
1481 #
1482 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1483 #
1484 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1485 #
1486 #
1487 #
1488 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1489 "A String",
1490 ],
1491 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
1492 #
1493 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0"
1494 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1495 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
1496 #
1497 # The application context of the containing message determines which well-known feature set of CEL is supported.
1498 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1499 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1500 },
1501 },
1502 ],
1503 "etag": "A String", # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag.
1504 }
1505
1506
1507Returns:
1508 An object of the form:
1509
1510 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.
1511 #
1512 #
1513 #
1514 # A `Policy` consists of a list of `bindings`. A `binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.
1515 #
1516 # **JSON Example**
1517 #
1518 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { "role": "roles/viewer", "members": ["user:sean@example.com"] } ] }
1519 #
1520 # **YAML Example**
1521 #
1522 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - members: - user:sean@example.com role: roles/viewer
1523 #
1524 #
1525 #
1526 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam/docs).
1527 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
1528 { # 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.
1529 #
1530 # 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.
1531 #
1532 # Example Policy with multiple AuditConfigs:
1533 #
1534 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar@gmail.com" ] } ] } ] }
1535 #
1536 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE logging.
1537 "exemptedMembers": [
1538 "A String",
1539 ],
1540 "auditLogConfigs": [ # The configuration for logging of each type of permission.
1541 { # Provides the configuration for logging a type of permissions. Example:
1542 #
1543 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", } ] }
1544 #
1545 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ logging.
1546 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1547 "A String",
1548 ],
1549 "logType": "A String", # The log type that this config enables.
1550 },
1551 ],
1552 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
1553 },
1554 ],
1555 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1556 { # A rule to be applied in a Policy.
1557 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1558 { # Specifies what kind of log the caller must write
1559 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
1560 #
1561 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
1562 #
1563 # Field names correspond to IAM request parameters and field values are their respective values.
1564 #
1565 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
1566 #
1567 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/backend_debug_access_count {iam_principal=[value of IAMContext.principal]}
1568 #
1569 # At this time we do not support multiple field names (though this may be supported in the future).
1570 "field": "A String", # The field value to attribute.
1571 "metric": "A String", # The metric to update.
1572 },
1573 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
1574 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now.
1575 },
1576 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
1577 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
1578 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1579 "permissionType": "A String", # The type of the permission that was checked.
1580 },
1581 },
1582 },
1583 ],
1584 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1585 "A String",
1586 ],
1587 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1588 "A String",
1589 ],
1590 "action": "A String", # Required
1591 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1592 "A String",
1593 ],
1594 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1595 { # A condition to be met.
1596 "iam": "A String", # Trusted attributes supplied by the IAM system.
1597 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1598 "values": [ # The objects of the condition.
1599 "A String",
1600 ],
1601 "svc": "A String", # Trusted attributes discharged by the service.
1602 "op": "A String", # An operator to apply the subject with.
1603 },
1604 ],
1605 "description": "A String", # Human-readable description of the rule.
1606 },
1607 ],
1608 "version": 42, # Deprecated.
1609 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1610 #
1611 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly.
1612 "bindings": [ # Associates a list of `members` to a `role`. `bindings` with no members will result in an error.
1613 { # Associates `members` with a `role`.
1614 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1615 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1616 #
1617 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1618 #
1619 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1620 #
1621 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` .
1622 #
1623 #
1624 #
1625 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1626 #
1627 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1628 #
1629 #
1630 #
1631 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1632 "A String",
1633 ],
1634 "condition": { # Represents an expression text. Example: # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
1635 #
1636 # title: "User account presence" description: "Determines whether the request has a user account" expression: "size(request.user) > 0"
1637 "title": "A String", # An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
1638 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
1639 #
1640 # The application context of the containing message determines which well-known feature set of CEL is supported.
1641 "description": "A String", # An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1642 "location": "A String", # An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1643 },
1644 },
1645 ],
1646 "iamOwned": True or False,
1647 }</pre>
1648</div>
1649
1650<div class="method">
1651 <code class="details" id="setLabels">setLabels(project, zone, resource, body, requestId=None)</code>
1652 <pre>Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.
1653
1654Args:
1655 project: string, Project ID for this request. (required)
1656 zone: string, The name of the zone for this request. (required)
1657 resource: string, Name or id of the resource for this request. (required)
1658 body: object, The request body. (required)
1659 The object takes the form of:
1660
1661{
1662 "labelFingerprint": "A String", # The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint.
1663 "labels": { # The labels to set for this resource.
1664 "a_key": "A String",
1665 },
1666 }
1667
1668 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.
1669
1670For 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.
1671
1672The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1673
1674Returns:
1675 An object of the form:
1676
1677 { # Represents an Operation resource.
1678 #
1679 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1680 #
1681 # Operations can be global, regional or zonal.
1682 # - For global operations, use the globalOperations resource.
1683 # - For regional operations, use the regionOperations resource.
1684 # - For zonal operations, use the zonalOperations resource.
1685 #
1686 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
1687 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1688 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1689 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
1690 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1691 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
1692 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1693 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
1694 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
1695 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
1696 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not found.
1697 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
1698 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
1699 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1700 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1701 {
1702 "message": "A String", # [Output Only] A human-readable description of the warning code.
1703 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1704 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1705 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1706 {
1707 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1708 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1709 },
1710 ],
1711 },
1712 ],
1713 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
1714 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1715 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
1716 "name": "A String", # [Output Only] Name of the resource.
1717 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1718 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1719 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1720 {
1721 "message": "A String", # [Output Only] An optional, human-readable error message.
1722 "code": "A String", # [Output Only] The error type identifier for this error.
1723 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1724 },
1725 ],
1726 },
1727 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1728 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1729 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
1730 }</pre>
1731</div>
1732
1733<div class="method">
1734 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code>
1735 <pre>Returns permissions that a caller has on the specified resource.
1736
1737Args:
1738 project: string, Project ID for this request. (required)
1739 zone: string, The name of the zone for this request. (required)
1740 resource: string, Name or id of the resource for this request. (required)
1741 body: object, The request body. (required)
1742 The object takes the form of:
1743
1744{
1745 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
1746 "A String",
1747 ],
1748 }
1749
1750
1751Returns:
1752 An object of the form:
1753
1754 {
1755 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1756 "A String",
1757 ],
1758 }</pre>
1759</div>
1760
John Asmuth614db982014-04-24 15:46:26 -04001761</body></html>