Merge lp:~jaypipes/glance/bug704038 into lp:~hudson-openstack/glance/trunk

Proposed by Jay Pipes
Status: Merged
Approved by: Jay Pipes
Approved revision: 39
Merged at revision: 40
Proposed branch: lp:~jaypipes/glance/bug704038
Merge into: lp:~hudson-openstack/glance/trunk
Diff against target: 147 lines (+84/-12)
3 files modified
bin/glance-registry (+0/-4)
doc/source/registries.rst (+67/-2)
glance/registry/__init__.py (+17/-6)
To merge this branch: bzr merge lp:~jaypipes/glance/bug704038
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Devin Carlen (community) Approve
Review via email: mp+46694@code.launchpad.net

Commit message

Fix Bug #704038: Unable to start or connect to register server on anything other than 0.0.0.0:9191

Description of the change

Fix Bug #704038: Unable to start or connect to register server on anything other than 0.0.0.0:9191

Adds more documentation for registries stuff as well.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/glance-registry'
2--- bin/glance-registry 2011-01-02 02:47:59 +0000
3+++ bin/glance-registry 2011-01-18 22:01:22 +0000
4@@ -33,10 +33,6 @@
5
6
7 FLAGS = flags.FLAGS
8-flags.DEFINE_string('registry_host', '0.0.0.0',
9- 'Registry server lives at this address')
10-flags.DEFINE_integer('registry_port', 9191,
11- 'Registry server listens on this port')
12
13
14 def main(_args):
15
16=== modified file 'doc/source/registries.rst'
17--- doc/source/registries.rst 2010-12-22 17:38:54 +0000
18+++ doc/source/registries.rst 2011-01-18 22:01:22 +0000
19@@ -18,5 +18,70 @@
20 ================
21
22 Image metadata made available through Glance can be stored in image
23-*registries*. Image registries are any web service that adheres to the
24-Glance RESTful API for image metadata.
25+`registries`. Image registries are any web service that adheres to the
26+Glance REST-like API for image metadata.
27+
28+Glance comes with a server program ``bin/glance-registry`` that acts
29+as a reference implementation of a Glance Registry.
30+
31+Using ``bin/glance-registry``
32+-----------------------------
33+
34+As mentioned above, ``bin/glance-registry`` is the reference registry
35+server implementation that ships with Glance. It uses a SQL database
36+to store information about an image, and publishes this information
37+via an HTTP/REST-like interface.
38+
39+Starting the server
40+*******************
41+
42+Starting the Glance registry server is trivial. Simply call the program
43+from the command line, as the following example shows::
44+
45+ jpipes@serialcoder:~/repos/glance/trunk$ ./bin/glance-registry
46+ (5588) wsgi starting up on http://0.0.0.0:9191/
47+
48+Configuring the server
49+**********************
50+
51+There are a few options that can be supplied to the registry server when
52+starting it up:
53+
54+* ``verbose``
55+
56+ Show more verbose/debugging output
57+
58+* ``sql_connection``
59+
60+ A proper SQLAlchemy connection string as described `here <http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html?highlight=engine#sqlalchemy.create_engine>`_
61+
62+* ``registry_host``
63+
64+ Address of the host the registry runs on. Defaults to 0.0.0.0.
65+
66+* ``registry_port``
67+
68+ Port the registry server listens on. Defaults to 9191.
69+
70+Glance Registry API
71+-------------------
72+
73+Any web service that publishes an API that conforms to the following
74+REST-like API specification can be used by Glance as a registry.
75+
76+API in Summary
77+**************
78+
79+The following is a brief description of the Glance API::
80+
81+ GET /images Return brief information about public images
82+ GET /images/detail Return detailed information about public images
83+ GET /images/<ID> Return metadata about an image in HTTP headers
84+ POST /images Register metadata about a new image
85+ PUT /images/<ID> Update metadata about an existing image
86+ DELETE /images/<ID> Remove an image's metadata from the registry
87+
88+Examples
89+********
90+
91+.. todo:: Complete examples for Glance registry API
92
93=== modified file 'glance/registry/__init__.py'
94--- glance/registry/__init__.py 2010-12-27 20:03:03 +0000
95+++ glance/registry/__init__.py 2011-01-18 22:01:22 +0000
96@@ -20,34 +20,45 @@
97 Registry API
98 """
99
100+from glance.common import flags
101 from glance.registry import client
102
103+FLAGS = flags.FLAGS
104+
105+# TODO(jaypipes): Separate server flags from client flags
106+# and allow a list of client host/port
107+# combinations
108+flags.DEFINE_string('registry_host', '0.0.0.0',
109+ 'Registry server lives at this address')
110+flags.DEFINE_integer('registry_port', 9191,
111+ 'Registry server listens on this port')
112+
113
114 def get_images_list():
115- c = client.RegistryClient("0.0.0.0")
116+ c = client.RegistryClient(FLAGS.registry_host, FLAGS.registry_port)
117 return c.get_images()
118
119
120 def get_images_detail():
121- c = client.RegistryClient("0.0.0.0")
122+ c = client.RegistryClient(FLAGS.registry_host, FLAGS.registry_port)
123 return c.get_images_detailed()
124
125
126 def get_image_metadata(image_id):
127- c = client.RegistryClient("0.0.0.0")
128+ c = client.RegistryClient(FLAGS.registry_host, FLAGS.registry_port)
129 return c.get_image(image_id)
130
131
132 def add_image_metadata(image_data):
133- c = client.RegistryClient("0.0.0.0")
134+ c = client.RegistryClient(FLAGS.registry_host, FLAGS.registry_port)
135 return c.add_image(image_data)
136
137
138 def update_image_metadata(image_id, image_data):
139- c = client.RegistryClient("0.0.0.0")
140+ c = client.RegistryClient(FLAGS.registry_host, FLAGS.registry_port)
141 return c.update_image(image_id, image_data)
142
143
144 def delete_image_metadata(image_id):
145- c = client.RegistryClient("0.0.0.0")
146+ c = client.RegistryClient(FLAGS.registry_host, FLAGS.registry_port)
147 return c.delete_image(image_id)

Subscribers

People subscribed via source and target branches