Rename resource_id to resource_name in metadata API

This more accurately reflects what the parameter is, which is just the name
of the resource within the specified stack.

Change-Id: I6bc26c0046e0493c3b98c5753c04cc5a314678d7
Signed-off-by: Zane Bitter <zbitter@redhat.com>
changes/47/9647/1
Zane Bitter 11 years ago
parent bd24e183c1
commit 897ccca9ed

@ -331,7 +331,7 @@ class EngineManager(manager.Manager):
else:
return None
def metadata_get_resource(self, context, stack_name, resource_id):
def metadata_get_resource(self, context, stack_name, resource_name):
"""
Get the metadata for the given resource.
"""
@ -340,7 +340,7 @@ class EngineManager(manager.Manager):
if not s:
return ['stack', None]
r = db_api.resource_get_by_name_and_stack(None, resource_id, s.id)
r = db_api.resource_get_by_name_and_stack(None, resource_name, s.id)
if r is None:
return ['resource', None]

@ -39,7 +39,7 @@ class API(wsgi.Router):
mapper.connect('/stacks/:stack_name/resources/',
controller=metadata_controller, action='list_resources',
conditions=dict(method=['GET']))
mapper.connect('/stacks/:stack_name/resources/:resource_id',
mapper.connect('/stacks/:stack_name/resources/:resource_name',
controller=metadata_controller, action='get_resource',
conditions=dict(method=['GET']))
mapper.connect('/stacks/:stack_name',

@ -63,12 +63,13 @@ class MetadataController:
return json_error(404,
'The stack "%s" does not exist.' % stack_name)
def get_resource(self, req, stack_name, resource_id):
def get_resource(self, req, stack_name, resource_name):
con = context.get_admin_context()
[error, metadata] = rpc.call(con, 'engine',
{'method': 'metadata_get_resource',
'args': {'stack_name': stack_name,
'resource_id': resource_id}})
'resource_name': resource_name}
})
if error:
if error == 'stack':
return json_error(404,

Loading…
Cancel
Save