Add image show for openstackclient
Closes-Bug: #1751428 Change-Id: Ibfeb0765fa9dc06ef78699dc91fbbf83f31c4ed5 Signed-off-by: pengdake <19921207pq@gmail.com>
This commit is contained in:
parent
2f77408bcf
commit
29ac0b0077
@ -64,6 +64,7 @@ openstack.container.v1 =
|
||||
appcontainer_network_attach = zunclient.osc.v1.containers:NetworkAttach
|
||||
appcontainer_image_search = zunclient.osc.v1.images:SearchImage
|
||||
appcontainer_remove_security_group = zunclient.osc.v1.containers:RemoveSecurityGroup
|
||||
appcontainer_image_show = zunclient.osc.v1.images:ShowImage
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = doc/source
|
||||
|
@ -119,3 +119,25 @@ class SearchImage(command.Lister):
|
||||
columns = ('ID', 'Name', 'Tags', 'Status', 'Size', 'Metadata')
|
||||
return (columns, (utils.get_item_properties(image, columns)
|
||||
for image in images))
|
||||
|
||||
|
||||
class ShowImage(command.ShowOne):
|
||||
"""Describe a specific image"""
|
||||
|
||||
log = logging.getLogger(__name__ + ".ShowImage")
|
||||
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(ShowImage, self).get_parser(prog_name)
|
||||
parser.add_argument(
|
||||
'uuid',
|
||||
metavar='<uuid>',
|
||||
help='UUID of image to describe')
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
client = _get_client(self, parsed_args)
|
||||
opts = {}
|
||||
opts['id'] = parsed_args.uuid
|
||||
image = client.images.get(**opts)
|
||||
columns = _image_columns(image)
|
||||
return columns, utils.get_item_properties(image, columns)
|
||||
|
Loading…
Reference in New Issue
Block a user