zone/info works
This commit is contained in:
@@ -53,11 +53,11 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
compute = service.Service.create(binary='nova-compute')
|
compute = service.Service.create(binary='nova-compute')
|
||||||
network = service.Service.create(binary='nova-network')
|
network = service.Service.create(binary='nova-network')
|
||||||
volume = service.Service.create(binary='nova-volume')
|
#volume = service.Service.create(binary='nova-volume')
|
||||||
scheduler = service.Service.create(binary='nova-scheduler')
|
scheduler = service.Service.create(binary='nova-scheduler')
|
||||||
#objectstore = service.Service.create(binary='nova-objectstore')
|
#objectstore = service.Service.create(binary='nova-objectstore')
|
||||||
|
|
||||||
service.serve(compute, network, volume, scheduler)
|
service.serve(compute, network, scheduler)
|
||||||
|
|
||||||
apps = []
|
apps = []
|
||||||
paste_config_file = wsgi.paste_config_file('nova-api.conf')
|
paste_config_file = wsgi.paste_config_file('nova-api.conf')
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ class APIRouter(wsgi.Router):
|
|||||||
LOG.debug(_("Including admin operations in API."))
|
LOG.debug(_("Including admin operations in API."))
|
||||||
server_members['pause'] = 'POST'
|
server_members['pause'] = 'POST'
|
||||||
server_members['unpause'] = 'POST'
|
server_members['unpause'] = 'POST'
|
||||||
server_members["diagnostics"] = "GET"
|
server_members['diagnostics'] = 'GET'
|
||||||
server_members["actions"] = "GET"
|
server_members['actions'] = 'GET'
|
||||||
server_members['suspend'] = 'POST'
|
server_members['suspend'] = 'POST'
|
||||||
server_members['resume'] = 'POST'
|
server_members['resume'] = 'POST'
|
||||||
|
|
||||||
mapper.resource("zone", "zones", controller=zones.Controller(),
|
mapper.resource("zone", "zones", controller=zones.Controller(),
|
||||||
collection={'detail': 'GET'})
|
collection={'detail': 'GET', 'info': 'GET'}),
|
||||||
|
|
||||||
mapper.resource("server", "servers", controller=servers.Controller(),
|
mapper.resource("server", "servers", controller=servers.Controller(),
|
||||||
collection={'detail': 'GET'},
|
collection={'detail': 'GET'},
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class Controller(wsgi.Controller):
|
|||||||
_serialization_metadata = {
|
_serialization_metadata = {
|
||||||
'application/xml': {
|
'application/xml': {
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"zone": ["id", "api_url"]}}}
|
"zone": ["id", "api_url", "name", "capabilities"]}}}
|
||||||
|
|
||||||
def index(self, req):
|
def index(self, req):
|
||||||
"""Return all zones in brief"""
|
"""Return all zones in brief"""
|
||||||
@@ -55,6 +55,11 @@ class Controller(wsgi.Controller):
|
|||||||
"""Return all zones in detail"""
|
"""Return all zones in detail"""
|
||||||
return self.index(req)
|
return self.index(req)
|
||||||
|
|
||||||
|
def info(self, req):
|
||||||
|
"""Return name and capabilities for this zone."""
|
||||||
|
return dict(zone=dict(name=FLAGS.zone_name,
|
||||||
|
capabilities=FLAGS.zone_capabilities))
|
||||||
|
|
||||||
def show(self, req, id):
|
def show(self, req, id):
|
||||||
"""Return data about the given zone id"""
|
"""Return data about the given zone id"""
|
||||||
zone_id = int(id)
|
zone_id = int(id)
|
||||||
|
|||||||
@@ -312,3 +312,8 @@ DEFINE_string('host', socket.gethostname(),
|
|||||||
|
|
||||||
DEFINE_string('node_availability_zone', 'nova',
|
DEFINE_string('node_availability_zone', 'nova',
|
||||||
'availability zone of this node')
|
'availability zone of this node')
|
||||||
|
|
||||||
|
DEFINE_string('zone_name', 'nova', 'name of this zone')
|
||||||
|
DEFINE_string('zone_capabilities', 'xen, linux',
|
||||||
|
'comma-delimited list of tags which represent boolean'
|
||||||
|
' capabilities of this zone')
|
||||||
|
|||||||
Reference in New Issue
Block a user