Return a list of the VMs that are on the provider, with select fields
970837
def list_nodes_select(conn=None, call=None):
    '''
    
    '''
    if not conn:
        conn = get_conn()   # pylint: disable=E0602

    return salt.utils.cloud.list_nodes_select(
        list_nodes_full(conn, 'function'), __opts__['query.selection'], call,
    )
1133338
def index(self, req, drivers):
        
        result = []
        for driver in drivers:
            result.append(driver.list_network(req.params))
        data = {
                'action': "index",
                'controller': "network",
                'cloud': req.environ['calplus.cloud'],
                'result': result
        }
        return data
640892
def list_vapps(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_vapps function must be called with '
            '-f or --function.'
        )

    return {'vApps': salt.utils.vmware.list_vapps(_get_si())}
581517
def get_servers_list(self):
        
        ret = []

        if self.args.browser:
            ret = self.static_server.get_servers_list()
            if self.autodiscover_server is not None:
                ret = self.static_server.get_servers_list() + self.autodiscover_server.get_servers_list()

        return ret
1010690
def virtual_machines_list_all(**kwargs):
    '''
    

    '''
    result = {}
    compconn = __utils__['azurearm.get_client']('compute', **kwargs)
    try:
        vms = __utils__['azurearm.paged_object_to_list'](
            compconn.virtual_machines.list_all()
        )
        for vm in vms:  # pylint: disable=invalid-name
            result[vm['name']] = vm
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('compute', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
32826
def list_nodes():
    '''
    

    '''
    session = _get_session()
    vms = session.xenapi.VM.get_all_records()
    ret = {}
    for vm in vms:
        record = session.xenapi.VM.get_record(vm)
        if not record['is_a_template'] and not record['is_control_domain']:
            try:
                base_template_name = record['other_config']['base_template_name']
            except Exception:
                base_template_name = None
                log.debug(
                    'VM %s, doesnt have base_template_name attribute',
                    record['name_label']
                )
            ret[record['name_label']] = {'id': record['uuid'],
                                         'image': base_template_name,
                                         'name': record['name_label'],
                                         'size': record['memory_dynamic_max'],
                                         'state': record['power_state'],
                                         'private_ips': get_vm_ip(record['name_label'], session),
                                         'public_ips': None}
    return ret
25233
def get_provider(vm_=None):
    '''
    
    '''
    if vm_ is None:
        provider = __active_provider_name__ or 'ec2'
    else:
        provider = vm_.get('provider', 'ec2')

    if ':' in provider:
        prov_comps = provider.split(':')
        provider = prov_comps[0]
    return provider
554878
def list_networks(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_networks function must be called with '
            '-f or --function.'
        )

    return {'Networks': salt.utils.vmware.list_networks(_get_si())}
939475
def list_domains():
    '''
    
    '''
    with _get_xapi_session() as xapi:
        hosts = xapi.VM.get_all()
        ret = []

        for _host in hosts:
            if xapi.VM.get_record(_host)['is_control_domain'] is False:
                ret.append(xapi.VM.get_name_label(_host))

        return ret
31432
def list_vcls(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/vcl" % (service_id, version_number))
		return map(lambda x: FastlyVCL(self, x), content)
1264130
def list_nodes_full(session=None):
    '''
    

    '''
    if session is None:
        session = _get_session()

    ret = {}
    vms = session.xenapi.VM.get_all()
    for vm in vms:
        record = session.xenapi.VM.get_record(vm)
        if not record['is_a_template'] and not record['is_control_domain']:
            # deal with cases where the VM doesn't have 'base_template_name' attribute
            try:
                base_template_name = record['other_config']['base_template_name']
            except Exception:
                base_template_name = None
                log.debug(
                    'VM %s, doesnt have base_template_name attribute',
                    record['name_label']
                )
            vm_cfg = session.xenapi.VM.get_record(vm)
            vm_cfg['id'] = record['uuid']
            vm_cfg['name'] = record['name_label']
            vm_cfg['image'] = base_template_name
            vm_cfg['size'] = None
            vm_cfg['state'] = record['power_state']
            vm_cfg['private_ips'] = get_vm_ip(record['name_label'], session)
            vm_cfg['public_ips'] = None
            if 'snapshot_time' in vm_cfg.keys():
                del vm_cfg['snapshot_time']
            ret[record['name_label']] = vm_cfg

    provider = __active_provider_name__ or 'xen'
    if ':' in provider:
        comps = provider.split(':')
        provider = comps[0]
    log.debug('ret: %s', ret)
    log.debug('provider: %s', provider)
    log.debug('__opts__: %s', __opts__)
    __utils__['cloud.cache_node_list'](ret, provider, __opts__)
    return ret
486048
def getservers(self, vhost = None):
        '''
        
        '''
        if vhost is not None:
            return [s for s in self.connections if s.protocol.vhost == vhost]
        else:
            return list(self.connections)
951158
def virtual_networks_list_all(**kwargs):
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        vnets = __utils__['azurearm.paged_object_to_list'](netconn.virtual_networks.list_all())

        for vnet in vnets:
            result[vnet['name']] = vnet
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
42500
def get_vm_list(self):
        """"""
        action = "list all guests in database"
        with zvmutils.log_and_reraise_sdkbase_error(action):
            guests_in_db = self._GuestDbOperator.get_guest_list()
            guests_migrated = self._GuestDbOperator.get_migrated_guest_list()

        # db query return value in tuple (uuid, userid, metadata, comments)
        userids_in_db = [g[1].upper() for g in guests_in_db]
        userids_migrated = [g[1].upper() for g in guests_migrated]
        userid_list = list(set(userids_in_db) - set(userids_migrated))

        return userid_list
898051
def list_domains():
    '''
    
    '''
    data = __salt__['vmadm.list'](keyed=True)
    vms = ["UUID                                  TYPE  RAM      STATE             ALIAS"]
    for vm in data:
        vms.append("{vmuuid}{vmtype}{vmram}{vmstate}{vmalias}".format(
            vmuuid=vm.ljust(38),
            vmtype=data[vm]['type'].ljust(6),
            vmram=data[vm]['ram'].ljust(9),
            vmstate=data[vm]['state'].ljust(18),
            vmalias=data[vm]['alias'],
        ))
    return vms
703754
def list_nodes_select(call=None):
    '''
    
    '''
    return salt.utils.cloud.list_nodes_select(
        list_nodes_full(get_location()), __opts__['query.selection'], call,
    )
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())}