blob: bd21d843c77748502613be31840e895ec53c111c [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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040084 <code><a href="#createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None)</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>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400104<p class="toc_element">
105 <code><a href="#setLabels">setLabels(project, zone, resource, body)</a></code></p>
106<p class="firstline">Sets the labels on a disk. To learn more about labels, read the Labeling or Tagging Resources documentation.</p>
John Asmuth614db982014-04-24 15:46:26 -0400107<h3>Method Details</h3>
108<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700109 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800110 <pre>Retrieves an aggregated list of persistent disks.
John Asmuth614db982014-04-24 15:46:26 -0400111
112Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000113 project: string, Project ID for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700114 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
115
116You 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.
117
118Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400119 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800120 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.
121 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 -0700122
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800123The 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 -0700124
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700125For 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 -0800126
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700127You 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 -0800128
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700129To 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 -0400130
131Returns:
132 An object of the form:
133
134 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400135 "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. Acceptable values are 0 to 500, inclusive. (Default: 500)
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000136 "items": { # [Output Only] A map of scoped disk lists.
137 "a_key": { # [Output Only] Name of the scope containing this set of disks.
138 "disks": [ # [Output Only] List of disks contained in this scope.
139 { # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700140 "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.
141 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
142 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
143 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400144 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
145 "a_key": "A String",
146 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700147 "licenses": [ # Any applicable publicly visible licenses.
148 "A String",
149 ],
150 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
151 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
152 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
153 "A String",
154 ],
155 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
156 #
157 # 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).
158 #
159 # Customer-supplied encryption keys do not protect access to metadata of the disk.
160 #
161 # 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.
162 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
163 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
164 },
165 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
166 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
167 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700168 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000169 "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:
170 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
171 # - projects/project/global/snapshots/snapshot
172 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700173 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800174 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400175 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.
176 #
177 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800178 "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 -0700179 "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 +0000180 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700181 # 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:
182 #
183 # projects/debian-cloud/global/images/family/debian-8
184 #
185 # Alternatively, use a specific version of a public operating system image:
186 #
187 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
188 #
189 # 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 +0000190 #
191 # global/images/my-private-image
192 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700193 # 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 -0800194 #
195 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700196 "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.
197 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700198 "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 -0700199 "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.
200 #
201 # 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.
202 "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.
203 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
204 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
205 },
206 "options": "A String", # Internal use only.
207 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400208 },
209 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000210 "warning": { # [Output Only] Informational warning which replaces the list of disks when the list is empty.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800211 "message": "A String", # [Output Only] A human-readable description of the warning code.
212 "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.
213 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
214 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400215 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000216 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700217 "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 -0400218 },
219 ],
220 },
221 },
222 },
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000223 "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 -0800224 "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 -0700225 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400226 }</pre>
227</div>
228
229<div class="method">
230 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
231 <pre>Retrieves the next page of results.
232
233Args:
234 previous_request: The request for the previous page. (required)
235 previous_response: The response from the request for the previous page. (required)
236
237Returns:
238 A request object that you can call 'execute()' on to request the next
239 page. Returns None if there are no more items in the collection.
240 </pre>
241</div>
242
243<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400244 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800245 <pre>Creates a snapshot of a specified persistent disk.
John Asmuth614db982014-04-24 15:46:26 -0400246
247Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000248 project: string, Project ID for this request. (required)
249 zone: string, The name of the zone for this request. (required)
250 disk: string, Name of the persistent disk to snapshot. (required)
John Asmuth614db982014-04-24 15:46:26 -0400251 body: object, The request body. (required)
252 The object takes the form of:
253
254{ # A persistent disk snapshot resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800255 "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 -0700256 "kind": "compute#snapshot", # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700257 "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.
258 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
259 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
260 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700261 "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 -0800262 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
263 "sourceDisk": "A String", # [Output Only] The source disk used to create this snapshot.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700264 "snapshotEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the snapshot using a customer-supplied encryption key.
265 #
266 # 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.
267 #
268 # Customer-supplied encryption keys do not protect access to metadata of the disk.
269 #
270 # 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.
271 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
272 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
273 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800274 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400275 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.
276 #
277 # To see the latest fingerprint, make a get() request to retrieve a snapshot.
278 "labels": { # Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty.
279 "a_key": "A String",
280 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700281 "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.
282 "diskSizeGb": "A String", # [Output Only] Size of the snapshot, specified in GB.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800283 "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 -0700284 "A String",
285 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700286 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800287 "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 -0700288 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
289 "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 -0400290 }
291
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400292 guestFlush: boolean, A parameter
John Asmuth614db982014-04-24 15:46:26 -0400293
294Returns:
295 An object of the form:
296
Takashi Matsuo06694102015-09-11 13:55:40 -0700297 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800298 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
299 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400300 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800301 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
302 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
303 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
304 "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 +0000305 "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 -0800306 "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.
307 "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 -0800308 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800309 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
310 "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 +0000311 "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 -0400312 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800313 "message": "A String", # [Output Only] A human-readable description of the warning code.
314 "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.
315 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
316 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400317 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000318 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700319 "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 -0400320 },
321 ],
322 },
323 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000324 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800325 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
326 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000327 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800328 "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 +0000329 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800330 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400331 {
Craig Citroe633be12015-03-02 13:40:36 -0800332 "message": "A String", # [Output Only] An optional, human-readable error message.
333 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700334 "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 -0400335 },
336 ],
337 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800338 "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 -0700339 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800340 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400341 }</pre>
342</div>
343
344<div class="method">
345 <code class="details" id="delete">delete(project, zone, disk)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700346 <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 -0400347
348Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000349 project: string, Project ID for this request. (required)
350 zone: string, The name of the zone for this request. (required)
351 disk: string, Name of the persistent disk to delete. (required)
John Asmuth614db982014-04-24 15:46:26 -0400352
353Returns:
354 An object of the form:
355
Takashi Matsuo06694102015-09-11 13:55:40 -0700356 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800357 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
358 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400359 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800360 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
361 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
362 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
363 "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 +0000364 "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 -0800365 "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.
366 "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 -0800367 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800368 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
369 "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 +0000370 "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 -0400371 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800372 "message": "A String", # [Output Only] A human-readable description of the warning code.
373 "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.
374 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
375 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400376 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000377 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700378 "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 -0400379 },
380 ],
381 },
382 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000383 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800384 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
385 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000386 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800387 "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 +0000388 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800389 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400390 {
Craig Citroe633be12015-03-02 13:40:36 -0800391 "message": "A String", # [Output Only] An optional, human-readable error message.
392 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700393 "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 -0400394 },
395 ],
396 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800397 "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 -0700398 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800399 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400400 }</pre>
401</div>
402
403<div class="method">
404 <code class="details" id="get">get(project, zone, disk)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700405 <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 -0400406
407Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000408 project: string, Project ID for this request. (required)
409 zone: string, The name of the zone for this request. (required)
410 disk: string, Name of the persistent disk to return. (required)
John Asmuth614db982014-04-24 15:46:26 -0400411
412Returns:
413 An object of the form:
414
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000415 { # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700416 "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.
417 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
418 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
419 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400420 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
421 "a_key": "A String",
422 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700423 "licenses": [ # Any applicable publicly visible licenses.
424 "A String",
425 ],
426 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
427 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
428 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
429 "A String",
430 ],
431 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
432 #
433 # 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).
434 #
435 # Customer-supplied encryption keys do not protect access to metadata of the disk.
436 #
437 # 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.
438 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
439 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
440 },
441 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
442 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
443 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700444 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000445 "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:
446 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
447 # - projects/project/global/snapshots/snapshot
448 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700449 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800450 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400451 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.
452 #
453 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800454 "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 -0700455 "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 +0000456 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700457 # 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:
458 #
459 # projects/debian-cloud/global/images/family/debian-8
460 #
461 # Alternatively, use a specific version of a public operating system image:
462 #
463 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
464 #
465 # 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 +0000466 #
467 # global/images/my-private-image
468 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700469 # 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 -0800470 #
471 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700472 "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.
473 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700474 "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 -0700475 "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.
476 #
477 # 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.
478 "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.
479 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
480 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
481 },
482 "options": "A String", # Internal use only.
483 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400484 }</pre>
485</div>
486
487<div class="method">
488 <code class="details" id="insert">insert(project, zone, body, sourceImage=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700489 <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 -0400490
491Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000492 project: string, Project ID for this request. (required)
493 zone: string, The name of the zone for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400494 body: object, The request body. (required)
495 The object takes the form of:
496
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000497{ # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700498 "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.
499 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
500 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
501 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400502 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
503 "a_key": "A String",
504 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700505 "licenses": [ # Any applicable publicly visible licenses.
506 "A String",
507 ],
508 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
509 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
510 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
511 "A String",
512 ],
513 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
514 #
515 # 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).
516 #
517 # Customer-supplied encryption keys do not protect access to metadata of the disk.
518 #
519 # 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.
520 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
521 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
522 },
523 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
524 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
525 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700526 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000527 "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:
528 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
529 # - projects/project/global/snapshots/snapshot
530 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700531 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800532 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400533 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.
534 #
535 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800536 "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 -0700537 "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 +0000538 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700539 # 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:
540 #
541 # projects/debian-cloud/global/images/family/debian-8
542 #
543 # Alternatively, use a specific version of a public operating system image:
544 #
545 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
546 #
547 # 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 +0000548 #
549 # global/images/my-private-image
550 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700551 # 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 -0800552 #
553 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700554 "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.
555 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700556 "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 -0700557 "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.
558 #
559 # 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.
560 "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.
561 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
562 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
563 },
564 "options": "A String", # Internal use only.
565 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400566 }
567
568 sourceImage: string, Optional. Source image to restore onto a disk.
569
570Returns:
571 An object of the form:
572
Takashi Matsuo06694102015-09-11 13:55:40 -0700573 { # An Operation resource, used to manage asynchronous API requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800574 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
575 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400576 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800577 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
578 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
579 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
580 "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 +0000581 "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 -0800582 "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.
583 "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 -0800584 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800585 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
586 "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 +0000587 "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 -0400588 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800589 "message": "A String", # [Output Only] A human-readable description of the warning code.
590 "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.
591 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
592 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400593 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000594 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700595 "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 -0400596 },
597 ],
598 },
599 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000600 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800601 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
602 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000603 "name": "A String", # [Output Only] Name of the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800604 "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 +0000605 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800606 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400607 {
Craig Citroe633be12015-03-02 13:40:36 -0800608 "message": "A String", # [Output Only] An optional, human-readable error message.
609 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700610 "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 -0400611 },
612 ],
613 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800614 "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 -0700615 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800616 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
John Asmuth614db982014-04-24 15:46:26 -0400617 }</pre>
618</div>
619
620<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700621 <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 -0800622 <pre>Retrieves a list of persistent disks contained within the specified zone.
John Asmuth614db982014-04-24 15:46:26 -0400623
624Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000625 project: string, Project ID for this request. (required)
626 zone: string, The name of the zone for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700627 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
628
629You 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.
630
631Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400632 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800633 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.
634 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 -0700635
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800636The 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 -0700637
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700638For 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 -0800639
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700640You 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 -0800641
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700642To 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 -0400643
644Returns:
645 An object of the form:
646
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000647 { # A list of Disk resources.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400648 "nextPageToken": "A String", # 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.
649 "items": [ # A list of Disk resources.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000650 { # A Disk resource.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700651 "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.
652 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
653 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
654 },
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400655 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method.
656 "a_key": "A String",
657 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700658 "licenses": [ # Any applicable publicly visible licenses.
659 "A String",
660 ],
661 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
662 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
663 "users": [ # [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
664 "A String",
665 ],
666 "diskEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the disk using a customer-supplied encryption key.
667 #
668 # 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).
669 #
670 # Customer-supplied encryption keys do not protect access to metadata of the disk.
671 #
672 # 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.
673 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
674 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
675 },
676 "zone": "A String", # [Output Only] URL of the zone where the disk resides.
677 "lastAttachTimestamp": "A String", # [Output Only] Last attach timestamp in RFC3339 text format.
678 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700679 "status": "A String", # [Output Only] The status of disk creation.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000680 "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:
681 # - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
682 # - projects/project/global/snapshots/snapshot
683 # - global/snapshots/snapshot
Takashi Matsuo06694102015-09-11 13:55:40 -0700684 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800685 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400686 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.
687 #
688 # To see the latest fingerprint, make a get() request to retrieve a disk.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800689 "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 -0700690 "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 +0000691 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700692 # 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:
693 #
694 # projects/debian-cloud/global/images/family/debian-8
695 #
696 # Alternatively, use a specific version of a public operating system image:
697 #
698 # projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
699 #
700 # 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 +0000701 #
702 # global/images/my-private-image
703 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700704 # 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 -0800705 #
706 # global/images/family/my-private-family
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700707 "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.
708 "kind": "compute#disk", # [Output Only] Type of the resource. Always compute#disk for disks.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700709 "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 -0700710 "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.
711 #
712 # 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.
713 "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.
714 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
715 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
716 },
717 "options": "A String", # Internal use only.
718 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400719 },
720 ],
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000721 "kind": "compute#diskList", # [Output Only] Type of resource. Always compute#diskList for lists of disks.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400722 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Takashi Matsuo06694102015-09-11 13:55:40 -0700723 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400724 }</pre>
725</div>
726
727<div class="method">
728 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
729 <pre>Retrieves the next page of results.
730
731Args:
732 previous_request: The request for the previous page. (required)
733 previous_response: The response from the request for the previous page. (required)
734
735Returns:
736 A request object that you can call 'execute()' on to request the next
737 page. Returns None if there are no more items in the collection.
738 </pre>
739</div>
740
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700741<div class="method">
742 <code class="details" id="resize">resize(project, zone, disk, body)</code>
743 <pre>Resizes the specified persistent disk.
744
745Args:
746 project: string, Project ID for this request. (required)
747 zone: string, The name of the zone for this request. (required)
748 disk: string, The name of the persistent disk. (required)
749 body: object, The request body. (required)
750 The object takes the form of:
751
752{
753 "sizeGb": "A String", # The new size of the persistent disk, which is specified in GB.
754 }
755
756
757Returns:
758 An object of the form:
759
760 { # An Operation resource, used to manage asynchronous API requests.
761 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
762 "clientOperationId": "A String", # [Output Only] Reserved for future use.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400763 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700764 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
765 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
766 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
767 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
768 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
769 "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.
770 "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.
771 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
772 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
773 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
774 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
775 {
776 "message": "A String", # [Output Only] A human-readable description of the warning code.
777 "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.
778 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
779 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
780 {
781 "value": "A String", # [Output Only] A warning data value corresponding to the key.
782 "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).
783 },
784 ],
785 },
786 ],
787 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
788 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
789 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
790 "name": "A String", # [Output Only] Name of the resource.
791 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
792 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
793 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
794 {
795 "message": "A String", # [Output Only] An optional, human-readable error message.
796 "code": "A String", # [Output Only] The error type identifier for this error.
797 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
798 },
799 ],
800 },
801 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
802 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800803 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700804 }</pre>
805</div>
806
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400807<div class="method">
808 <code class="details" id="setLabels">setLabels(project, zone, resource, body)</code>
809 <pre>Sets the labels on a disk. To learn more about labels, read the Labeling or Tagging Resources documentation.
810
811Args:
812 project: string, Project ID for this request. (required)
813 zone: string, The name of the zone for this request. (required)
814 resource: string, Name of the resource for this request. (required)
815 body: object, The request body. (required)
816 The object takes the form of:
817
818{
819 "labelFingerprint": "A String", # The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint.
820 "labels": { # The labels to set for this resource.
821 "a_key": "A String",
822 },
823 }
824
825
826Returns:
827 An object of the form:
828
829 { # An Operation resource, used to manage asynchronous API requests.
830 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
831 "clientOperationId": "A String", # [Output Only] Reserved for future use.
832 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
833 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
834 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
835 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
836 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
837 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
838 "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.
839 "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.
840 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
841 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
842 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
843 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
844 {
845 "message": "A String", # [Output Only] A human-readable description of the warning code.
846 "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.
847 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
848 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
849 {
850 "value": "A String", # [Output Only] A warning data value corresponding to the key.
851 "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).
852 },
853 ],
854 },
855 ],
856 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
857 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
858 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
859 "name": "A String", # [Output Only] Name of the resource.
860 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
861 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
862 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
863 {
864 "message": "A String", # [Output Only] An optional, human-readable error message.
865 "code": "A String", # [Output Only] The error type identifier for this error.
866 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
867 },
868 ],
869 },
870 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
871 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
872 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
873 }</pre>
874</div>
875
John Asmuth614db982014-04-24 15:46:26 -0400876</body></html>