glance/doc/source/registries.rst
jaypipes@gmail.com 79ba479ada Adds lots of unit tests for verifying exceptions are raised
properly with invalid or mismatched disk and container formats.

Adds documentation on disk and container formats. Updates
existing documentation to remove references to the now-gone
type column and replaces these references with disk_format
and container_format.

Reworked the validates_image() method in the registry.db.api
to be like what Rick was describing in reviews.
2011-02-25 09:55:26 -05:00

2.8 KiB

Image Registries

Image metadata made available through Glance can be stored in image registries. Image registries are any web service that adheres to the Glance REST-like API for image metadata.

Glance comes with a server program glance-registry that acts as a reference implementation of a Glance Registry.

Please see the document on Controlling Servers <controllingservers> for more information on starting up the Glance registry server that ships with Glance.

Glance Registry API

Any web service that publishes an API that conforms to the following REST-like API specification can be used by Glance as a registry.

API in Summary

The following is a brief description of the Glance API:

GET     /images         Return brief information about public images
GET     /images/detail  Return detailed information about public images
GET     /images/<ID>    Return metadata about an image in HTTP headers
POST    /images         Register metadata about a new image
PUT     /images/<ID>    Update metadata about an existing image
DELETE  /images/<ID>    Remove an image's metadata from the registry

POST /images

The body of the request will be a JSON-encoded set of data about the image to add to the registry. It will be in the following format:

{'image':
  {'id': <ID>|None,
   'name': <NAME>,
   'status': <STATUS>,
   'disk_format': <DISK_FORMAT>,
   'container_format': <CONTAINER_FORMAT>,
   'properties': [ ... ]
  }
}

The request shall validate the following conditions and return a 400 Bad request when any of the conditions are not met:

  • status must be non-empty, and must be one of active, saving, queued, or killed
  • disk_format must be non-empty, and must be one of ari, aki, ami, raw, vhd, vdi, qcow2, or vmdk
  • container_format must be non-empty, and must be on of ari, aki, ami, bare, or ovf
  • If disk_format or container_format is ari, aki, ami, then both disk_format and container_format must be the same.

Examples

Complete examples for Glance registry API