Added modules.vsphere.get_service_instance_via_proxy

- retrieves a service instance to the endpoint defined by the proxy
[NOTE] Should be used in state modules, not invoked directly
This commit is contained in:
Alexandru Bleotu 2017-01-13 11:41:45 +00:00
parent 424e83d472
commit 1981ac1618

View File

@ -330,6 +330,18 @@ def gets_service_instance_via_proxy(fn):
return _gets_service_instance_via_proxy
@supports_proxies('esxi')
def get_service_instance_via_proxy(service_instance=None):
'''
Returns a service instance to the proxied endpoint (vCenter/ESXi host).
Note:
Should be used by state functions not invoked directly.
'''
connection_details = _get_proxy_connection_details()
return salt.utils.vmware.get_service_instance(*connection_details)
def esxcli_cmd(cmd_str, host=None, username=None, password=None, protocol=None, port=None, esxi_hosts=None):
'''
Run an ESXCLI command directly on the host or list of hosts.