Add client API for accelerator attribute show

Change-Id: I30744311735bd72bd55c69577e73105fc6586543
This commit is contained in:
songwenping 2023-05-16 19:46:50 +08:00 committed by Wenping Song
parent 0f940fe5df
commit 0e349b7cfb
2 changed files with 21 additions and 0 deletions

View File

@ -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="<attribute>",
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."""

View File

@ -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