diff options
| author | Sindhu Devale <sindhu.devale@intel.com> | 2016-10-04 13:02:41 -0500 |
|---|---|---|
| committer | Steve Martinelli <s.martinelli@gmail.com> | 2017-03-22 16:39:19 +0000 |
| commit | 832b2591cf299bf51c1922df1cdd4ba0aabe88c0 (patch) | |
| tree | 193de8b30ad51368696a65224f85e1f99527888b /openstackclient/common | |
| parent | 62bf9e2609bd5d092ff1b238546a1fc6175bd575 (diff) | |
| download | python-openstackclient-832b2591cf299bf51c1922df1cdd4ba0aabe88c0.tar.gz | |
OSC Extension Show
Implement Neutron feature of Extension Show into
OpenStack Client.
Change-Id: Ifecb794838cb3bf8c2466d178345349db3cd4003
Implements: blueprint extension-show
Diffstat (limited to 'openstackclient/common')
| -rw-r--r-- | openstackclient/common/extension.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/openstackclient/common/extension.py b/openstackclient/common/extension.py index de480016..07c407f6 100644 --- a/openstackclient/common/extension.py +++ b/openstackclient/common/extension.py @@ -134,3 +134,32 @@ class ListExtension(command.Lister): LOG.warning(message) return (columns, extension_tuples) + + +class ShowExtension(command.ShowOne): + _description = _("Show API extension") + + def get_parser(self, prog_name): + parser = super(ShowExtension, self).get_parser(prog_name) + parser.add_argument( + 'extension', + metavar='<extension>', + help=_('Extension to display. ' + 'Currently, only network extensions are supported. ' + '(Name or Alias)'), + ) + return parser + + def take_action(self, parsed_args): + client = self.app.client_manager.network + columns = ('Alias', 'Description', 'Links', 'Name', + 'Namespace', 'Updated') + ext = str(parsed_args.extension) + obj = client.find_extension(ext) + dict_tuples = (utils.get_item_properties( + obj, + columns, + formatters={},) + ) + + return columns, dict_tuples |
