diff --git a/salt/modules/vsphere.py b/salt/modules/vsphere.py index 9655fd39fa..f92c3b6339 100644 --- a/salt/modules/vsphere.py +++ b/salt/modules/vsphere.py @@ -4714,6 +4714,26 @@ def _get_capability_definition_dict(cap_metadata): 'type': cap_metadata.propertyMetadata[0].type.typeName} +@depends(HAS_PYVMOMI) +@supports_proxies('esxdatacenter', 'vcenter') +@gets_service_instance_via_proxy +def list_capability_definitions(service_instance=None): + ''' + Returns a list of the metadata of all capabilities in the vCenter. + + service_instance + Service instance (vim.ServiceInstance) of the vCenter. + Default is None. + + .. code-block:: bash + salt '*' vsphere.list_capabilities + ''' + profile_manager = salt.utils.pbm.get_profile_manager(service_instance) + ret_list = [_get_capability_definition_dict(c) for c in + salt.utils.pbm.get_capability_definitions(profile_manager)] + return ret_list + + @depends(HAS_PYVMOMI) @supports_proxies('esxdatacenter', 'esxcluster') @gets_service_instance_via_proxy