blob: 19c83183ba7e13fa88de1e6952d619468667f2c5 [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.disks.html">disks</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
79<p class="firstline">Retrieves an aggregated list of persistent disks.</p>
80<p class="toc_element">
81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
82<p class="firstline">Retrieves the next page of results.</p>
83<p class="toc_element">
84 <code><a href="#createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None)</a></code></p>
85<p class="firstline">Creates a snapshot of a specified persistent disk.</p>
86<p class="toc_element">
87 <code><a href="#delete">delete(project, zone, disk)</a></code></p>
88<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>
89<p class="toc_element">
90 <code><a href="#get">get(project, zone, disk)</a></code></p>
91<p class="firstline">Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.</p>
92<p class="toc_element">
93 <code><a href="#insert">insert(project, zone, body, sourceImage=None)</a></code></p>
94<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>
95<p class="toc_element">
96 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
97<p class="firstline">Retrieves a list of persistent disks contained within the specified zone.</p>
98<p class="toc_element">
99 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
100<p class="firstline">Retrieves the next page of results.</p>
101<p class="toc_element">
102 <code><a href="#resize">resize(project, zone, disk, body)</a></code></p>
103<p class="firstline">Resizes the specified persistent disk.</p>
104<p class="toc_element">
105 <code><a href="#setLabels">setLabels(project, zone, resource, body)</a></code></p>
106<p class="firstline">Sets the labels on a disk. To learn more about labels, read the Labeling or Tagging Resources documentation.</p>
107<p class="toc_element">
108 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p>
109<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
110<h3>Method Details</h3>
111<div class="method">
112 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
113 <pre>Retrieves an aggregated list of persistent disks.
114
115Args:
116 project: string, Project ID for this request. (required)
117 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
118
119You 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.
120
121Currently, only sorting by name or creationTimestamp desc is supported.
122 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.
123 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.
124 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.
125
126The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.
127
128For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
129
130You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.
131
132To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
133
134Returns:
135 An object of the form:
136
137 {
138 "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.
139 "items": { # [Output Only] A map of scoped disk lists.
140 "a_key": { # [Output Only] Name of the scope containing this set of disks.
141 "disks": [ # [Output Only] List of disks contained in this scope.
142 { # A Disk resource.
143 "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.
144 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
145 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
146 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
147 #
148 # The key must meet the following requirements before you can provide it to Compute Engine:
149 # - The key is wrapped using a RSA public key certificate provided by Google.
150 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
151 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
152 },
153 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
154 "a_key": "A String",
155 },
156 "licenses": [ # Any applicable publicly visible licenses.
157 "A String",
158 ],
159 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
160 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
161 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
162 "A String",
163 ],
164 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
165 #
166 # 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 or an image, or to attach the disk to a virtual machine).
167 #
168 # Customer-supplied encryption keys do not protect access to metadata of the disk.
169 #
170 # 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.
171 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
172 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
173 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
174 #
175 # The key must meet the following requirements before you can provide it to Compute Engine:
176 # - The key is wrapped using a RSA public key certificate provided by Google.
177 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
178 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
179 },
180 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
181 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
182 "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.
183 "status": "A String", # [Output Only] The status of disk creation.
184 "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:
185 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
186 # - projects/project/global/snapshots/snapshot
187 # - global/snapshots/snapshot
188 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
189 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
190 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
191 "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.
192 #
193 # To see the latest fingerprint, make a get() request to retrieve a disk.
194 "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.
195 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
196 "A String",
197 ],
198 "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.
199 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
200 "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.
201 "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.
202 #
203 # 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.
204 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources.
205 "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.
206 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
207 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
208 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
209 #
210 # The key must meet the following requirements before you can provide it to Compute Engine:
211 # - The key is wrapped using a RSA public key certificate provided by Google.
212 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
213 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
214 },
215 "options": "A String", # Internal use only.
216 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
217 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
218 #
219 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
220 #
221 # projects/debian-cloud/global/images/family/debian-8
222 #
223 # Alternatively, use a specific version of a public operating system image:
224 #
225 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
226 #
227 # To create a disk with a private image that you created, specify the image name in the following format:
228 #
229 # global/images/my-private-image
230 #
231 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
232 #
233 # global/images/family/my-private-family
234 },
235 ],
236 "warning": { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
237 "message": "A String", # [Output Only] A human-readable description of the warning code.
238 "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.
239 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
240 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
241 {
242 "value": "A String", # [Output Only] A warning data value corresponding to the key.
243 "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).
244 },
245 ],
246 },
247 },
248 },
249 "kind": "compute#diskAggregatedList", # [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.
250 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
251 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
252 }</pre>
253</div>
254
255<div class="method">
256 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
257 <pre>Retrieves the next page of results.
258
259Args:
260 previous_request: The request for the previous page. (required)
261 previous_response: The response from the request for the previous page. (required)
262
263Returns:
264 A request object that you can call 'execute()' on to request the next
265 page. Returns None if there are no more items in the collection.
266 </pre>
267</div>
268
269<div class="method">
270 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None)</code>
271 <pre>Creates a snapshot of a specified persistent disk.
272
273Args:
274 project: string, Project ID for this request. (required)
275 zone: string, The name of the zone for this request. (required)
276 disk: string, Name of the persistent disk to snapshot. (required)
277 body: object, The request body. (required)
278 The object takes the form of:
279
280{ # A persistent disk snapshot resource.
281 "status": "A String", # [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.
282 "kind": "compute#snapshot", # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
283 "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.
284 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
285 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
286 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
287 #
288 # The key must meet the following requirements before you can provide it to Compute Engine:
289 # - The key is wrapped using a RSA public key certificate provided by Google.
290 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
291 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
292 },
293 "storageBytes": "A String", # [Output Only] A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.
294 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
295 "sourceDisk": "A String", # [Output Only] The source disk used to create this snapshot.
296 "snapshotEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the snapshot using a customer-supplied encryption key.
297 #
298 # After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the image later For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request.
299 #
300 # Customer-supplied encryption keys do not protect access to metadata of the disk.
301 #
302 # 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.
303 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
304 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
305 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
306 #
307 # The key must meet the following requirements before you can provide it to Compute Engine:
308 # - The key is wrapped using a RSA public key certificate provided by Google.
309 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
310 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
311 },
312 "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.
313 "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.
314 #
315 # To see the latest fingerprint, make a get() request to retrieve a snapshot.
316 "labels": { # Labels to apply to this snapshot. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
317 "a_key": "A String",
318 },
319 "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.
320 "diskSizeGb": "A String", # [Output Only] Size of the snapshot, specified in GB.
321 "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).
322 "A String",
323 ],
324 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
325 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
326 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
327 "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.
328 }
329
330 guestFlush: boolean, A parameter
331
332Returns:
333 An object of the form:
334
335 { # An Operation resource, used to manage asynchronous API requests.
336 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
337 "clientOperationId": "A String", # [Output Only] Reserved for future use.
338 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
339 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
340 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
341 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
342 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
343 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
344 "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.
345 "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.
346 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
347 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
348 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
349 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
350 {
351 "message": "A String", # [Output Only] A human-readable description of the warning code.
352 "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.
353 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
354 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
355 {
356 "value": "A String", # [Output Only] A warning data value corresponding to the key.
357 "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).
358 },
359 ],
360 },
361 ],
362 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
363 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
364 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
365 "name": "A String", # [Output Only] Name of the resource.
366 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
367 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
368 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
369 {
370 "message": "A String", # [Output Only] An optional, human-readable error message.
371 "code": "A String", # [Output Only] The error type identifier for this error.
372 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
373 },
374 ],
375 },
376 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
377 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800378 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700379 }</pre>
380</div>
381
382<div class="method">
383 <code class="details" id="delete">delete(project, zone, disk)</code>
384 <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.
385
386Args:
387 project: string, Project ID for this request. (required)
388 zone: string, The name of the zone for this request. (required)
389 disk: string, Name of the persistent disk to delete. (required)
390
391Returns:
392 An object of the form:
393
394 { # An Operation resource, used to manage asynchronous API requests.
395 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
396 "clientOperationId": "A String", # [Output Only] Reserved for future use.
397 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
398 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
399 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
400 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
401 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
402 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
403 "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.
404 "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.
405 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
406 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
407 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
408 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
409 {
410 "message": "A String", # [Output Only] A human-readable description of the warning code.
411 "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.
412 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
413 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
414 {
415 "value": "A String", # [Output Only] A warning data value corresponding to the key.
416 "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).
417 },
418 ],
419 },
420 ],
421 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
422 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
423 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
424 "name": "A String", # [Output Only] Name of the resource.
425 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
426 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
427 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
428 {
429 "message": "A String", # [Output Only] An optional, human-readable error message.
430 "code": "A String", # [Output Only] The error type identifier for this error.
431 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
432 },
433 ],
434 },
435 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
436 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800437 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700438 }</pre>
439</div>
440
441<div class="method">
442 <code class="details" id="get">get(project, zone, disk)</code>
443 <pre>Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.
444
445Args:
446 project: string, Project ID for this request. (required)
447 zone: string, The name of the zone for this request. (required)
448 disk: string, Name of the persistent disk to return. (required)
449
450Returns:
451 An object of the form:
452
453 { # A Disk resource.
454 "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.
455 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
456 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
457 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
458 #
459 # The key must meet the following requirements before you can provide it to Compute Engine:
460 # - The key is wrapped using a RSA public key certificate provided by Google.
461 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
462 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
463 },
464 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
465 "a_key": "A String",
466 },
467 "licenses": [ # Any applicable publicly visible licenses.
468 "A String",
469 ],
470 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
471 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
472 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
473 "A String",
474 ],
475 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
476 #
477 # 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 or an image, or to attach the disk to a virtual machine).
478 #
479 # Customer-supplied encryption keys do not protect access to metadata of the disk.
480 #
481 # 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.
482 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
483 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
484 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
485 #
486 # The key must meet the following requirements before you can provide it to Compute Engine:
487 # - The key is wrapped using a RSA public key certificate provided by Google.
488 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
489 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
490 },
491 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
492 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
493 "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.
494 "status": "A String", # [Output Only] The status of disk creation.
495 "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:
496 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
497 # - projects/project/global/snapshots/snapshot
498 # - global/snapshots/snapshot
499 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
500 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
501 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
502 "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.
503 #
504 # To see the latest fingerprint, make a get() request to retrieve a disk.
505 "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.
506 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
507 "A String",
508 ],
509 "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.
510 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
511 "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.
512 "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.
513 #
514 # 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.
515 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources.
516 "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.
517 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
518 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
519 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
520 #
521 # The key must meet the following requirements before you can provide it to Compute Engine:
522 # - The key is wrapped using a RSA public key certificate provided by Google.
523 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
524 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
525 },
526 "options": "A String", # Internal use only.
527 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
528 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
529 #
530 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
531 #
532 # projects/debian-cloud/global/images/family/debian-8
533 #
534 # Alternatively, use a specific version of a public operating system image:
535 #
536 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
537 #
538 # To create a disk with a private image that you created, specify the image name in the following format:
539 #
540 # global/images/my-private-image
541 #
542 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
543 #
544 # global/images/family/my-private-family
545 }</pre>
546</div>
547
548<div class="method">
549 <code class="details" id="insert">insert(project, zone, body, sourceImage=None)</code>
550 <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.
551
552Args:
553 project: string, Project ID for this request. (required)
554 zone: string, The name of the zone for this request. (required)
555 body: object, The request body. (required)
556 The object takes the form of:
557
558{ # A Disk resource.
559 "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.
560 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
561 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
562 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
563 #
564 # The key must meet the following requirements before you can provide it to Compute Engine:
565 # - The key is wrapped using a RSA public key certificate provided by Google.
566 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
567 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
568 },
569 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
570 "a_key": "A String",
571 },
572 "licenses": [ # Any applicable publicly visible licenses.
573 "A String",
574 ],
575 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
576 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
577 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
578 "A String",
579 ],
580 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
581 #
582 # 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 or an image, or to attach the disk to a virtual machine).
583 #
584 # Customer-supplied encryption keys do not protect access to metadata of the disk.
585 #
586 # 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.
587 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
588 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
589 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
590 #
591 # The key must meet the following requirements before you can provide it to Compute Engine:
592 # - The key is wrapped using a RSA public key certificate provided by Google.
593 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
594 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
595 },
596 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
597 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
598 "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.
599 "status": "A String", # [Output Only] The status of disk creation.
600 "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:
601 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
602 # - projects/project/global/snapshots/snapshot
603 # - global/snapshots/snapshot
604 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
605 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
606 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
607 "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.
608 #
609 # To see the latest fingerprint, make a get() request to retrieve a disk.
610 "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.
611 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
612 "A String",
613 ],
614 "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.
615 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
616 "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.
617 "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.
618 #
619 # 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.
620 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources.
621 "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.
622 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
623 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
624 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
625 #
626 # The key must meet the following requirements before you can provide it to Compute Engine:
627 # - The key is wrapped using a RSA public key certificate provided by Google.
628 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
629 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
630 },
631 "options": "A String", # Internal use only.
632 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
633 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
634 #
635 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
636 #
637 # projects/debian-cloud/global/images/family/debian-8
638 #
639 # Alternatively, use a specific version of a public operating system image:
640 #
641 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
642 #
643 # To create a disk with a private image that you created, specify the image name in the following format:
644 #
645 # global/images/my-private-image
646 #
647 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
648 #
649 # global/images/family/my-private-family
650 }
651
652 sourceImage: string, Optional. Source image to restore onto a disk.
653
654Returns:
655 An object of the form:
656
657 { # An Operation resource, used to manage asynchronous API requests.
658 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
659 "clientOperationId": "A String", # [Output Only] Reserved for future use.
660 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
661 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
662 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
663 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
664 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
665 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
666 "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.
667 "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.
668 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
669 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
670 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
671 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
672 {
673 "message": "A String", # [Output Only] A human-readable description of the warning code.
674 "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.
675 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
676 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
677 {
678 "value": "A String", # [Output Only] A warning data value corresponding to the key.
679 "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).
680 },
681 ],
682 },
683 ],
684 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
685 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
686 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
687 "name": "A String", # [Output Only] Name of the resource.
688 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
689 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
690 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
691 {
692 "message": "A String", # [Output Only] An optional, human-readable error message.
693 "code": "A String", # [Output Only] The error type identifier for this error.
694 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
695 },
696 ],
697 },
698 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
699 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800700 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700701 }</pre>
702</div>
703
704<div class="method">
705 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
706 <pre>Retrieves a list of persistent disks contained within the specified zone.
707
708Args:
709 project: string, Project ID for this request. (required)
710 zone: string, The name of the zone for this request. (required)
711 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
712
713You 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.
714
715Currently, only sorting by name or creationTimestamp desc is supported.
716 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.
717 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.
718 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.
719
720The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.
721
722For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
723
724You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.
725
726To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
727
728Returns:
729 An object of the form:
730
731 { # A list of Disk resources.
732 "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.
733 "items": [ # [Output Only] A list of persistent disks.
734 { # A Disk resource.
735 "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.
736 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
737 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
738 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
739 #
740 # The key must meet the following requirements before you can provide it to Compute Engine:
741 # - The key is wrapped using a RSA public key certificate provided by Google.
742 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
743 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
744 },
745 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty.
746 "a_key": "A String",
747 },
748 "licenses": [ # Any applicable publicly visible licenses.
749 "A String",
750 ],
751 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
752 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
753 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
754 "A String",
755 ],
756 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
757 #
758 # 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 or an image, or to attach the disk to a virtual machine).
759 #
760 # Customer-supplied encryption keys do not protect access to metadata of the disk.
761 #
762 # 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.
763 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
764 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
765 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
766 #
767 # The key must meet the following requirements before you can provide it to Compute Engine:
768 # - The key is wrapped using a RSA public key certificate provided by Google.
769 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
770 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
771 },
772 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
773 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
774 "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.
775 "status": "A String", # [Output Only] The status of disk creation.
776 "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:
777 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
778 # - projects/project/global/snapshots/snapshot
779 # - global/snapshots/snapshot
780 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
781 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
782 "storageType": "A String", # [Deprecated] Storage type of the persistent disk.
783 "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.
784 #
785 # To see the latest fingerprint, make a get() request to retrieve a disk.
786 "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.
787 "replicaZones": [ # URLs of the zones where the disk should be replicated to. Only applicable for regional resources.
788 "A String",
789 ],
790 "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.
791 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
792 "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.
793 "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.
794 #
795 # 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.
796 "region": "A String", # [Output Only] URL of the region where the disk resides. Only applicable for regional resources.
797 "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.
798 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
799 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
800 "rsaEncryptedKey": "A String", # Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
801 #
802 # The key must meet the following requirements before you can provide it to Compute Engine:
803 # - The key is wrapped using a RSA public key certificate provided by Google.
804 # - After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Get the RSA public key certificate provided by Google at:
805 # https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem
806 },
807 "options": "A String", # Internal use only.
808 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
809 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
810 #
811 # To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image:
812 #
813 # projects/debian-cloud/global/images/family/debian-8
814 #
815 # Alternatively, use a specific version of a public operating system image:
816 #
817 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
818 #
819 # To create a disk with a private image that you created, specify the image name in the following format:
820 #
821 # global/images/my-private-image
822 #
823 # You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name:
824 #
825 # global/images/family/my-private-family
826 },
827 ],
828 "kind": "compute#diskList", # [Output Only] Type of resource. Always compute#diskList for lists of disks.
829 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
830 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
831 }</pre>
832</div>
833
834<div class="method">
835 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
836 <pre>Retrieves the next page of results.
837
838Args:
839 previous_request: The request for the previous page. (required)
840 previous_response: The response from the request for the previous page. (required)
841
842Returns:
843 A request object that you can call 'execute()' on to request the next
844 page. Returns None if there are no more items in the collection.
845 </pre>
846</div>
847
848<div class="method">
849 <code class="details" id="resize">resize(project, zone, disk, body)</code>
850 <pre>Resizes the specified persistent disk.
851
852Args:
853 project: string, Project ID for this request. (required)
854 zone: string, The name of the zone for this request. (required)
855 disk: string, The name of the persistent disk. (required)
856 body: object, The request body. (required)
857 The object takes the form of:
858
859{
860 "sizeGb": "A String", # The new size of the persistent disk, which is specified in GB.
861 }
862
863
864Returns:
865 An object of the form:
866
867 { # An Operation resource, used to manage asynchronous API requests.
868 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
869 "clientOperationId": "A String", # [Output Only] Reserved for future use.
870 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
871 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
872 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
873 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
874 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
875 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
876 "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.
877 "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.
878 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
879 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
880 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
881 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
882 {
883 "message": "A String", # [Output Only] A human-readable description of the warning code.
884 "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.
885 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
886 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
887 {
888 "value": "A String", # [Output Only] A warning data value corresponding to the key.
889 "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).
890 },
891 ],
892 },
893 ],
894 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
895 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
896 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
897 "name": "A String", # [Output Only] Name of the resource.
898 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
899 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
900 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
901 {
902 "message": "A String", # [Output Only] An optional, human-readable error message.
903 "code": "A String", # [Output Only] The error type identifier for this error.
904 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
905 },
906 ],
907 },
908 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
909 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800910 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700911 }</pre>
912</div>
913
914<div class="method">
915 <code class="details" id="setLabels">setLabels(project, zone, resource, body)</code>
916 <pre>Sets the labels on a disk. To learn more about labels, read the Labeling or Tagging Resources documentation.
917
918Args:
919 project: string, Project ID for this request. (required)
920 zone: string, The name of the zone for this request. (required)
921 resource: string, Name of the resource for this request. (required)
922 body: object, The request body. (required)
923 The object takes the form of:
924
925{
926 "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.
927 "labels": { # The labels to set for this resource.
928 "a_key": "A String",
929 },
930 }
931
932
933Returns:
934 An object of the form:
935
936 { # An Operation resource, used to manage asynchronous API requests.
937 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
938 "clientOperationId": "A String", # [Output Only] Reserved for future use.
939 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
940 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
941 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
942 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
943 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
944 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
945 "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.
946 "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.
947 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
948 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
949 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
950 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
951 {
952 "message": "A String", # [Output Only] A human-readable description of the warning code.
953 "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.
954 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
955 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
956 {
957 "value": "A String", # [Output Only] A warning data value corresponding to the key.
958 "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).
959 },
960 ],
961 },
962 ],
963 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
964 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
965 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
966 "name": "A String", # [Output Only] Name of the resource.
967 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
968 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
969 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
970 {
971 "message": "A String", # [Output Only] An optional, human-readable error message.
972 "code": "A String", # [Output Only] The error type identifier for this error.
973 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
974 },
975 ],
976 },
977 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
978 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800979 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700980 }</pre>
981</div>
982
983<div class="method">
984 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code>
985 <pre>Returns permissions that a caller has on the specified resource.
986
987Args:
988 project: string, Project ID for this request. (required)
989 zone: string, The name of the zone for this request. (required)
990 resource: string, Name of the resource for this request. (required)
991 body: object, The request body. (required)
992 The object takes the form of:
993
994{
995 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
996 "A String",
997 ],
998 }
999
1000
1001Returns:
1002 An object of the form:
1003
1004 {
1005 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1006 "A String",
1007 ],
1008 }</pre>
1009</div>
1010
1011</body></html>