[python-openstackclient] List security group IDs used by a VM with "openstack server show"
Hello, Currently "openstack server show" provides the list of security groups used by the VM. However, this is a list of names only [1]. Therefore a VM may contain multiple security groups with the same name but different IDs. However, getting the IDs of the security groups used by a VM seems possible according to the API [2]. Would it be possible to make this available via the python-openstackclient CLI? Many thanks, Sebastian [1] https://docs.openstack.org/api-ref/compute/#show-server-details [2] https://docs.openstack.org/api-ref/compute/#list-security-groups-by-server
You need modify CLI code to get ID https://github.com/openstack/python-openstackclient/blob/master/openstackcli... # Add a list with security group name as attribute for s in data: if hasattr(s, 'security_groups') and s.security_groups is not None: s.security_groups_name = [x["name"] for x in s.security_groups] else: s.security_groups_name = []
participants (2)
-
przemyslaw.kuczynski@ochk.pl
-
Sebastian Luna Valero