Difference between revisions of "Obsolete:GlanceAPISpec"
(Small cleanup) |
|||
Line 4: | Line 4: | ||
Glance <=> Nova Integration requires these components: | Glance <=> Nova Integration requires these components: | ||
− | * Glance - | + | * Glance - VM Image Management Service |
− | * Parallax - Image | + | ** Parallax - Image Registry service |
− | * Teller - Image Delivery | + | ** Teller - Image Delivery service |
− | * [[GlanceImageService]] - An adapter in Nova to | + | * Nova Integration |
− | * [[ | + | ** `nova.image.service.[[GlanceImageService]]` - An adapter in Nova to use Glance for retrieving and querying for images |
+ | *** `nova.image.service.[[ParallaxClient]]` - A client tool for querying Parallax about available images | ||
+ | *** `nova.image.service.[[TellerClient]]` - A client tool for the chunked retrieval of an image | ||
− | + | <<[[TableOfContents]]()>> | |
− | === Fetch | + | == Parallax API Commands == |
+ | === Fetch id/name basic information on all public images === | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | GET http://parallax.openstack.org/images | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | Returns a mapping containing a list of mappings containing details information about the public images encoded in JSON: | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "images": | ||
+ | [ | ||
+ | {"id": 1, "name": "My Image 1"}, | ||
+ | {"id": 2, "name": "My Image 2"}, | ||
+ | ] | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | === Fetch detailed information on all public images === | ||
<pre><nowiki> | <pre><nowiki> | ||
− | GET /images | + | GET http://parallax.openstack.org/images/detail |
</nowiki></pre> | </nowiki></pre> | ||
− | Returns | + | Returns a mapping containing a list of mappings containing details information about the public images encoded in JSON: |
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "images": | ||
+ | [ | ||
+ | { | ||
+ | "id": 1, | ||
+ | "name": "My Image", | ||
+ | "status": "available", | ||
+ | "image_type": "kernel" | ||
+ | "is_public": true, | ||
+ | "metadata": { "mykey": "myvalue" }, | ||
+ | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | ||
+ | "size": 101 } ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
− | + | ==== Notes ==== | |
− | + | The `metadata` element is a mapping of custom metadata the image may have saved with it. | |
− | + | The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size | |
− | == | + | === Fetch a single image's metadata === |
Line 36: | Line 81: | ||
− | Returns | + | Returns the image's metadata encoded in JSON: |
− | |||
− | |||
Line 45: | Line 88: | ||
"id": 1, | "id": 1, | ||
"name": "My Image", | "name": "My Image", | ||
− | " | + | "status": "available", |
− | " | + | "image_type": "kernel" |
+ | "is_public": true, | ||
"metadata": { "mykey": "myvalue" }, | "metadata": { "mykey": "myvalue" }, | ||
"files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | ||
Line 54: | Line 98: | ||
− | Exceptions | + | ==== Notes ==== |
+ | |||
+ | The `metadata` element is a mapping of custom metadata the image may have saved with it. | ||
+ | |||
+ | The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size | ||
+ | |||
+ | ==== Exceptions ==== | ||
+ | |||
+ | 404:: Image was not found | ||
+ | |||
+ | === Register/create a new image === | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | POST http://parallax.openstack.org/images | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | The body of the request shall be a JSON encoded mapping of the image's metadata: | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "name": "My Image", | ||
+ | "status": "available", | ||
+ | "image_type": "kernel" | ||
+ | "is_public": true, | ||
+ | "metadata": { "mykey": "myvalue" }, | ||
+ | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | ||
+ | "size": 101 } ] | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | The returned response, is successful, will be a JSON encoded mapping of the newly-created image in Parallax, including a populated `id` column with the new image's internal identifier: | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "id": 2349823, | ||
+ | "name": "My Image", | ||
+ | "status": "available", | ||
+ | "image_type": "kernel" | ||
+ | "is_public": true, | ||
+ | "metadata": { "mykey": "myvalue" }, | ||
+ | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | ||
+ | "size": 101 } ] | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | ==== Notes ==== | ||
+ | |||
+ | The `metadata` element is a mapping of custom metadata the image may have saved with it. | ||
+ | |||
+ | The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size | ||
+ | |||
+ | === Update an existing image's metadata === | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | PUT http://parallax.openstack.org/images/<ID> | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | The body of the request shall be a JSON encoded mapping of the image's metadata: | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "id": 2349823, | ||
+ | "name": "My Image", | ||
+ | "status": "disabled", | ||
+ | "image_type": "kernel" | ||
+ | "is_public": true, | ||
+ | "metadata": { "mykey": "myvalue" }, | ||
+ | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | ||
+ | "size": 101 } ] | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | The returned response, if successful, will be a JSON encoded mapping of the updated image metadata in Parallax: | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | { | ||
+ | "id": 2349823, | ||
+ | "name": "My Image", | ||
+ | "status": "disabled", | ||
+ | "image_type": "kernel" | ||
+ | "is_public": true, | ||
+ | "metadata": { "mykey": "myvalue" }, | ||
+ | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | ||
+ | "size": 101 } ] | ||
+ | } | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | ==== Notes ==== | ||
+ | |||
+ | The `metadata` element is a mapping of custom metadata the image may have saved with it. | ||
+ | |||
+ | The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size | ||
+ | |||
+ | ==== Exceptions ==== | ||
+ | |||
+ | 404:: Image was not found | ||
+ | |||
+ | === Delete an existing image from the registry === | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | DELETE http://parallax.openstack.org/images/<ID> | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | The body of the request will be ignored. | ||
+ | |||
+ | ==== Exceptions ==== | ||
+ | |||
+ | 404:: Image was not found | ||
+ | |||
+ | == Teller API Commands == | ||
+ | |||
+ | === Fetch an Image === | ||
+ | |||
+ | |||
+ | <pre><nowiki> | ||
+ | GET /images?uri=<Parallax URI for Image> | ||
+ | </nowiki></pre> | ||
+ | |||
+ | |||
+ | Returns | ||
+ | |||
+ | Image data as response body. | ||
+ | |||
+ | ==== Exceptions ==== | ||
− | 404 | + | 404:: Image was not found |
Revision as of 19:40, 14 October 2010
Glance API Specification
Glance <=> Nova Integration requires these components:
- Glance - VM Image Management Service
- Parallax - Image Registry service
- Teller - Image Delivery service
- Nova Integration
- `nova.image.service.GlanceImageService` - An adapter in Nova to use Glance for retrieving and querying for images
- `nova.image.service.ParallaxClient` - A client tool for querying Parallax about available images
- `nova.image.service.TellerClient` - A client tool for the chunked retrieval of an image
- `nova.image.service.GlanceImageService` - An adapter in Nova to use Glance for retrieving and querying for images
<<TableOfContents()>>
Parallax API Commands
Fetch id/name basic information on all public images
GET http://parallax.openstack.org/images
Returns a mapping containing a list of mappings containing details information about the public images encoded in JSON:
{ "images": [ {"id": 1, "name": "My Image 1"}, {"id": 2, "name": "My Image 2"}, ] }
Fetch detailed information on all public images
GET http://parallax.openstack.org/images/detail
Returns a mapping containing a list of mappings containing details information about the public images encoded in JSON:
{ "images": [ { "id": 1, "name": "My Image", "status": "available", "image_type": "kernel" "is_public": true, "metadata": { "mykey": "myvalue" }, "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", "size": 101 } ] } ] }
Notes
The `metadata` element is a mapping of custom metadata the image may have saved with it.
The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size
Fetch a single image's metadata
GET http://parallax.openstack.org/images/<ID>
Returns the image's metadata encoded in JSON:
{ "id": 1, "name": "My Image", "status": "available", "image_type": "kernel" "is_public": true, "metadata": { "mykey": "myvalue" }, "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", "size": 101 } ] }
Notes
The `metadata` element is a mapping of custom metadata the image may have saved with it.
The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size
Exceptions
404:: Image was not found
Register/create a new image
POST http://parallax.openstack.org/images
The body of the request shall be a JSON encoded mapping of the image's metadata:
{ "name": "My Image", "status": "available", "image_type": "kernel" "is_public": true, "metadata": { "mykey": "myvalue" }, "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", "size": 101 } ] }
The returned response, is successful, will be a JSON encoded mapping of the newly-created image in Parallax, including a populated `id` column with the new image's internal identifier:
{ "id": 2349823, "name": "My Image", "status": "available", "image_type": "kernel" "is_public": true, "metadata": { "mykey": "myvalue" }, "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", "size": 101 } ] }
Notes
The `metadata` element is a mapping of custom metadata the image may have saved with it.
The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size
Update an existing image's metadata
PUT http://parallax.openstack.org/images/<ID>
The body of the request shall be a JSON encoded mapping of the image's metadata:
{ "id": 2349823, "name": "My Image", "status": "disabled", "image_type": "kernel" "is_public": true, "metadata": { "mykey": "myvalue" }, "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", "size": 101 } ] }
The returned response, if successful, will be a JSON encoded mapping of the updated image metadata in Parallax:
{ "id": 2349823, "name": "My Image", "status": "disabled", "image_type": "kernel" "is_public": true, "metadata": { "mykey": "myvalue" }, "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", "size": 101 } ] }
Notes
The `metadata` element is a mapping of custom metadata the image may have saved with it.
The `files` element is a list of mappings containing the chunks comprising an image along with the chunk's size
Exceptions
404:: Image was not found
Delete an existing image from the registry
DELETE http://parallax.openstack.org/images/<ID>
The body of the request will be ignored.
Exceptions
404:: Image was not found
Teller API Commands
Fetch an Image
GET /images?uri=<Parallax URI for Image>
Returns
Image data as response body.
Exceptions
404:: Image was not found