Difference between revisions of "Obsolete:GlanceAPISpec"
Line 15: | Line 15: | ||
== Parallax API Commands == | == Parallax API Commands == | ||
+ | |||
+ | This section describes the Parallax REST API for creating, listing, modifying, and deleting image metadata. | ||
+ | |||
=== Fetch id/name basic information on all public images === | === Fetch id/name basic information on all public images === | ||
Line 86: | Line 89: | ||
<pre><nowiki> | <pre><nowiki> | ||
{ | { | ||
− | "id": 1, | + | "image": |
− | "name": "My Image", | + | { |
− | "status": "available", | + | "id": 1, |
− | "image_type": "kernel" | + | "name": "My Image", |
− | "is_public": true, | + | "status": "available", |
− | "metadata": { "mykey": "myvalue" }, | + | "image_type": "kernel" |
− | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | + | "is_public": true, |
+ | "metadata": { "mykey": "myvalue" }, | ||
+ | "files": [ { "location": "swift://user:passwd@acct/container/obj.tar.gz.0", | ||
"size": 101 } ] | "size": 101 } ] | ||
+ | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 99: | Line 105: | ||
==== Notes ==== | ==== Notes ==== | ||
+ | |||
+ | The reason the returned dict contains only a single element, 'image', is for XML conversion purposes, where the root element will be `<image>` and not the root XML namespace. | ||
The `metadata` element is a mapping of custom metadata the image may have saved with it. | The `metadata` element is a mapping of custom metadata the image may have saved with it. | ||
Line 121: | Line 129: | ||
<pre><nowiki> | <pre><nowiki> | ||
{ | { | ||
+ | "image": | ||
+ | { | ||
"name": "My Image", | "name": "My Image", | ||
"status": "available", | "status": "available", | ||
Line 127: | Line 137: | ||
"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", | ||
− | + | "size": 101 } ] | |
+ | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 137: | Line 148: | ||
<pre><nowiki> | <pre><nowiki> | ||
{ | { | ||
− | "id": | + | "image": |
+ | { | ||
+ | "id": 1, | ||
"name": "My Image", | "name": "My Image", | ||
"status": "available", | "status": "available", | ||
Line 144: | Line 157: | ||
"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", | ||
− | + | "size": 101 } ] | |
+ | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 150: | Line 164: | ||
==== Notes ==== | ==== Notes ==== | ||
+ | |||
+ | The reason the body dict and result dict contains only a single element, 'image', is for XML conversion purposes, where the root element will be `<image>` and not the root XML namespace. | ||
The `metadata` element is a mapping of custom metadata the image may have saved with it. | The `metadata` element is a mapping of custom metadata the image may have saved with it. | ||
Line 168: | Line 184: | ||
<pre><nowiki> | <pre><nowiki> | ||
{ | { | ||
+ | "image": | ||
+ | { | ||
"id": 2349823, | "id": 2349823, | ||
"name": "My Image", | "name": "My Image", | ||
Line 175: | Line 193: | ||
"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", | ||
− | + | "size": 101 } ] | |
+ | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 185: | Line 204: | ||
<pre><nowiki> | <pre><nowiki> | ||
{ | { | ||
+ | "image": | ||
+ | { | ||
"id": 2349823, | "id": 2349823, | ||
"name": "My Image", | "name": "My Image", | ||
Line 192: | Line 213: | ||
"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", | ||
− | + | "size": 101 } ] | |
+ | } | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 198: | Line 220: | ||
==== Notes ==== | ==== Notes ==== | ||
+ | |||
+ | The reason the body dict and result dict contains only a single element, 'image', is for XML conversion purposes, where the root element will be `<image>` and not the root XML namespace. | ||
The `metadata` element is a mapping of custom metadata the image may have saved with it. | The `metadata` element is a mapping of custom metadata the image may have saved with it. |
Revision as of 19:52, 15 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
This section describes the Parallax REST API for creating, listing, modifying, and deleting image metadata.
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:
{ "image": { "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 reason the returned dict contains only a single element, 'image', is for XML conversion purposes, where the root element will be `<image>` and not the root XML namespace.
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:
{ "image": { "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:
{ "image": { "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 reason the body dict and result dict contains only a single element, 'image', is for XML conversion purposes, where the root element will be `<image>` and not the root XML namespace.
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:
{ "image": { "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:
{ "image": { "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 reason the body dict and result dict contains only a single element, 'image', is for XML conversion purposes, where the root element will be `<image>` and not the root XML namespace.
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