Lists all virtual networks available to the user and the user's groups.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_vns opennebula
968342
def list_vns(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_vns function must be called with -f or --function.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    vn_pool = server.one.vnpool.info(auth, -2, -1, -1)[1]

    vns = {}
    for v_network in _get_xml(vn_pool):
        vns[v_network.find('NAME').text] = _xml_to_dict(v_network)

    return vns
627584
def list_affinity_groups(kwargs=None, conn=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_affinity_groups function must be called with -f or --function.'
        )

    if not conn:
        conn = get_conn()

    data = conn.list_affinity_groups()
    ret = {}
    for item in data.affinity_groups:
        ret[item.name] = object_to_dict(item)
    return ret
146330
def list_resourcepools(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_resourcepools function must be called with '
            '-f or --function.'
        )

    return {'Resource Pools': salt.utils.vmware.list_resourcepools(_get_si())}
1216817
def list_nodes(conn=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes function must be called with -f or --function.'
        )

    if not conn:
        conn = get_conn()   # pylint: disable=E0602

    nodes = conn.list_nodes()
    ret = {}
    for node in nodes:
        ret[node.name] = {
            'id': node.id,
            'image': node.image,
            'name': node.name,
            'private_ips': node.private_ips,
            'public_ips': node.public_ips,
            'size': node.size,
            'state': node_state(node.state)
        }
    return ret
16479
def list_nodes(call=None):
    '''
    
    '''

    if call == 'action':
        raise SaltCloudException(
            'The list_nodes function must be called with -f or --function.'
        )

    ret = {}

    for device in get_devices_by_token():
        ret[device.hostname] = device.__dict__

    return ret
407764
def network_security_groups_list_all(**kwargs):  # pylint: disable=invalid-name
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        secgroups = __utils__['azurearm.paged_object_to_list'](
            netconn.network_security_groups.list_all()
        )
        for secgroup in secgroups:
            result[secgroup['name']] = secgroup
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
1151743
def list_vms(self, allow_clone=False):
        

        vbox_vms = []
        result = yield from self.execute("list", ["vms"])
        for line in result:
            if len(line) == 0 or line[0] != '"' or line[-1:] != "}":
                continue  # Broken output (perhaps a carriage return in VM name)
            vmname, _ = line.rsplit(' ', 1)
            vmname = vmname.strip('"')
            if vmname == "<inaccessible>":
                continue  # ignore inaccessible VMs
            extra_data = yield from self.execute("getextradata", [vmname, "GNS3/Clone"])
            if allow_clone or len(extra_data) == 0 or not extra_data[0].strip() == "Value: yes":
                # get the amount of RAM
                info_results = yield from self.execute("showvminfo", [vmname, "--machinereadable"])
                ram = 0
                for info in info_results:
                    try:
                        name, value = info.split('=', 1)
                        if name.strip() == "memory":
                            ram = int(value.strip())
                            break
                    except ValueError:
                        continue
                vbox_vms.append({"vmname": vmname, "ram": ram})
        return vbox_vms
293311
def user_list(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_openstack_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.list_users(**kwargs)
80700
def list_networks(conn=None, call=None):
    '''
    

    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_networks function must be called with '
            '-f or --function'
        )
    if conn is None:
        conn = get_conn()
    return conn.list_networks()
844046
def list_hosts(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_hosts function must be called with '
            '-f or --function.'
        )

    return {'Hosts': salt.utils.vmware.list_hosts(_get_si())}
63652
def virtual_interface_list(self, name):
        '''
        
        '''
        nt_ks = self.compute_conn
        nets = nt_ks.virtual_interfaces.list(self._server_uuid_from_name(name))
        return [network.__dict__ for network in nets]
839941
def list_dvs(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_dvs function must be called with '
            '-f or --function.'
        )

    return {'Distributed Virtual Switches': salt.utils.vmware.list_dvs(_get_si())}
342258
def _list_vlans_by_name(self, name):
        
        results = self.list_vlans(name=name, mask='id')
        return [result['id'] for result in results]
980721
def list_active_vms(cwd=None):
    '''
    
    '''
    vms = []
    cmd = 'vagrant status'
    reply = __salt__['cmd.shell'](cmd, cwd=cwd)
    log.info('--->\n%s', reply)
    for line in reply.split('\n'):  # build a list of the text reply
        tokens = line.strip().split()
        if len(tokens) > 1:
            if tokens[1] == 'running':
                vms.append(tokens[0])
    return vms
346938
def list_available_providers(self):
        
        providers = []

        if self.alternative_config_dir:
            for f in os.listdir(os.path.join(self.alternative_config_dir, self.CLOUD_PROVIDERS_DIR)):
                if os.path.splitext(f)[1] in ['.conf', '.json']:
                    try:
                        n = os.path.join(self.alternative_config_dir, self.CLOUD_PROVIDERS_DIR, f)
                        providers.append(ServiceProviderConfiguration(n))
                    except ControllerConfigurationException:
                        pass


        for f in os.listdir(os.path.join(self.default_config_dir, self.CLOUD_PROVIDERS_DIR)):
            if os.path.splitext(f)[1] in ['.conf', '.json']:
                try:
                    n = os.path.join(self.default_config_dir, self.CLOUD_PROVIDERS_DIR, f)
                    providers.append(ServiceProviderConfiguration(n))
                except ControllerConfigurationException:
                    pass

        return providers
711694
def list_permissions(vhost, runas=None):
    '''
    
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    res = __salt__['cmd.run_all'](
        [RABBITMQCTL, 'list_permissions', '-q', '-p', vhost],
        reset_system_locale=False,
        runas=runas,
        python_shell=False)

    return _output_to_dict(res)
280614
def subnets_list(resource_group_name, vnet_name, address_prefix = nil)
      list = network_resource_client.subnets.list(resource_group_name, vnet_name)
      !address_prefix.nil? && !list.empty? ? subnets_list_for_specific_address_space(address_prefix, list) : list
    end