diff options
author | Peter Razumovsky <prazumovsky@mirantis.com> | 2015-10-20 11:26:43 +0300 |
---|---|---|
committer | Peter Razumovsky <prazumovsky@mirantis.com> | 2015-11-16 17:33:35 +0300 |
commit | d06bcd87d98a337a93cfc7709d6f440a972bb127 (patch) | |
tree | e4117e6d0f1956524d0072663f2c5c0451316556 /heatclient/v1/stacks.py | |
parent | 0a42fb8412c35eb4455144e54ead5d13bd623ae0 (diff) | |
download | python-heatclient-d06bcd87d98a337a93cfc7709d6f440a972bb127.tar.gz |
Add output API calls implementations
Add output APIs support for output-show and output-list
commands. Now output-show and output-list uses output
calls instead of requesting stack get.
implements bp api-call-output
Change-Id: I1bc1cee1c78ecf0c9a18ecc0a871d38e4141e0f7
Depends on: Ia24b24f59e2c592801e4e670ba5510f642ecf45c
Diffstat (limited to 'heatclient/v1/stacks.py')
-rw-r--r-- | heatclient/v1/stacks.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py index 28aa83e..b710271 100644 --- a/heatclient/v1/stacks.py +++ b/heatclient/v1/stacks.py @@ -54,6 +54,12 @@ class Stack(base.Resource): def snapshot_list(self): return self.manager.snapshot_list(self.identifier) + def output_list(self): + return self.manager.output_list(self.identifier) + + def output_show(self, output_key): + return self.manager.output_show(self.identifier, output_key) + def get(self): # set_loaded() first ... so if we have to bail, we know we tried. self._loaded = True @@ -211,6 +217,21 @@ class StackManager(base.BaseManager): body = utils.get_response_body(resp) return body + def output_list(self, stack_id): + stack = self.get(stack_id) + resp = self.client.get('/stacks/%s/outputs' % stack.identifier) + body = utils.get_response_body(resp) + return body + + def output_show(self, stack_id, output_key): + stack = self.get(stack_id) + resp = self.client.get('/stacks/%(id)s/outputs/%(key)s' % { + 'id': stack.identifier, + 'key': output_key + }) + body = utils.get_response_body(resp) + return body + def get(self, stack_id): """Get the metadata for a specific stack. |