diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index 33aec66a..e04be231 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -21,9 +21,101 @@ import sys from heatclient.common import utils +@utils.arg('-u', '--template-url', metavar='', + help='URL of template.') +@utils.arg('-f', '--template-file', metavar='', + help='Path to the template.') +@utils.arg('-c', '--create-timeout', metavar='', + default=60, type=int, + help='Stack creation timeout in minutes. Default: 60') +@utils.arg('-P', '--parameters', metavar='', + help='Parameter values used to create the stack.') +def do_create(hc, args): + '''Create the stack''' + pass + + +@utils.arg('id', metavar='', help='ID of stack to delete.') +def do_delete(hc, args): + '''Delete the stack''' + pass + + +@utils.arg('id', metavar='', help='ID of stack to describe.') +def do_describe(hc, args): + '''Describe the stack''' + pass + + +@utils.arg('-u', '--template-url', metavar='', + help='URL of template.') +@utils.arg('-f', '--template-file', metavar='', + help='Path to the template.') +@utils.arg('-P', '--parameters', metavar='', + help='Parameter values used to create the stack.') +def do_update(hc, args): + '''Update the stack''' + pass + + def do_list(hc, args): - print args - kwargs = {'tenant_id': args.os_tenant_name} + '''List the user's stacks''' + kwargs = {} stacks = hc.stacks.list(**kwargs) columns = ['ID', 'Name', 'Status'] utils.print_list(stacks, columns) + + +@utils.arg('id', metavar='', + help='ID of stack to get the template for.') +def do_gettemplate(hc, args): + '''Get the template''' + pass + + +@utils.arg('-u', '--template-url', metavar='', + help='URL of template.') +@utils.arg('-f', '--template-file', metavar='', + help='Path to the template.') +def do_estimate_template_cost(hc, args): + '''Returns the estimated monthly cost of a template''' + pass + + +@utils.arg('-u', '--template-url', metavar='', + help='URL of template.') +@utils.arg('-f', '--template-file', metavar='', + help='Path to the template.') +def do_validate(hc, args): + '''Validate a template''' + pass + + +@utils.arg('id', metavar='', + help='ID of stack to show the events for.') +def do_event_list(hc, args): + '''List events for a stack''' + pass + + +@utils.arg('-r', '--resource', metavar='', + help='ID of the resource to show the details for.') +@utils.arg('id', metavar='', + help='ID of stack to show the resource for.') +def do_resource(hc, args): + '''Describe the resource''' + pass + + +@utils.arg('id', metavar='', + help='ID of stack to show the resources for.') +def do_resource_list(hc, args): + '''Show list of resources belonging to a stack''' + pass + + +@utils.arg('id', metavar='', + help='ID of stack to show the resource details for.') +def do_resource_list_details(hc, args): + '''Detailed view of resources belonging to a stack''' + pass diff --git a/heatclient/v1/stacks.py b/heatclient/v1/stacks.py index 9a2fda05..8452b31d 100644 --- a/heatclient/v1/stacks.py +++ b/heatclient/v1/stacks.py @@ -22,22 +22,12 @@ import urllib from heatclient.common import base from heatclient.common import utils -UPDATE_PARAMS = ('name', 'disk_format', 'container_format', 'min_disk', - 'min_ram', 'owner', 'size', 'is_public', 'protected', - 'location', 'checksum', 'copy_from', 'properties', - #NOTE(bcwaldon: an attempt to update 'deleted' will be - # ignored, but we need to support it for backwards- - # compatibility with the legacy client library - 'deleted') - -CREATE_PARAMS = UPDATE_PARAMS + ('id',) - DEFAULT_PAGE_SIZE = 20 class Stack(base.Resource): def __repr__(self): - return "" % self._info + return "" % self._info def update(self, **fields): self.manager.update(self, **fields) @@ -52,31 +42,6 @@ class Stack(base.Resource): class StackManager(base.Manager): resource_class = Stack -# def get(self, image_id): -# """Get the metadata for a specific stack. -# -# :param image: image object or id to look up -# :rtype: :class:`Image` -# """ -# resp, body = self.api.raw_request('HEAD', '/v1/images/%s' % image_id) -# meta = self._image_meta_from_headers(dict(resp.getheaders())) -# return Stack(self, meta) -# -# def data(self, image, do_checksum=True): -# """Get the raw data for a specific image. -# -# :param image: image object or id to look up -# :param do_checksum: Enable/disable checksum validation -# :rtype: iterable containing image data -# """ -# image_id = base.getid(image) -# resp, body = self.api.raw_request('GET', '/v1/images/%s' % image_id) -# checksum = resp.getheader('x-image-meta-checksum', None) -# if do_checksum and checksum is not None: -# return utils.integrity_iter(body, checksum) -# else: -# return body - def list(self, **kwargs): """Get a list of stacks. @@ -121,6 +86,31 @@ class StackManager(base.Manager): return paginate(params) +# def get(self, image_id): +# """Get the metadata for a specific stack. +# +# :param image: image object or id to look up +# :rtype: :class:`Image` +# """ +# resp, body = self.api.raw_request('HEAD', '/v1/images/%s' % image_id) +# meta = self._image_meta_from_headers(dict(resp.getheaders())) +# return Stack(self, meta) +# +# def data(self, image, do_checksum=True): +# """Get the raw data for a specific image. +# +# :param image: image object or id to look up +# :param do_checksum: Enable/disable checksum validation +# :rtype: iterable containing image data +# """ +# image_id = base.getid(image) +# resp, body = self.api.raw_request('GET', '/v1/images/%s' % image_id) +# checksum = resp.getheader('x-image-meta-checksum', None) +# if do_checksum and checksum is not None: +# return utils.integrity_iter(body, checksum) +# else: +# return body +# # def delete(self, image): # """Delete an image.""" # self._delete("/v1/images/%s" % base.getid(image))