Return a list of available servers.
164264
public function getServers()
    {
        $servers = [];

        if (isset($this->config['servers']) && is_array($this->config['servers'])) {
            foreach ($this->config['servers'] as $server) {
                $servers[] = $server['name'];
            }
        }

        return $servers;
    }
800643
def _server_whitelist(self):
        '''
        
        '''
        whitelist = []
        for server in self.servers:
            if (server not in self.last_error
                    or self.last_error[server] < time.time() - self.PENALTY_BOX_TIME):
                whitelist.append(server)
        if not whitelist:
            whitelist.append(sorted(
                self.last_error.items(), key=lambda kv: kv[1])[0][0])
        return whitelist
161473
def avail_locations(conn=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_locations function must be called with '
            '-f or --function, or with the --list-locations option'
        )

    if conn is None:
        conn = get_conn()

    endpoints = nova.get_entry(conn.get_catalog(), 'type', 'compute')['endpoints']
    ret = {}
    for endpoint in endpoints:
        ret[endpoint['region']] = endpoint

    return ret
303830
def avail_sizes(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_sizes function must be called with '
            '-f or --function, or with the --list-sizes option'
        )

    conn = get_conn()

    sizes = conn.fixed_server_flavors()

    return sizes
588986
def router_connections(self):
        """"""
        clients = []
        for server in self._routers:
            if Servers().is_alive(server):
                client = self.create_connection(Servers().hostname(server))
                clients.append(client)
        return clients
1258398
def get_authservers(self, domainid, page=None):
        """"""
        opts = {}
        if page:
            opts['page'] = page
        return self.api_call(
            ENDPOINTS['authservers']['list'],
            dict(domainid=domainid), **opts)
913372
def get_servers_by_deployment(names)
      servers = []
      all_instances = Connection.all_instances

      if @exact
        result = all_instances.select {|i| names.any? {|n| i['links']['deployment']['name'].eql? n }}
      else
        result = all_instances.select {|i| names.any? {|n| i['links']['deployment']['name'] =~ /#{n}/ }}
      end
      servers = result

      return(servers)
    end
1208242
def get_servers():
    '''
    
    '''
    ret = list()

    with salt.utils.winapi.Com():
        try:
            connection = wmi.WMI(namespace=_WMI_NAMESPACE)
            objs = connection.IIsSmtpServerSetting()

            for obj in objs:
                ret.append(six.text_type(obj.Name))
        except wmi.x_wmi as error:
            _LOG.error('Encountered WMI error: %s', error.com_error)
        except (AttributeError, IndexError) as error:
            _LOG.error('Error getting IIsSmtpServerSetting: %s', error)

    _LOG.debug('Found SMTP servers: %s', ret)
    return ret
946331
def GetAllServers(alias=None,name_groups=False):
		
		if alias is None:  alias = clc.v1.Account.GetAlias()
		servers = []
		clc.v1.Account.GetLocations()
		for location in clc.LOCATIONS:
			try:
				r = clc.v1.API.Call('post','Server/GetAllServers', {'AccountAlias': alias, 'Location': location }, hide_errors=[5,] )
				if name_groups:  r['Servers'] = clc.v1.Group.NameGroups(r['Servers'],'HardwareGroupUUID')
				if int(r['StatusCode']) == 0:  servers += r['Servers']
			except:
				pass
		return(servers)
1228380
def network_list(self):
        '''
        
        '''
        nt_ks = self.compute_conn
        return [network.__dict__ for network in nt_ks.networks.list()]
543475
def get_active_clients():
    """"""
    global drivers

    if not drivers:
        return jsonify([])

    result = {client: get_client_info(client) for client in drivers}
    return jsonify(result)
719787
def server(self):
        
        server = [s for s in self._server.resources() if s.clientIdentifier == self.machineIdentifier]
        if len(server) == 0:
            raise NotFound('Unable to find server with uuid %s' % self.machineIdentifier)
        return server[0]
1212583
public List<ThriftServerInfo> getThriftServers() {
		List<ThriftServerInfo> servers = new ArrayList<>();
		servers.addAll(thriftServers);
		return servers;
	}
811754
def available(self):
        '''  '''
        return self.db_name in map(
            lambda x: x['name'], self._db.get_database_list()
        )
45659
def server_group_list(request):
    """"""
    try:
        return api.nova.server_group_list(request)
    except Exception:
        exceptions.handle(request,
                          _('Unable to retrieve Nova server groups.'))
        return []
1306257
def Servers(self):
		

		return(clc.v2.Servers(
			alias=self.alias,
			servers_lst=[obj['id'] for obj in self.data['links'] if obj['rel']=='server'],
			session=self.session))
925433
def _get_next_server(self):
        """"""

        current_try = 0
        max_tries = len(self._servers)

        while current_try < max_tries:

            server_index = self._raise_server_index()
            server = self._servers[server_index]
            down_until = server['down_until']

            self._logger.debug('Checking server ' + str(current_try + 1) + '/' + str(max_tries) + ': ' + server['url'])

            if down_until == 0:
                self._logger.debug('Elected server: ' + server['url'])
                return server

            if down_until < time.time():
                if self._is_reachable(server):
                    server['down_until'] = 0
                    self._logger.debug('Elected server: ' + server['url'])

                    return server
                else:
                    self._logger.debug('Server still unavailable: ' + server['url'])
                    server['down_until'] = time.time() + 5

            current_try += 1

        raise TransportException('Cannot reach any redis server')