blob: c6f42eefa7d47aceec1cbfbd22c6200ff67bf4c0 [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">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070078 <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 -080079<p class="firstline">Retrieves an aggregated list of persistent disks.</p>
John Asmuth614db982014-04-24 15:46:26 -040080<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)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080085<p class="firstline">Creates a snapshot of a specified persistent disk.</p>
John Asmuth614db982014-04-24 15:46:26 -040086<p class="toc_element">
87 <code><a href="#delete">delete(project, zone, disk)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070088<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 -040089<p class="toc_element">
90 <code><a href="#get">get(project, zone, disk)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070091<p class="firstline">Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
93 <code><a href="#insert">insert(project, zone, body, sourceImage=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070094<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 -040095<p class="toc_element">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070096 <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 -080097<p class="firstline">Retrieves a list of persistent disks contained within the specified zone.</p>
John Asmuth614db982014-04-24 15:46:26 -040098<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>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700101<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>
John Asmuth614db982014-04-24 15:46:26 -0400104<h3>Method Details</h3>
105<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700106 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800107 <pre>Retrieves an aggregated list of persistent disks.
John Asmuth614db982014-04-24 15:46:26 -0400108
109Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000110 project: string, Project ID for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700111 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
112
113You 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.
114
115Currently, only sorting by name or creationTimestamp desc is supported.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800116 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.
117 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.
118 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700119
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800120The 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700121
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700122For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800123
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700124You 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800125
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700126To 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.
John Asmuth614db982014-04-24 15:46:26 -0400127
128Returns:
129 An object of the form:
130
131 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800132 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000133 "items": { # [Output Only] A map of scoped disk lists.
134 "a_key": { # [Output Only] Name of the scope containing this set of disks.
135 "disks": [ # [Output Only] List of disks contained in this scope.
136 { # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700137 "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.
138 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
139 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
140 },
141 "licenses": [ # Any applicable publicly visible licenses.
142 "A String",
143 ],
144 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
145 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
146 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
147 "A String",
148 ],
149 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
150 #
151 # 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).
152 #
153 # Customer-supplied encryption keys do not protect access to metadata of the disk.
154 #
155 # 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.
156 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
157 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
158 },
159 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
160 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
161 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000162 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
163 "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:
164 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
165 # - projects/project/global/snapshots/snapshot
166 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700167 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800168 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800169 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700170 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000171 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700172 # 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:
173 #
174 # projects/debian-cloud/global/images/family/debian-8
175 #
176 # Alternatively, use a specific version of a public operating system image:
177 #
178 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
179 #
180 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000181 #
182 # global/images/my-private-image
183 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700184 # 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:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800185 #
186 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700187 "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.
188 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700189 "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 -0700190 "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.
191 #
192 # 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.
193 "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.
194 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
195 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
196 },
197 "options": "A String", # Internal use only.
198 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400199 },
200 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000201 "warning": { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800202 "message": "A String", # [Output Only] A human-readable description of the warning code.
203 "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.
204 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
205 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400206 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000207 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700208 "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 -0400209 },
210 ],
211 },
212 },
213 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000214 "kind": "compute#diskAggregatedList", # [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800215 "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 -0700216 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400217 }</pre>
218</div>
219
220<div class="method">
221 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
222 <pre>Retrieves the next page of results.
223
224Args:
225 previous_request: The request for the previous page. (required)
226 previous_response: The response from the request for the previous page. (required)
227
228Returns:
229 A request object that you can call 'execute()' on to request the next
230 page. Returns None if there are no more items in the collection.
231 </pre>
232</div>
233
234<div class="method">
235 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800236 <pre>Creates a snapshot of a specified persistent disk.
John Asmuth614db982014-04-24 15:46:26 -0400237
238Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000239 project: string, Project ID for this request. (required)
240 zone: string, The name of the zone for this request. (required)
241 disk: string, Name of the persistent disk to snapshot. (required)
John Asmuth614db982014-04-24 15:46:26 -0400242 body: object, The request body. (required)
243 The object takes the form of:
244
245{ # A persistent disk snapshot resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800246 "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 -0700247 "kind": "compute#snapshot", # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700248 "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.
249 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
250 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
251 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700252 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800253 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
254 "sourceDisk": "A String", # [Output Only] The source disk used to create this snapshot.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700255 "snapshotEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the snapshot using a customer-supplied encryption key.
256 #
257 # 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.
258 #
259 # Customer-supplied encryption keys do not protect access to metadata of the disk.
260 #
261 # 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.
262 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
263 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
264 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800265 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700266 "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.
267 "diskSizeGb": "A String", # [Output Only] Size of the snapshot, specified in GB.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800268 "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 -0700269 "A String",
270 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700271 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800272 "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 -0700273 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
274 "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.
John Asmuth614db982014-04-24 15:46:26 -0400275 }
276
277
278Returns:
279 An object of the form:
280
Takashi Matsuo06694102015-09-11 13:55:40 -0700281 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800282 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
283 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000284 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800285 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
286 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
287 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
288 "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 +0000289 "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 -0800290 "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.
291 "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 -0800292 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800293 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
294 "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 +0000295 "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 -0400296 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800297 "message": "A String", # [Output Only] A human-readable description of the warning code.
298 "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.
299 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
300 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400301 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000302 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700303 "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 -0400304 },
305 ],
306 },
307 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000308 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800309 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
310 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000311 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800312 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000313 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800314 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400315 {
Craig Citroe633be12015-03-02 13:40:36 -0800316 "message": "A String", # [Output Only] An optional, human-readable error message.
317 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700318 "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 -0400319 },
320 ],
321 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800322 "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 -0700323 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700324 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400325 }</pre>
326</div>
327
328<div class="method">
329 <code class="details" id="delete">delete(project, zone, disk)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700330 <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 -0400331
332Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000333 project: string, Project ID for this request. (required)
334 zone: string, The name of the zone for this request. (required)
335 disk: string, Name of the persistent disk to delete. (required)
John Asmuth614db982014-04-24 15:46:26 -0400336
337Returns:
338 An object of the form:
339
Takashi Matsuo06694102015-09-11 13:55:40 -0700340 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800341 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
342 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000343 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800344 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
345 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
346 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
347 "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 +0000348 "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 -0800349 "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.
350 "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 -0800351 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800352 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
353 "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 +0000354 "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 -0400355 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800356 "message": "A String", # [Output Only] A human-readable description of the warning code.
357 "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.
358 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
359 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400360 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000361 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700362 "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 -0400363 },
364 ],
365 },
366 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000367 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800368 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
369 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000370 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800371 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000372 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800373 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400374 {
Craig Citroe633be12015-03-02 13:40:36 -0800375 "message": "A String", # [Output Only] An optional, human-readable error message.
376 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700377 "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 -0400378 },
379 ],
380 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800381 "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 -0700382 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700383 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400384 }</pre>
385</div>
386
387<div class="method">
388 <code class="details" id="get">get(project, zone, disk)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700389 <pre>Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.
John Asmuth614db982014-04-24 15:46:26 -0400390
391Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000392 project: string, Project ID for this request. (required)
393 zone: string, The name of the zone for this request. (required)
394 disk: string, Name of the persistent disk to return. (required)
John Asmuth614db982014-04-24 15:46:26 -0400395
396Returns:
397 An object of the form:
398
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000399 { # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700400 "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.
401 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
402 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
403 },
404 "licenses": [ # Any applicable publicly visible licenses.
405 "A String",
406 ],
407 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
408 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
409 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
410 "A String",
411 ],
412 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
413 #
414 # 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).
415 #
416 # Customer-supplied encryption keys do not protect access to metadata of the disk.
417 #
418 # 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.
419 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
420 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
421 },
422 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
423 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
424 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000425 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
426 "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:
427 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
428 # - projects/project/global/snapshots/snapshot
429 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700430 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800431 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800432 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700433 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000434 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700435 # 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:
436 #
437 # projects/debian-cloud/global/images/family/debian-8
438 #
439 # Alternatively, use a specific version of a public operating system image:
440 #
441 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
442 #
443 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000444 #
445 # global/images/my-private-image
446 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700447 # 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:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800448 #
449 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700450 "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.
451 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700452 "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 -0700453 "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.
454 #
455 # 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.
456 "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.
457 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
458 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
459 },
460 "options": "A String", # Internal use only.
461 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400462 }</pre>
463</div>
464
465<div class="method">
466 <code class="details" id="insert">insert(project, zone, body, sourceImage=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700467 <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 -0400468
469Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000470 project: string, Project ID for this request. (required)
471 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400472 body: object, The request body. (required)
473 The object takes the form of:
474
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000475{ # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700476 "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.
477 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
478 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
479 },
480 "licenses": [ # Any applicable publicly visible licenses.
481 "A String",
482 ],
483 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
484 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
485 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
486 "A String",
487 ],
488 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
489 #
490 # 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).
491 #
492 # Customer-supplied encryption keys do not protect access to metadata of the disk.
493 #
494 # 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.
495 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
496 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
497 },
498 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
499 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
500 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000501 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
502 "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:
503 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
504 # - projects/project/global/snapshots/snapshot
505 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700506 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800507 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800508 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700509 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000510 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700511 # 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:
512 #
513 # projects/debian-cloud/global/images/family/debian-8
514 #
515 # Alternatively, use a specific version of a public operating system image:
516 #
517 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
518 #
519 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000520 #
521 # global/images/my-private-image
522 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700523 # 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:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800524 #
525 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700526 "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.
527 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700528 "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 -0700529 "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.
530 #
531 # 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.
532 "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.
533 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
534 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
535 },
536 "options": "A String", # Internal use only.
537 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400538 }
539
540 sourceImage: string, Optional. Source image to restore onto a disk.
541
542Returns:
543 An object of the form:
544
Takashi Matsuo06694102015-09-11 13:55:40 -0700545 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800546 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
547 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000548 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800549 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
550 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
551 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
552 "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 +0000553 "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 -0800554 "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.
555 "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 -0800556 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800557 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
558 "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 +0000559 "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 -0400560 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800561 "message": "A String", # [Output Only] A human-readable description of the warning code.
562 "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.
563 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
564 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400565 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000566 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700567 "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 -0400568 },
569 ],
570 },
571 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000572 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800573 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
574 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000575 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800576 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000577 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800578 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400579 {
Craig Citroe633be12015-03-02 13:40:36 -0800580 "message": "A String", # [Output Only] An optional, human-readable error message.
581 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700582 "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 -0400583 },
584 ],
585 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800586 "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 -0700587 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700588 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400589 }</pre>
590</div>
591
592<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700593 <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 -0800594 <pre>Retrieves a list of persistent disks contained within the specified zone.
John Asmuth614db982014-04-24 15:46:26 -0400595
596Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000597 project: string, Project ID for this request. (required)
598 zone: string, The name of the zone for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700599 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
600
601You 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.
602
603Currently, only sorting by name or creationTimestamp desc is supported.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800604 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.
605 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.
606 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700607
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800608The 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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700609
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700610For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800611
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700612You 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800613
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700614To 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.
John Asmuth614db982014-04-24 15:46:26 -0400615
616Returns:
617 An object of the form:
618
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000619 { # A list of Disk resources.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800620 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000621 "items": [ # [Output Only] A list of persistent disks.
622 { # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700623 "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.
624 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
625 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
626 },
627 "licenses": [ # Any applicable publicly visible licenses.
628 "A String",
629 ],
630 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
631 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
632 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
633 "A String",
634 ],
635 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
636 #
637 # 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).
638 #
639 # Customer-supplied encryption keys do not protect access to metadata of the disk.
640 #
641 # 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.
642 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
643 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
644 },
645 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
646 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
647 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000648 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
649 "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:
650 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
651 # - projects/project/global/snapshots/snapshot
652 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700653 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800654 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800655 "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.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700656 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000657 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700658 # 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:
659 #
660 # projects/debian-cloud/global/images/family/debian-8
661 #
662 # Alternatively, use a specific version of a public operating system image:
663 #
664 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
665 #
666 # To create a disk with a private image that you created, specify the image name in the following format:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000667 #
668 # global/images/my-private-image
669 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700670 # 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:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800671 #
672 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700673 "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.
674 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700675 "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 -0700676 "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.
677 #
678 # 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.
679 "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.
680 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
681 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
682 },
683 "options": "A String", # Internal use only.
684 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400685 },
686 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000687 "kind": "compute#diskList", # [Output Only] Type of resource. Always compute#diskList for lists of disks.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800688 "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 -0700689 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400690 }</pre>
691</div>
692
693<div class="method">
694 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
695 <pre>Retrieves the next page of results.
696
697Args:
698 previous_request: The request for the previous page. (required)
699 previous_response: The response from the request for the previous page. (required)
700
701Returns:
702 A request object that you can call 'execute()' on to request the next
703 page. Returns None if there are no more items in the collection.
704 </pre>
705</div>
706
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700707<div class="method">
708 <code class="details" id="resize">resize(project, zone, disk, body)</code>
709 <pre>Resizes the specified persistent disk.
710
711Args:
712 project: string, Project ID for this request. (required)
713 zone: string, The name of the zone for this request. (required)
714 disk: string, The name of the persistent disk. (required)
715 body: object, The request body. (required)
716 The object takes the form of:
717
718{
719 "sizeGb": "A String", # The new size of the persistent disk, which is specified in GB.
720 }
721
722
723Returns:
724 An object of the form:
725
726 { # An Operation resource, used to manage asynchronous API requests.
727 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
728 "clientOperationId": "A String", # [Output Only] Reserved for future use.
729 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
730 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
731 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
732 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
733 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
734 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
735 "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.
736 "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.
737 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
738 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
739 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
740 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
741 {
742 "message": "A String", # [Output Only] A human-readable description of the warning code.
743 "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.
744 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
745 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
746 {
747 "value": "A String", # [Output Only] A warning data value corresponding to the key.
748 "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).
749 },
750 ],
751 },
752 ],
753 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
754 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
755 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
756 "name": "A String", # [Output Only] Name of the resource.
757 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
758 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
759 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
760 {
761 "message": "A String", # [Output Only] An optional, human-readable error message.
762 "code": "A String", # [Output Only] The error type identifier for this error.
763 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
764 },
765 ],
766 },
767 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
768 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700769 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700770 }</pre>
771</div>
772
John Asmuth614db982014-04-24 15:46:26 -0400773</body></html>