diff options
| author | Josh Kearney <josh@jk0.org> | 2013-04-09 13:59:12 -0500 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2013-04-23 14:09:20 -0500 |
| commit | 6da61e03f03f9a65cbc9203ea9fdd47c64990184 (patch) | |
| tree | d54da4c152a93bc0aa553c1b542a6e8b2cc884bf /openstackclient/image/v2/image.py | |
| parent | 95bf187a4fde78b6d9d93e40a245ddada004c32a (diff) | |
| download | python-openstackclient-6da61e03f03f9a65cbc9203ea9fdd47c64990184.tar.gz | |
Adds image `create` and `delete` functionality.
We use the V1 API for `create` since it does not
yet exist in the V2 API in glanceclient.
For blueprint glance-client.
Change-Id: Ifa819c14f6a013f4530d16247a671e5a1c740a28
Diffstat (limited to 'openstackclient/image/v2/image.py')
| -rw-r--r-- | openstackclient/image/v2/image.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index ce53df20..3b9b349d 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -13,7 +13,7 @@ # under the License. # -"""Image Action Implementations""" +"""Image V2 Action Implementations""" import logging @@ -25,6 +25,27 @@ from glanceclient.common import utils as gc_utils from openstackclient.common import utils +class DeleteImage(command.Command): + """Delete image command""" + + api = "image" + log = logging.getLogger(__name__ + ".DeleteImage") + + def get_parser(self, prog_name): + parser = super(DeleteImage, self).get_parser(prog_name) + parser.add_argument( + "id", + metavar="<image_id>", + help="ID of image to delete.") + return parser + + def take_action(self, parsed_args): + self.log.debug("take_action(%s)" % parsed_args) + + image_client = self.app.client_manager.image + image_client.images.delete(parsed_args.id) + + class ListImage(lister.Lister): """List image command""" |
