Added salt.modules.vsphere.list_capability_definitions that returns dict representations of VMware capability definition

This commit is contained in:
Alexandru Bleotu 2017-09-20 10:12:58 -04:00
parent 8275e57106
commit c88c207011

View File

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