blob: bc1fc9beeafec440afff13989c673bf0cd275d0b [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">
78 <code><a href="#aggregatedList">aggregatedList(project, 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">
96 <code><a href="#list">list(project, zone, 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">
106 <code class="details" id="aggregatedList">aggregatedList(project, 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)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800111 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.
112 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.
113 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 -0700114
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800115The 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 -0700116
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700117For 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 -0800118
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700119Compute Engine Beta API Only: When filtering in the Beta API, you can also 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 -0800120
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700121The Beta API also supports filtering on multiple expressions by providing 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 -0400122
123Returns:
124 An object of the form:
125
126 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800127 "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 +0000128 "items": { # [Output Only] A map of scoped disk lists.
129 "a_key": { # [Output Only] Name of the scope containing this set of disks.
130 "disks": [ # [Output Only] List of disks contained in this scope.
131 { # A Disk resource.
132 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
133 "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:
134 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
135 # - projects/project/global/snapshots/snapshot
136 # - global/snapshots/snapshot
137 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Takashi Matsuo06694102015-09-11 13:55:40 -0700138 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800139 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000140 "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.
141 #
142 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800143 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700144 "options": "A String", # Internal use only.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800145 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000146 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700147 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700148 "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 +0000149 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700150 # 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:
151 #
152 # projects/debian-cloud/global/images/family/debian-8
153 #
154 # Alternatively, use a specific version of a public operating system image:
155 #
156 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
157 #
158 # 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 +0000159 #
160 # global/images/my-private-image
161 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700162 # 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 -0800163 #
164 # global/images/family/my-private-family
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800165 "licenses": [ # [Output Only] Any applicable publicly visible licenses.
Craig Citro065b5302014-08-14 00:47:23 -0700166 "A String",
167 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800168 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
Takashi Matsuo06694102015-09-11 13:55:40 -0700169 "A String",
170 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000171 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
172 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800173 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000174 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700175 "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 -0400176 },
177 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000178 "warning": { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800179 "message": "A String", # [Output Only] A human-readable description of the warning code.
180 "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.
181 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
182 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400183 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000184 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700185 "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 -0400186 },
187 ],
188 },
189 },
190 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000191 "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 -0800192 "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 -0700193 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400194 }</pre>
195</div>
196
197<div class="method">
198 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
199 <pre>Retrieves the next page of results.
200
201Args:
202 previous_request: The request for the previous page. (required)
203 previous_response: The response from the request for the previous page. (required)
204
205Returns:
206 A request object that you can call 'execute()' on to request the next
207 page. Returns None if there are no more items in the collection.
208 </pre>
209</div>
210
211<div class="method">
212 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800213 <pre>Creates a snapshot of a specified persistent disk.
John Asmuth614db982014-04-24 15:46:26 -0400214
215Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000216 project: string, Project ID for this request. (required)
217 zone: string, The name of the zone for this request. (required)
218 disk: string, Name of the persistent disk to snapshot. (required)
John Asmuth614db982014-04-24 15:46:26 -0400219 body: object, The request body. (required)
220 The object takes the form of:
221
222{ # A persistent disk snapshot resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800223 "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 -0700224 "kind": "compute#snapshot", # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
225 "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 -0800226 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
227 "sourceDisk": "A String", # [Output Only] The source disk used to create this snapshot.
228 "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 -0700229 "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.
230 "diskSizeGb": "A String", # [Output Only] Size of the snapshot, specified in GB.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800231 "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 -0700232 "A String",
233 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700234 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800235 "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 -0700236 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
237 "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 -0400238 }
239
240
241Returns:
242 An object of the form:
243
Takashi Matsuo06694102015-09-11 13:55:40 -0700244 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800245 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
246 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000247 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800248 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
249 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
250 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
251 "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 +0000252 "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 -0800253 "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.
254 "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 -0800255 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800256 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
257 "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 +0000258 "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 -0400259 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800260 "message": "A String", # [Output Only] A human-readable description of the warning code.
261 "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.
262 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
263 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400264 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000265 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700266 "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 -0400267 },
268 ],
269 },
270 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000271 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800272 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
273 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000274 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800275 "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 +0000276 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800277 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400278 {
Craig Citroe633be12015-03-02 13:40:36 -0800279 "message": "A String", # [Output Only] An optional, human-readable error message.
280 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700281 "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 -0400282 },
283 ],
284 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800285 "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 -0700286 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800287 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400288 }</pre>
289</div>
290
291<div class="method">
292 <code class="details" id="delete">delete(project, zone, disk)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700293 <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 -0400294
295Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000296 project: string, Project ID for this request. (required)
297 zone: string, The name of the zone for this request. (required)
298 disk: string, Name of the persistent disk to delete. (required)
John Asmuth614db982014-04-24 15:46:26 -0400299
300Returns:
301 An object of the form:
302
Takashi Matsuo06694102015-09-11 13:55:40 -0700303 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800304 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
305 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000306 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800307 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
308 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
309 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
310 "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 +0000311 "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 -0800312 "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.
313 "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 -0800314 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800315 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
316 "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 +0000317 "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 -0400318 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800319 "message": "A String", # [Output Only] A human-readable description of the warning code.
320 "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.
321 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
322 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400323 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000324 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700325 "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 -0400326 },
327 ],
328 },
329 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000330 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800331 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
332 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000333 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800334 "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 +0000335 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800336 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400337 {
Craig Citroe633be12015-03-02 13:40:36 -0800338 "message": "A String", # [Output Only] An optional, human-readable error message.
339 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700340 "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 -0400341 },
342 ],
343 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800344 "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 -0700345 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800346 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400347 }</pre>
348</div>
349
350<div class="method">
351 <code class="details" id="get">get(project, zone, disk)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700352 <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 -0400353
354Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000355 project: string, Project ID for this request. (required)
356 zone: string, The name of the zone for this request. (required)
357 disk: string, Name of the persistent disk to return. (required)
John Asmuth614db982014-04-24 15:46:26 -0400358
359Returns:
360 An object of the form:
361
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000362 { # A Disk resource.
363 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
364 "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:
365 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
366 # - projects/project/global/snapshots/snapshot
367 # - global/snapshots/snapshot
368 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Takashi Matsuo06694102015-09-11 13:55:40 -0700369 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800370 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000371 "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.
372 #
373 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800374 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700375 "options": "A String", # Internal use only.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800376 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000377 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700378 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700379 "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 +0000380 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700381 # 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:
382 #
383 # projects/debian-cloud/global/images/family/debian-8
384 #
385 # Alternatively, use a specific version of a public operating system image:
386 #
387 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
388 #
389 # 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 +0000390 #
391 # global/images/my-private-image
392 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700393 # 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 -0800394 #
395 # global/images/family/my-private-family
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800396 "licenses": [ # [Output Only] Any applicable publicly visible licenses.
Craig Citro065b5302014-08-14 00:47:23 -0700397 "A String",
398 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800399 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
Takashi Matsuo06694102015-09-11 13:55:40 -0700400 "A String",
401 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000402 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
403 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800404 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000405 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700406 "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 -0400407 }</pre>
408</div>
409
410<div class="method">
411 <code class="details" id="insert">insert(project, zone, body, sourceImage=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700412 <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 -0400413
414Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000415 project: string, Project ID for this request. (required)
416 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400417 body: object, The request body. (required)
418 The object takes the form of:
419
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000420{ # A Disk resource.
421 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
422 "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:
423 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
424 # - projects/project/global/snapshots/snapshot
425 # - global/snapshots/snapshot
426 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Takashi Matsuo06694102015-09-11 13:55:40 -0700427 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800428 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000429 "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.
430 #
431 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800432 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700433 "options": "A String", # Internal use only.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800434 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000435 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700436 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700437 "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 +0000438 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700439 # 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:
440 #
441 # projects/debian-cloud/global/images/family/debian-8
442 #
443 # Alternatively, use a specific version of a public operating system image:
444 #
445 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
446 #
447 # 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 +0000448 #
449 # global/images/my-private-image
450 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700451 # 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 -0800452 #
453 # global/images/family/my-private-family
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800454 "licenses": [ # [Output Only] Any applicable publicly visible licenses.
Craig Citro065b5302014-08-14 00:47:23 -0700455 "A String",
456 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800457 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
Takashi Matsuo06694102015-09-11 13:55:40 -0700458 "A String",
459 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000460 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
461 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800462 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000463 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700464 "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 -0400465 }
466
467 sourceImage: string, Optional. Source image to restore onto a disk.
468
469Returns:
470 An object of the form:
471
Takashi Matsuo06694102015-09-11 13:55:40 -0700472 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800473 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
474 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000475 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800476 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
477 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
478 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
479 "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 +0000480 "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 -0800481 "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.
482 "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 -0800483 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800484 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
485 "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 +0000486 "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 -0400487 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800488 "message": "A String", # [Output Only] A human-readable description of the warning code.
489 "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.
490 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
491 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400492 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000493 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700494 "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 -0400495 },
496 ],
497 },
498 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000499 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800500 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
501 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000502 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800503 "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 +0000504 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800505 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400506 {
Craig Citroe633be12015-03-02 13:40:36 -0800507 "message": "A String", # [Output Only] An optional, human-readable error message.
508 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700509 "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 -0400510 },
511 ],
512 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800513 "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 -0700514 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800515 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
John Asmuth614db982014-04-24 15:46:26 -0400516 }</pre>
517</div>
518
519<div class="method">
520 <code class="details" id="list">list(project, zone, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800521 <pre>Retrieves a list of persistent disks contained within the specified zone.
John Asmuth614db982014-04-24 15:46:26 -0400522
523Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000524 project: string, Project ID for this request. (required)
525 zone: string, The name of the zone for this request. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800526 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.
527 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.
528 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 -0700529
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800530The 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 -0700531
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700532For 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 -0800533
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700534Compute Engine Beta API Only: When filtering in the Beta API, you can also 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 -0800535
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700536The Beta API also supports filtering on multiple expressions by providing 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 -0400537
538Returns:
539 An object of the form:
540
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000541 { # A list of Disk resources.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800542 "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 +0000543 "items": [ # [Output Only] A list of persistent disks.
544 { # A Disk resource.
545 "status": "A String", # [Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.
546 "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:
547 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
548 # - projects/project/global/snapshots/snapshot
549 # - global/snapshots/snapshot
550 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Takashi Matsuo06694102015-09-11 13:55:40 -0700551 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800552 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000553 "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.
554 #
555 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800556 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700557 "options": "A String", # Internal use only.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800558 "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.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000559 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700560 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700561 "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 +0000562 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700563 # 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:
564 #
565 # projects/debian-cloud/global/images/family/debian-8
566 #
567 # Alternatively, use a specific version of a public operating system image:
568 #
569 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
570 #
571 # 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 +0000572 #
573 # global/images/my-private-image
574 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700575 # 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 -0800576 #
577 # global/images/family/my-private-family
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800578 "licenses": [ # [Output Only] Any applicable publicly visible licenses.
Craig Citro065b5302014-08-14 00:47:23 -0700579 "A String",
580 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800581 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
Takashi Matsuo06694102015-09-11 13:55:40 -0700582 "A String",
583 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000584 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
585 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800586 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000587 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700588 "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 -0400589 },
590 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000591 "kind": "compute#diskList", # [Output Only] Type of resource. Always compute#diskList for lists of disks.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800592 "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 -0700593 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400594 }</pre>
595</div>
596
597<div class="method">
598 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
599 <pre>Retrieves the next page of results.
600
601Args:
602 previous_request: The request for the previous page. (required)
603 previous_response: The response from the request for the previous page. (required)
604
605Returns:
606 A request object that you can call 'execute()' on to request the next
607 page. Returns None if there are no more items in the collection.
608 </pre>
609</div>
610
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700611<div class="method">
612 <code class="details" id="resize">resize(project, zone, disk, body)</code>
613 <pre>Resizes the specified persistent disk.
614
615Args:
616 project: string, Project ID for this request. (required)
617 zone: string, The name of the zone for this request. (required)
618 disk: string, The name of the persistent disk. (required)
619 body: object, The request body. (required)
620 The object takes the form of:
621
622{
623 "sizeGb": "A String", # The new size of the persistent disk, which is specified in GB.
624 }
625
626
627Returns:
628 An object of the form:
629
630 { # An Operation resource, used to manage asynchronous API requests.
631 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
632 "clientOperationId": "A String", # [Output Only] Reserved for future use.
633 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
634 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
635 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
636 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
637 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
638 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
639 "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.
640 "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.
641 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
642 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
643 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
644 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
645 {
646 "message": "A String", # [Output Only] A human-readable description of the warning code.
647 "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.
648 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
649 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
650 {
651 "value": "A String", # [Output Only] A warning data value corresponding to the key.
652 "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).
653 },
654 ],
655 },
656 ],
657 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
658 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
659 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
660 "name": "A String", # [Output Only] Name of the resource.
661 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
662 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
663 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
664 {
665 "message": "A String", # [Output Only] An optional, human-readable error message.
666 "code": "A String", # [Output Only] The error type identifier for this error.
667 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
668 },
669 ],
670 },
671 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
672 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
673 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies.
674 }</pre>
675</div>
676
John Asmuth614db982014-04-24 15:46:26 -0400677</body></html>