mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Added salt.modules.vsphere.list_capability_definitions that returns dict representations of VMware capability definition
This commit is contained in:
parent
8275e57106
commit
c88c207011
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user