diff --git a/cyborgclient/osc/v2/attribute.py b/cyborgclient/osc/v2/attribute.py index 6cb8582..e3dc96c 100644 --- a/cyborgclient/osc/v2/attribute.py +++ b/cyborgclient/osc/v2/attribute.py @@ -138,6 +138,26 @@ class DeleteAttribute(command.Command): raise exc.ClientException("\n".join(failures)) +class ShowAttribute(command.ShowOne): + """Show attribute details.""" + log = logging.getLogger(__name__ + ".ShowAttribute") + + def get_parser(self, prog_name): + parser = super(ShowAttribute, self).get_parser(prog_name) + parser.add_argument( + "attribute", + metavar="", + help=_("UUID of the attribute.") + ) + return parser + + def take_action(self, parsed_args): + self.log.debug("take_action(%s)", parsed_args) + acc_client = self.app.client_manager.accelerator + return _show_attribute(acc_client, + parsed_args.attribute) + + def _show_attribute(acc_client, uuid): """Show detailed info about device_profile.""" diff --git a/setup.cfg b/setup.cfg index c69189a..ef9e8e5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -43,6 +43,7 @@ openstack.accelerator.v2 = accelerator_device_attribute_list = cyborgclient.osc.v2.attribute:ListAttribute accelerator_device_attribute_create = cyborgclient.osc.v2.attribute:CreateAttribute accelerator_device_attribute_delete = cyborgclient.osc.v2.attribute:DeleteAttribute + accelerator_device_attribute_show = cyborgclient.osc.v2.attribute:ShowAttribute accelerator_device_profile_list = cyborgclient.osc.v2.device_profile:ListDeviceProfile accelerator_device_profile_create = cyborgclient.osc.v2.device_profile:CreateDeviceProfile accelerator_device_profile_delete = cyborgclient.osc.v2.device_profile:DeleteDeviceProfile