1 <html><body> 2 <style> 3 4 body, 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 15 body { 16 font-size: 13px; 17 padding: 1em; 18 } 19 20 h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23 } 24 25 h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28 } 29 30 h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34 } 35 36 pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39 } 40 41 pre { 42 margin-top: 0.5em; 43 } 44 45 h1, h2, h3, p { 46 font-family: Arial, sans serif; 47 } 48 49 h1, 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, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 79 <p class="firstline">Retrieves an aggregated list of persistent disks.</p> 80 <p class="toc_element"> 81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p> 82 <p class="firstline">Retrieves the next page of results.</p> 83 <p class="toc_element"> 84 <code><a href="#createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None)</a></code></p> 85 <p class="firstline">Creates a snapshot of a specified persistent disk.</p> 86 <p class="toc_element"> 87 <code><a href="#delete">delete(project, zone, disk)</a></code></p> 88 <p class="firstline">Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.</p> 89 <p class="toc_element"> 90 <code><a href="#get">get(project, zone, disk)</a></code></p> 91 <p class="firstline">Returns a specified persistent disk. Get a list of available persistent disks by making a list() request.</p> 92 <p class="toc_element"> 93 <code><a href="#insert">insert(project, zone, body, sourceImage=None)</a></code></p> 94 <p class="firstline">Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.</p> 95 <p class="toc_element"> 96 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 97 <p class="firstline">Retrieves a list of persistent disks contained within the specified zone.</p> 98 <p class="toc_element"> 99 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 100 <p class="firstline">Retrieves the next page of results.</p> 101 <p class="toc_element"> 102 <code><a href="#resize">resize(project, zone, disk, body)</a></code></p> 103 <p class="firstline">Resizes the specified persistent disk.</p> 104 <p class="toc_element"> 105 <code><a href="#setLabels">setLabels(project, zone, resource, body)</a></code></p> 106 <p class="firstline">Sets the labels on a disk. To learn more about labels, read the Labeling or Tagging Resources documentation.</p> 107 <h3>Method Details</h3> 108 <div class="method"> 109 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 110 <pre>Retrieves an aggregated list of persistent disks. 111 112 Args: 113 project: string, Project ID for this request. (required) 114 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 115 116 You 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 118 Currently, only sorting by name or creationTimestamp desc is supported. 119 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) 120 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. 122 123 The 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. 124 125 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 126 127 You 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. 128 129 To 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. 130 131 Returns: 132 An object of the form: 133 134 { 135 "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) 136 "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. 140 "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 }, 144 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. 145 "a_key": "A String", 146 }, 147 "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. 168 "status": "A String", # [Output Only] The status of disk creation. 169 "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 173 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format. 174 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 175 "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. 178 "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. 179 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set. 180 # 181 # 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: 190 # 191 # global/images/my-private-image 192 # 193 # 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: 194 # 195 # global/images/family/my-private-family 196 "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. 198 "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. 199 "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. 208 }, 209 ], 210 "warning": { # [Output Only] Informational warning which replaces the list of disks when the list is empty. 211 "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" } 215 { 216 "value": "A String", # [Output Only] A warning data value corresponding to the key. 217 "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). 218 }, 219 ], 220 }, 221 }, 222 }, 223 "kind": "compute#diskAggregatedList", # [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. 224 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 225 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 226 }</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 233 Args: 234 previous_request: The request for the previous page. (required) 235 previous_response: The response from the request for the previous page. (required) 236 237 Returns: 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"> 244 <code class="details" id="createSnapshot">createSnapshot(project, zone, disk, body, guestFlush=None)</code> 245 <pre>Creates a snapshot of a specified persistent disk. 246 247 Args: 248 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) 251 body: object, The request body. (required) 252 The object takes the form of: 253 254 { # A persistent disk snapshot resource. 255 "status": "A String", # [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. 256 "kind": "compute#snapshot", # [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. 257 "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 }, 261 "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. 262 "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. 264 "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 }, 274 "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. 275 "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 }, 281 "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. 283 "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). 284 "A String", 285 ], 286 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 287 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 288 "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. 290 } 291 292 guestFlush: boolean, A parameter 293 294 Returns: 295 An object of the form: 296 297 { # An Operation resource, used to manage asynchronous API requests. 298 "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. 300 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 301 "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. 305 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 306 "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. 308 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 309 "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. 311 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 312 { 313 "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" } 317 { 318 "value": "A String", # [Output Only] A warning data value corresponding to the key. 319 "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). 320 }, 321 ], 322 }, 323 ], 324 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 325 "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. 327 "name": "A String", # [Output Only] Name of the resource. 328 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 329 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 330 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 331 { 332 "message": "A String", # [Output Only] An optional, human-readable error message. 333 "code": "A String", # [Output Only] The error type identifier for this error. 334 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 335 }, 336 ], 337 }, 338 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 339 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 340 "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. 341 }</pre> 342 </div> 343 344 <div class="method"> 345 <code class="details" id="delete">delete(project, zone, disk)</code> 346 <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. 347 348 Args: 349 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) 352 353 Returns: 354 An object of the form: 355 356 { # An Operation resource, used to manage asynchronous API requests. 357 "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. 359 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 360 "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. 364 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 365 "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. 367 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 368 "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. 370 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 371 { 372 "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" } 376 { 377 "value": "A String", # [Output Only] A warning data value corresponding to the key. 378 "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). 379 }, 380 ], 381 }, 382 ], 383 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 384 "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. 386 "name": "A String", # [Output Only] Name of the resource. 387 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 388 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 389 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 390 { 391 "message": "A String", # [Output Only] An optional, human-readable error message. 392 "code": "A String", # [Output Only] The error type identifier for this error. 393 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 394 }, 395 ], 396 }, 397 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 398 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 399 "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. 400 }</pre> 401 </div> 402 403 <div class="method"> 404 <code class="details" id="get">get(project, zone, disk)</code> 405 <pre>Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. 406 407 Args: 408 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) 411 412 Returns: 413 An object of the form: 414 415 { # A Disk resource. 416 "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 }, 420 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. 421 "a_key": "A String", 422 }, 423 "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. 444 "status": "A String", # [Output Only] The status of disk creation. 445 "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 449 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format. 450 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 451 "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. 454 "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. 455 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set. 456 # 457 # 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: 466 # 467 # global/images/my-private-image 468 # 469 # 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: 470 # 471 # global/images/family/my-private-family 472 "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. 474 "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. 475 "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. 484 }</pre> 485 </div> 486 487 <div class="method"> 488 <code class="details" id="insert">insert(project, zone, body, sourceImage=None)</code> 489 <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. 490 491 Args: 492 project: string, Project ID for this request. (required) 493 zone: string, The name of the zone for this request. (required) 494 body: object, The request body. (required) 495 The object takes the form of: 496 497 { # A Disk resource. 498 "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 }, 502 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. 503 "a_key": "A String", 504 }, 505 "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. 526 "status": "A String", # [Output Only] The status of disk creation. 527 "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 531 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format. 532 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 533 "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. 536 "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. 537 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set. 538 # 539 # 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: 548 # 549 # global/images/my-private-image 550 # 551 # 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: 552 # 553 # global/images/family/my-private-family 554 "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. 556 "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. 557 "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. 566 } 567 568 sourceImage: string, Optional. Source image to restore onto a disk. 569 570 Returns: 571 An object of the form: 572 573 { # An Operation resource, used to manage asynchronous API requests. 574 "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. 576 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 577 "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. 581 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 582 "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. 584 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 585 "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. 587 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 588 { 589 "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" } 593 { 594 "value": "A String", # [Output Only] A warning data value corresponding to the key. 595 "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). 596 }, 597 ], 598 }, 599 ], 600 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 601 "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. 603 "name": "A String", # [Output Only] Name of the resource. 604 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 605 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 606 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 607 { 608 "message": "A String", # [Output Only] An optional, human-readable error message. 609 "code": "A String", # [Output Only] The error type identifier for this error. 610 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 611 }, 612 ], 613 }, 614 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 615 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 616 "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. 617 }</pre> 618 </div> 619 620 <div class="method"> 621 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 622 <pre>Retrieves a list of persistent disks contained within the specified zone. 623 624 Args: 625 project: string, Project ID for this request. (required) 626 zone: string, The name of the zone for this request. (required) 627 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 628 629 You 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 631 Currently, only sorting by name or creationTimestamp desc is supported. 632 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) 633 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. 635 636 The 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. 637 638 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 639 640 You 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. 641 642 To 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. 643 644 Returns: 645 An object of the form: 646 647 { # A list of Disk resources. 648 "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. 650 { # A Disk resource. 651 "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 }, 655 "labels": { # Labels to apply to this disk. These can be later modified by the setLabels method. 656 "a_key": "A String", 657 }, 658 "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. 679 "status": "A String", # [Output Only] The status of disk creation. 680 "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 684 "lastDetachTimestamp": "A String", # [Output Only] Last detach timestamp in RFC3339 text format. 685 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 686 "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. 689 "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. 690 "sourceImage": "A String", # The source image used to create this disk. If the source image is deleted, this field will not be set. 691 # 692 # 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: 701 # 702 # global/images/my-private-image 703 # 704 # 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: 705 # 706 # global/images/family/my-private-family 707 "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. 709 "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. 710 "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. 719 }, 720 ], 721 "kind": "compute#diskList", # [Output Only] Type of resource. Always compute#diskList for lists of disks. 722 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. 723 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 724 }</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 731 Args: 732 previous_request: The request for the previous page. (required) 733 previous_response: The response from the request for the previous page. (required) 734 735 Returns: 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 741 <div class="method"> 742 <code class="details" id="resize">resize(project, zone, disk, body)</code> 743 <pre>Resizes the specified persistent disk. 744 745 Args: 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 757 Returns: 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. 763 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 764 "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 (a] 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. 803 "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. 804 }</pre> 805 </div> 806 807 <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 811 Args: 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 826 Returns: 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 (a] 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 876 </body></html>