def list_uplink_dvportgroup(dvs, service_instance=None):
    '''
    Returns the uplink portgroup of a distributed virtual switch.

    dvs
        Name of the DVS containing the portgroup.

    service_instance
        Service instance (vim.ServiceInstance) of the vCenter.
        Default is None.

    .. code-block:: bash

        salt '*' vsphere.list_uplink_dvportgroup dvs=dvs_name
    '''
    proxy_type = get_proxy_type()
    if proxy_type == 'esxdatacenter':
        datacenter = __salt__['esxdatacenter.get_details']()['datacenter']
        dc_ref = _get_proxy_target(service_instance)
    elif proxy_type == 'esxcluster':
        datacenter = __salt__['esxcluster.get_details']()['datacenter']
        dc_ref = salt.utils.vmware.get_datacenter(service_instance, datacenter)
    dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs])
    if not dvs_refs:
        raise VMwareObjectRetrievalError('DVS \'{0}\' was not '
                                         'retrieved'.format(dvs))
    uplink_pg_ref = salt.utils.vmware.get_uplink_dvportgroup(dvs_refs[0])
    return _get_dvportgroup_dict(uplink_pg_ref)
def list_uplink_dvportgroup ( dvs , service_instance = None ) : proxy_type = get_proxy_type ( ) if proxy_type == 'esxdatacenter' : datacenter = __salt__ [ 'esxdatacenter.get_details' ] ( ) [ 'datacenter' ] dc_ref = _get_proxy_target ( service_instance ) elif proxy_type == 'esxcluster' : datacenter = __salt__ [ 'esxcluster.get_details' ] ( ) [ 'datacenter' ] dc_ref = salt . utils . vmware . get_datacenter ( service_instance , datacenter ) dvs_refs = salt . utils . vmware . get_dvss ( dc_ref , dvs_names = [ dvs ] ) if not dvs_refs : raise VMwareObjectRetrievalError ( 'DVS \'{0}\' was not ' 'retrieved' . format ( dvs ) ) uplink_pg_ref = salt . utils . vmware . get_uplink_dvportgroup ( dvs_refs [ 0 ] ) return _get_dvportgroup_dict ( uplink_pg_ref )
Returns the uplink portgroup of a distributed virtual switch.

    dvs
        Name of the DVS containing the portgroup.

    service_instance
        Service instance (vim.ServiceInstance) of the vCenter.
        Default is None.

    .. code-block:: bash

        salt '*' vsphere.list_uplink_dvportgroup dvs=dvs_name