~gandelman-a/ubuntu/precise/glance/sru_979745

« back to all changes in this revision

Viewing changes to doc/source/registries.rst

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2012-03-16 16:23:34 UTC
  • mfrom: (1.1.32)
  • Revision ID: package-import@ubuntu.com-20120316162334-gg8c3bfeijm89slr
Tags: 2012.1~rc1~20120316.1354-0ubuntu1
New upstream release. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
..
2
 
      Copyright 2010 OpenStack, LLC
3
 
      All Rights Reserved.
4
 
 
5
 
      Licensed under the Apache License, Version 2.0 (the "License"); you may
6
 
      not use this file except in compliance with the License. You may obtain
7
 
      a copy of the License at
8
 
 
9
 
          http://www.apache.org/licenses/LICENSE-2.0
10
 
 
11
 
      Unless required by applicable law or agreed to in writing, software
12
 
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
 
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
 
      License for the specific language governing permissions and limitations
15
 
      under the License.
16
 
 
17
 
Image Registries
18
 
================
19
 
 
20
 
Image metadata made available through Glance can be stored in image
21
 
`registries`. Image registries are any web service that adheres to the
22
 
Glance REST-like API for image metadata.
23
 
 
24
 
Glance comes with a server program ``glance-registry`` that acts
25
 
as a reference implementation of a Glance Registry.
26
 
 
27
 
Please see the document :doc:`on Controlling Servers <controllingservers>`
28
 
for more information on starting up the Glance registry server that ships
29
 
with Glance.
30
 
 
31
 
Glance Registry API
32
 
-------------------
33
 
 
34
 
Any web service that publishes an API that conforms to the following
35
 
REST-like API specification can be used by Glance as a registry.
36
 
 
37
 
API in Summary
38
 
**************
39
 
 
40
 
The following is a brief description of the Glance API::
41
 
 
42
 
  GET     /images         Return brief information about public images
43
 
  GET     /images/detail  Return detailed information about public images
44
 
  GET     /images/<ID>    Return metadata about an image in HTTP headers
45
 
  POST    /images         Register metadata about a new image
46
 
  PUT     /images/<ID>    Update metadata about an existing image
47
 
  DELETE  /images/<ID>    Remove an image's metadata from the registry
48
 
 
49
 
Filtering Images Returned via ``GET /images`` and ``GET /images/detail``
50
 
------------------------------------------------------------------------
51
 
 
52
 
Both the ``GET /images`` and ``GET /images/detail`` requests take query
53
 
parameters that serve to filter the returned list of images. The following
54
 
list details these query parameters.
55
 
 
56
 
* ``name=NAME``
57
 
 
58
 
  Filters images having a ``name`` attribute matching ``NAME``.
59
 
 
60
 
* ``container_format=FORMAT``
61
 
 
62
 
  Filters images having a ``container_format`` attribute matching ``FORMAT``
63
 
 
64
 
  For more information, see :doc:`About Disk and Container Formats <formats>`
65
 
 
66
 
* ``disk_format=FORMAT``
67
 
 
68
 
  Filters images having a ``disk_format`` attribute matching ``FORMAT``
69
 
 
70
 
  For more information, see :doc:`About Disk and Container Formats <formats>`
71
 
 
72
 
* ``status=STATUS``
73
 
 
74
 
  Filters images having a ``status`` attribute matching ``STATUS``
75
 
 
76
 
  For more information, see :doc:`About Image Statuses <statuses>`
77
 
 
78
 
* ``size_min=BYTES``
79
 
 
80
 
  Filters images having a ``size`` attribute greater than or equal to ``BYTES``
81
 
 
82
 
* ``size_max=BYTES``
83
 
 
84
 
  Filters images having a ``size`` attribute less than or equal to ``BYTES``
85
 
 
86
 
These two resources also accept sort parameters:
87
 
 
88
 
* ``sort_key=KEY``
89
 
 
90
 
  Results will be ordered by the specified image attribute ``KEY``. Accepted
91
 
  values include ``id``, ``name``, ``status``, ``disk_format``,
92
 
  ``container_format``, ``size``, ``created_at`` (default) and ``updated_at``.
93
 
 
94
 
* ``sort_dir=DIR``
95
 
 
96
 
  Results will be sorted in the direction ``DIR``. Accepted values are ``asc``
97
 
  for ascending or ``desc`` (default) for descending.
98
 
 
99
 
 
100
 
``POST /images``
101
 
----------------
102
 
 
103
 
The body of the request will be a JSON-encoded set of data about
104
 
the image to add to the registry. It will be in the following format::
105
 
 
106
 
  {'image':
107
 
    {'id': <ID>|None,
108
 
     'name': <NAME>,
109
 
     'status': <STATUS>,
110
 
     'disk_format': <DISK_FORMAT>,
111
 
     'container_format': <CONTAINER_FORMAT>,
112
 
     'properties': [ ... ]
113
 
    }
114
 
  }
115
 
 
116
 
The request shall validate the following conditions and return a
117
 
``400 Bad request`` when any of the conditions are not met:
118
 
 
119
 
* ``status`` must be non-empty, and must be one of **active**, **saving**,
120
 
  **queued**, or **killed**
121
 
 
122
 
* ``disk_format`` must be non-empty, and must be one of **ari**, **aki**,
123
 
  **ami**, **raw**, **iso**, **vhd**, **vdi**, **qcow2**, or **vmdk**
124
 
 
125
 
* ``container_format`` must be non-empty, and must be on of **ari**,
126
 
  **aki**, **ami**, **bare**, or **ovf**
127
 
 
128
 
* If ``disk_format`` *or* ``container_format`` is **ari**, **aki**,
129
 
  **ami**, then *both* ``disk_format`` and ``container_format`` must be
130
 
  the same.
131
 
 
132
 
* ``id`` must be a uuid in hexadecimal string notation
133
 
  (i.e. '71c675ab-d94f-49cd-a114-e12490b328d9')
134
 
 
135
 
Examples
136
 
********
137
 
 
138
 
.. todo::  Complete examples for Glance registry API