diff options
author | Rico Lin <rico.lin.guanyu@gmail.com> | 2015-07-08 17:22:33 +0800 |
---|---|---|
committer | Rico Lin <rico.lin.guanyu@gmail.com> | 2015-07-08 17:22:33 +0800 |
commit | 11efe222b3339922da8fcc305bf5ad1c3308dc0a (patch) | |
tree | 1040fb179a0b579b9fab5666499a6969518b1dd3 /heat/rpc | |
parent | 347a0b55e4e1cc2fbc8d67adf130fbd5ea61e99c (diff) | |
download | heat-11efe222b3339922da8fcc305bf5ad1c3308dc0a.tar.gz |
support list resources with details
Currently, users can list resources without details, or show
specific resource with details. However, they cannot list all
resources with details. It is desirable to support that.
With consistency concern, we should use {list URI}/detail as
pattern for resources detail list just like other detail list
API, but this pattern will conflict with
{resources list URI}/{resource name} when resoruce name
is 'detail', so implement this feature as a param in list API
seems to be this only option in this case.
DocImpact
APIImpact
Change-Id: I59f464d1803009d7ae2ec35d9fdf0671096967e4
Closes-Bug: #1467268
Diffstat (limited to 'heat/rpc')
-rw-r--r-- | heat/rpc/api.py | 4 | ||||
-rw-r--r-- | heat/rpc/client.py | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/heat/rpc/api.py b/heat/rpc/api.py index 283fa74e7..9ba60c888 100644 --- a/heat/rpc/api.py +++ b/heat/rpc/api.py @@ -19,13 +19,13 @@ PARAM_KEYS = ( PARAM_SHOW_DELETED, PARAM_SHOW_NESTED, PARAM_EXISTING, PARAM_CLEAR_PARAMETERS, PARAM_GLOBAL_TENANT, PARAM_LIMIT, PARAM_NESTED_DEPTH, PARAM_TAGS, PARAM_SHOW_HIDDEN, PARAM_TAGS_ANY, - PARAM_NOT_TAGS, PARAM_NOT_TAGS_ANY, TEMPLATE_TYPE, + PARAM_NOT_TAGS, PARAM_NOT_TAGS_ANY, TEMPLATE_TYPE, PARAM_WITH_DETAIL ) = ( 'timeout_mins', 'disable_rollback', 'adopt_stack_data', 'show_deleted', 'show_nested', 'existing', 'clear_parameters', 'global_tenant', 'limit', 'nested_depth', 'tags', 'show_hidden', 'tags_any', - 'not_tags', 'not_tags_any', 'template_type', + 'not_tags', 'not_tags_any', 'template_type', 'with_detail', ) STACK_KEYS = ( diff --git a/heat/rpc/client.py b/heat/rpc/client.py index 911e2dbc3..6c5df7441 100644 --- a/heat/rpc/client.py +++ b/heat/rpc/client.py @@ -32,6 +32,7 @@ class EngineClient(object): 1.9 - Add template_type option to generate_template() 1.10 - Add support for software config list 1.11 - Add support for template versions list + 1.12 - Add with_detail option for stack resources list ''' BASE_RPC_API_VERSION = '1.0' @@ -421,16 +422,21 @@ class EngineClient(object): stack_identity=stack_identity, resource_name=resource_name)) - def list_stack_resources(self, ctxt, stack_identity, nested_depth=0): + def list_stack_resources(self, ctxt, stack_identity, + nested_depth=0, with_detail=False): """ List the resources belonging to a stack. :param ctxt: RPC context. :param stack_identity: Name of the stack. :param nested_depth: Levels of nested stacks of which list resources. + :param with_detail: show detail for resoruces in list. """ - return self.call(ctxt, self.make_msg('list_stack_resources', - stack_identity=stack_identity, - nested_depth=nested_depth)) + return self.call(ctxt, + self.make_msg('list_stack_resources', + stack_identity=stack_identity, + nested_depth=nested_depth, + with_detail=with_detail), + version='1.12') def stack_suspend(self, ctxt, stack_identity): return self.call(ctxt, self.make_msg('stack_suspend', |