From 8ef8103a30fa83520fd267a2d3dbf1291ea0efcf Mon Sep 17 00:00:00 2001 From: Diane Fleming Date: Mon, 5 May 2014 12:12:14 -0700 Subject: [PATCH] Add virtual_size attribute to list images response Closes-Bug: #1279866 Change-Id: Id2c5e05b3040d0829a4f8b1834f6410f043d7fff author: Diane Fleming --- api-ref/src/docbkx/ch_images-v2.xml | 12 + api-ref/src/wadls/image-api/src/v2/common.ent | 196 +++++++++++-- .../wadls/image-api/src/v2/os-image-v2.wadl | 257 +++++++++--------- .../src/v2/samples/image-create-response.json | 35 ++- .../v2/samples/image-details-response.json | 35 ++- .../src/v2/samples/image-list-response.json | 108 ++++---- 6 files changed, 402 insertions(+), 241 deletions(-) diff --git a/api-ref/src/docbkx/ch_images-v2.xml b/api-ref/src/docbkx/ch_images-v2.xml index 15e3e360d..db96bb6be 100644 --- a/api-ref/src/docbkx/ch_images-v2.xml +++ b/api-ref/src/docbkx/ch_images-v2.xml @@ -41,11 +41,23 @@ + + +
+ Image data + Upload and download raw image data. + + +
+
+ Image tags + Add and delete image tags. + diff --git a/api-ref/src/wadls/image-api/src/v2/common.ent b/api-ref/src/wadls/image-api/src/v2/common.ent index b1292b333..8fdafb030 100644 --- a/api-ref/src/wadls/image-api/src/v2/common.ent +++ b/api-ref/src/wadls/image-api/src/v2/common.ent @@ -53,7 +53,7 @@ '> - ?tag="cirros". '> - + + An images object. + +'> + + + An image object. + +'> + + + The image status. + +'> + + + The date and time when the image was deleted. + +'> + + + The name of the image. + +'> + + + Indicates whether the image has been deleted. + +'> + + + The container format of image. Valid values are ami, + ari, aki, bare, and ovf. + +'> + + + The date and time when the image was created. + +'> + + + The disk format of the image. Valid values are + ami, ari, aki, vhd, vmdk, raw, qcow2, vdi, and iso. + +'> + + + The date and time when the image was last updated. + +'> + + + The minimum disk size required to boot the image, in + GBs. + +'> + + + Defines whether the image can be deleted. + +'> + + + The unique ID for the image. + +'> + + + The minimum amount of RAM required to boot the image, in MBs. + +'> + + + Hash of the image data used. The Image Service uses this value for + verification. + +'> + + + The ID of the owner, or tenant, of the image. + +'> + + + Defines whether the image is public. + +'> + + + The virtual size of the image. + +'> + + + Properties, if any, that are associated with the image. + +'> + + + The size of the image data, in bytes. + + +' > + Image ID stored through the image API. Typically a UUID. ' > - Image tag. -' > - + Image tag. + +'> + Image member ID. For example, the tenant ID of the user with whom the image is being shared. -' > - - - Status to which this image member should be set. Valid - values are pending, accepted, - and rejected. - -' > +'> GET'> PUT'> POST'> DELETE'> +PATCH'> diff --git a/api-ref/src/wadls/image-api/src/v2/os-image-v2.wadl b/api-ref/src/wadls/image-api/src/v2/os-image-v2.wadl index caae2cc2c..83fe23132 100644 --- a/api-ref/src/wadls/image-api/src/v2/os-image-v2.wadl +++ b/api-ref/src/wadls/image-api/src/v2/os-image-v2.wadl @@ -1,5 +1,5 @@ - + @@ -34,15 +34,6 @@ - - Image - ID stored through the image API. - Typically a UUID. - @@ -52,16 +43,8 @@ - - Image - tag. - - + &tagParameter; @@ -69,19 +52,8 @@ path="members"> - - Image member ID. For - example, the tenant ID of the user - with whom the image is being - shared. - - + &member_idParameter; @@ -118,6 +90,68 @@ + + + + Lists public virtual machine (VM) + images. (Since Image API v2.0.) + Returns a subset of the larger collection of images + and a link that you can use to get the next set of + images. You should always check for the presence of a + next link and use it as the URI in a + subsequent HTTP GET request. You should follow this + pattern until a next link is no longer + provided. The next link preserves any query parameters + that you send in your initial request. You can use the + first link to jump back to the first + page of the collection. If you prefer to paginate + through images manually, use the limit + and marker parameters. + The list operation accepts several types of query + parameters that let you filter the results of the + returned collection. + A client can provide direct comparison filters using + most image attributes, such as + name=Ubuntu, + visibility=public, and so on. A + client cannot filter on tags or anything defined as a + link in the json-schema, such as + self, file, or schema. + You can use the size_min and + size_max query parameters to perform + greater-than and less-than filtering of images based + on their size attribute. The size is + measured in bytes and refers to the size of an image + when it is stored on disk. + For example, sending a size_min filter + of 1048576 and size_max of 4194304 + filters the container to include only images that are + between 1 and 4 MB. + You can sort the results of this operation by using + the sort_key and sort_dir + parameters. The API uses the natural sorting of + whatever image attribute is provided as the + sort_key. + + &imageListReqParameters; + &imagesParameter; &statusParameter; + &deleted_atParameter; &nameParameter; &deletedParameter; + &container_formatParameter; &created_atParameter; + &disk_formatParameter; &updated_atParameter; + &min_diskParameter; &protectedParameter; &idParameter; + &min_ramParameter; &check_sumParameter; &ownerParameter; + &is_publicParameter; &virtual_sizeParameter; + &propertiesParameter; + + + + + + @@ -169,8 +203,16 @@ - - &imageParameter; &statusParameter; + &deletedParameter; &container_formatParameter; + &min_ramParameter; &updated_atParameter; &ownerParameter; + &min_diskParameter; &is_publicParameter; + &deleted_atParameter; &idParameter; &sizeParameter; + &virtual_sizeParameter; &nameParameter; + &check_sumParameter; &created_atParameter; + &disk_formatParameter; &propertiesParameter; + &protectedParameter; @@ -190,6 +232,7 @@ + @@ -206,16 +249,16 @@ (Since Image API v2.2) - You can also use the PATCH method to add or remove + You can also use the &PATCH; method to add or remove image properties. - For information about the PATCH method and the + For information about the &PATCH; method and the available media types, see Appendix B: HTTP PATCH media types in the OpenStack Image Service API v2 Reference. - &imageIdParameter; &image_idParameter; @@ -233,7 +276,6 @@ - @@ -241,7 +283,7 @@ (Since Image API v2.0.) Response body is a single image entity. - &imageIdParameter; + &image_idParameter; - - - Lists public virtual machine (VM) - images. (Since Image API v2.0.) - Returns a subset of the larger collection of images - and a link that you can use to get the next set of - images. You should always check for the presence of a - next link and use it as the URI in a - subsequent HTTP GET request. You should follow this - pattern until a next link is no longer - provided. The next link preserves any query parameters - that you send in your initial request. You can use the - first link to jump back to the first - page of the collection. If you prefer to paginate - through images manually, use the limit - and marker parameters. - The list operation accepts several types of query - parameters that let you filter the results of the - returned collection. - A client can provide direct comparison filters using - most image attributes, such as - name=Ubuntu, - visibility=public, and so on. A - client cannot filter on tags or anything defined as a - link in the json-schema, such as - self, file, or schema. - You can use the size_min and - size_max query parameters to perform - greater-than and less-than filtering of images based - on their size attribute. The size is - measured in bytes and refers to the size of an image - when it is stored on disk. - For example, sending a size_min filter - of 1048576 and size_max of 4194304 - filters the container to include only images that are - between 1 and 4 MB. - You can sort the results of this operation by using - the sort_key and sort_dir - parameters. The API uses the natural sorting of - whatever image attribute is provided as the - sort_key. - - &imageListParameters; - - - - - - - - - - - Lists the tenants with whom this - image has been shared. (Since Image API v2.1.) - If a user with whom this image is shared makes this - call, the member list contains only information for - that user. - If a user with whom this image has not been shared - makes this call, the call returns the HTTP 404 status - code. - - &imageIdParameter; - - - - - - - - - @@ -344,10 +307,11 @@ response is empty and returns the HTTP 204 status code. - &imageIdParameter; + &image_idParameter; + @@ -360,7 +324,7 @@ accessible in its entirety by issuing a &GET; request to the same URI. - &imageIdParameter; + &image_idParameter; @@ -377,16 +341,17 @@ If no image data exists, returns the HTTP 204 status code. - &imageIdParameter; + &image_idParameter; + Adds a specified tag to a specified image. (Since Image API v2.0.) - &imageIdParameter; &imageTagParameter; + &image_idParameter; &tagParameter; @@ -395,9 +360,10 @@ Deletes a specified tag from a specified image. (Since Image API v2.0.) - &imageIdParameter; &imageTagParameter; + &image_idParameter; &tagParameter; + @@ -405,25 +371,51 @@ Response body is a single image member entity. (Since Image API 2.2.) - &imageIdParameter; &memberIdParameter; + &image_idParameter; &member_idParameter; - + - + + + + Lists the tenants with whom this + image has been shared. (Since Image API v2.1.) + If a user with whom this image is shared makes this + call, the member list contains only information for + that user. + If a user with whom this image has not been shared + makes this call, the call returns the HTTP 404 status + code. + + &image_idParameter; + + + + + + + + + Adds a specified tenant ID as an image member. (Since Image API v2.1.) - &imageIdParameter; &memberIdParameter; - + &image_idParameter; - &imageIdParameter; &memberIdParameter; - &statusParameter; + &image_idParameter; &member_idParameter; + - &imageIdParameter; + &image_idParameter; &member_idParameter; diff --git a/api-ref/src/wadls/image-api/src/v2/samples/image-create-response.json b/api-ref/src/wadls/image-api/src/v2/samples/image-create-response.json index baf318dcd..fccbd030f 100644 --- a/api-ref/src/wadls/image-api/src/v2/samples/image-create-response.json +++ b/api-ref/src/wadls/image-api/src/v2/samples/image-create-response.json @@ -1,15 +1,24 @@ { - "id": "e7db3b45-8db7-47ad-8109-3fb55c2c24fd", - "name": "Ubuntu 12.10", - "status": "queued", - "visibility": "public", - "tags": [ - "ubuntu", - "quantal" - ], - "created_at": "2012-08-11T17:15:52Z", - "updated_at": "2012-08-11T17:15:52Z", - "self": "/v2/images/e7db3b45-8db7-47ad-8109-3fb55c2c24fd", - "file": "/v2/images/e7db3b45-8db7-47ad-8109-3fb55c2c24fd/file", - "schema": "/v2/schemas/image" + "image":{ + "status":"queued", + "deleted":false, + "container_format":null, + "min_ram":0, + "updated_at":"2014-05-05T21:15:26", + "owner":"f3490b9d3efd47df9e6e91845a1d647b", + "min_disk":0, + "is_public":false, + "deleted_at":null, + "id":"e7db3b45-8db7-47ad-8109-3fb55c2c24fd", + "size":0, + "virtual_size":null, + "name":"Ubuntu 12.10", + "checksum":null, + "created_at":"2014-05-05T21:15:26", + "disk_format":null, + "properties":{ + + }, + "protected":false + } } \ No newline at end of file diff --git a/api-ref/src/wadls/image-api/src/v2/samples/image-details-response.json b/api-ref/src/wadls/image-api/src/v2/samples/image-details-response.json index b52bac505..cbc3d1406 100644 --- a/api-ref/src/wadls/image-api/src/v2/samples/image-details-response.json +++ b/api-ref/src/wadls/image-api/src/v2/samples/image-details-response.json @@ -1,17 +1,22 @@ { - "id": "da3b75d9-3f4a-40e7-8a2c-bfab23927dea", - "name": "cirros-0.3.0-x86_64-uec-ramdisk", - "status": "active", - "visibility": "public", - "size": 2254249, - "checksum": "2cec138d7dae2aa59038ef8c9aec2390", - "tags": [ - "ping", - "pong" - ], - "created_at": "2012-08-10T19:23:50Z", - "updated_at": "2012-08-10T19:23:50Z", - "self": "/v2/images/da3b75d9-3f4a-40e7-8a2c-bfab23927dea", - "file": "/v2/images/da3b75d9-3f4a-40e7-8a2c-bfab23927dea/file", - "schema": "/v2/schemas/image" + "status":"active", + "name":"cirros-0.3.2-x86_64-disk", + "tags":[ + + ], + "container_format":"bare", + "created_at":"2014-05-05T17:15:10Z", + "disk_format":"qcow2", + "updated_at":"2014-05-05T17:15:11Z", + "visibility":"public", + "self":"/v2/images/1bea47ed-f6a9-463b-b423-14b9cca9ad27", + "min_disk":0, + "protected":false, + "id":"1bea47ed-f6a9-463b-b423-14b9cca9ad27", + "file":"/v2/images/1bea47ed-f6a9-463b-b423-14b9cca9ad27/file", + "checksum":"64d7c1cd2b6f60c92c14662941cb7913", + "owner":"5ef70662f8b34079a6eddb8da9d75fe8", + "size":13167616, + "min_ram":0, + "schema":"/v2/schemas/image" } \ No newline at end of file diff --git a/api-ref/src/wadls/image-api/src/v2/samples/image-list-response.json b/api-ref/src/wadls/image-api/src/v2/samples/image-list-response.json index e7322f15c..01bc33f8d 100644 --- a/api-ref/src/wadls/image-api/src/v2/samples/image-list-response.json +++ b/api-ref/src/wadls/image-api/src/v2/samples/image-list-response.json @@ -1,64 +1,48 @@ { - "images": [ - { - "status": "active", - "name": "cirros-0.3.1-x86_64-uec", - "deleted": false, - "container_format": "ami", - "created_at": "2013-08-29T19:18:26", - "disk_format": "ami", - "updated_at": "2013-08-29T19:18:26", - "id": "e0b7734d-2331-42a3-b19e-067adc0da17d", - "min_disk": 0, - "protected": false, - "min_ram": 0, - "checksum": "f8a2eeee2dc65b3d9b6e63678955bd83", - "owner": "f7ac731cc11f40efbc03a9f9e1d1d21f", - "is_public": true, - "deleted_at": null, - "properties": { - "kernel_id": "75bf193b-237b-435e-8712-896c51484de9", - "ramdisk_id": "19eee81c-f972-44e1-a952-1dceee148c47" - }, - "size": 25165824 - }, - { - "status": "active", - "name": "cirros-0.3.1-x86_64-uec-kernel", - "deleted": false, - "container_format": "aki", - "created_at": "2013-08-29T19:18:24", - "disk_format": "aki", - "updated_at": "2013-08-29T19:18:24", - "id": "75bf193b-237b-435e-8712-896c51484de9", - "min_disk": 0, - "protected": false, - "min_ram": 0, - "checksum": "c352f4e7121c6eae958bc1570324f17e", - "owner": "f7ac731cc11f40efbc03a9f9e1d1d21f", - "is_public": true, - "deleted_at": null, - "properties": {}, - "size": 4955792 - }, - { - "status": "active", - "name": "cirros-0.3.1-x86_64-uec-ramdisk", - "deleted": false, - "container_format": "ari", - "created_at": "2013-08-29T19:18:25", - "disk_format": "ari", - "updated_at": "2013-08-29T19:18:25", - "id": "19eee81c-f972-44e1-a952-1dceee148c47", - "min_disk": 0, - "protected": false, - "min_ram": 0, - "checksum": "69c33642f44ca552ba4bb8b66ad97e85", - "owner": "f7ac731cc11f40efbc03a9f9e1d1d21f", - "is_public": true, - "deleted_at": null, - "properties": {}, - "size": 3714968 - } - ] + "images":[ + { + "status":"active", + "deleted_at":null, + "name":"cirros-0.3.2-x86_64-disk", + "deleted":false, + "container_format":"bare", + "created_at":"2014-05-05T17:15:10", + "disk_format":"qcow2", + "updated_at":"2014-05-05T17:15:11", + "min_disk":0, + "protected":false, + "id":"1bea47ed-f6a9-463b-b423-14b9cca9ad27", + "min_ram":0, + "checksum":"64d7c1cd2b6f60c92c14662941cb7913", + "owner":"5ef70662f8b34079a6eddb8da9d75fe8", + "is_public":true, + "virtual_size":null, + "properties":{ + + }, + "size":13167616 + }, + { + "status":"active", + "deleted_at":null, + "name":"F17-x86_64-cfntools", + "deleted":false, + "container_format":"bare", + "created_at":"2014-05-05T17:15:11", + "disk_format":"qcow2", + "updated_at":"2014-05-05T17:15:16", + "min_disk":0, + "protected":false, + "id":"781b3762-9469-4cec-b58d-3349e5de4e9c", + "min_ram":0, + "checksum":"afab0f79bac770d61d24b4d0560b5f70", + "owner":"5ef70662f8b34079a6eddb8da9d75fe8", + "is_public":true, + "virtual_size":null, + "properties":{ + + }, + "size":476704768 + } + ] } \ No newline at end of file