Gather the information of currently declared servers.

        :return:
546759
def discover(self):
        '''
        
        '''
        response = {}
        masters = {}
        self.log.info("Looking for a server discovery")
        self._query()
        self._collect_masters_map(response)
        if not response:
            msg = 'No master has been discovered.'
            self.log.info(msg)
        else:
            for addr, descriptions in response.items():
                for data in descriptions:  # Several masters can run at the same machine.
                    msg = salt.utils.stringutils.to_unicode(data)
                    if msg.startswith(self.signature):
                        msg = msg.split(self.signature)[-1]
                        self.log.debug(
                            "Service announcement at '%s:%s'. Response: '%s'",
                            addr[0], addr[1], msg
                        )
                        if ':E:' in msg:
                            err = msg.split(':E:')[-1]
                            self.log.error(
                                'Error response from the service publisher at %s: %s',
                                addr, err
                            )
                            if "timestamp" in err:
                                self.log.error('Publisher sent shifted timestamp from %s', addr)
                        else:
                            if addr not in masters:
                                masters[addr] = []
                            masters[addr].append(
                                salt.utils.json.loads(msg.split(':@:')[-1], _json_module=_json)
                            )
        return masters
1030696
def DbGetHostServersInfo(self, argin):
        
        self._log.debug("In DbGetHostServersInfo()")
        argin = replace_wildcard(argin)
        return self.db.get_host_servers_info(argin)
1006233
def display_servers(server_definitions_filename):
    
    servers = ServerDefinitionFile2(server_definitions_filename)

    title = 'List of all servers that can be tested'

    headers = ['Name', 'Url', 'Default_namespace']
    rows = []
    for server in servers.list_all_servers():
        # specifically does not show server user and pw
        rows.append((server.nickname,
                     server.url,
                     server.default_namespace))

    print_table(title, headers, rows, sort_columns=0)
753150
def server_info(self):
        
        retry = 0
        j = self._get_json('serverInfo')
        while not j and retry < 3:
            logging.warning("Bug https://jira.atlassian.com/browse/JRA-59676 trying again...")
            retry += 1
            j = self._get_json('serverInfo')
        return j
617695
def all_server_links(server_id, rel_to=None):
    """"""
    return [
        server_link(rel, server_id, self_rel=(rel == rel_to))
        for rel in ('delete-server', 'get-server-info', 'server-command')
    ]
443130
def list_servers(backend, socket=DEFAULT_SOCKET_URL, objectify=False):
    '''
    
    '''
    ha_conn = _get_conn(socket)
    ha_cmd = haproxy.cmds.listServers(backend=backend)
    return ha_conn.sendCmd(ha_cmd, objectify=objectify)
25241
def get_server_info(self):
        
        response = self.get_proto(path='')
        message = rest_pb2.GetApiOverviewResponse()
        message.ParseFromString(response.content)
        return ServerInfo(message)
1288907
def sessions_info(self, hosts):
        
        info_by_id = {}

        for server_endpoint, dump in self.dump_by_server(hosts).items():
            server_ip, server_port = server_endpoint
            for line in dump.split("\n"):
                mat = self.IP_PORT_REGEX.match(line)
                if mat is None:
                    continue
                ip, port, sid = mat.groups()
                info_by_id[sid] = ClientInfo(sid, ip, port, server_ip, server_port)

        return info_by_id
1145070
def get_active_nodes(self):
        
        # the -1 4 -1 args are the filters <proxy_id> <type> <server_id>,
        # -1 for all proxies, 4 for servers only, -1 for all servers
        stats_response = self.send_command("show stat -1 4 -1")
        if not stats_response:
            return []

        lines = stats_response.split("\n")
        fields = lines.pop(0).split(",")
        # the first field is the service name, which we key off of so
        # it's not included in individual node records
        fields.pop(0)

        active_nodes = collections.defaultdict(list)

        for line in lines:
            values = line.split(",")
            service_name = values.pop(0)
            active_nodes[service_name].append(
                dict(
                    (fields[i], values[i])
                    for i in range(len(fields))
                )
            )

        return active_nodes
381400
def server_info(self, verbose=False):
        '''
        
        '''
        url = '{}/{}'.format(self.rest_url, 'serverinfo')
        return self.__auth_req_get(url, verbose=verbose)
439188
def find_existing(self):
        
        instances = self.consul.find_servers(self.tags)
        maxnames = len(instances)
        while instances:
            i = instances.pop(0)
            server_id = i[A.server.ID]
            if self.namespace.add_if_unique(server_id):
                log.info('Found existing server, %s' % server_id)
                self.server_attrs = i
                break
            if len(self.namespace.names) >= maxnames:
                break
            instances.append(i)
4282
def info(hosts=None, profile=None):
    '''
    
    '''
    es = _get_instance(hosts, profile)

    try:
        return es.info()
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot retrieve server information, server returned code {0} with message {1}".format(e.status_code, e.error))
825430
def cmd_server_load(self):
        
        servers = defaultdict(int)
        for line in self._valid_lines:
            servers[line.server_name] += 1
        return servers
604588
def get_servers(self, topic):
        

        return (nsq.node.ServerNode(sh) for sh in self.__server_hosts)
277030
def collect_basic_info():
    

    s = sys.version_info
    _collect(json.dumps({'sys.version_info':tuple(s)}))
    _collect(sys.version)
    return sys.version
662494
def DbGetServerInfo(self, argin):
        
        self._log.debug("In DbGetServerInfo()")
        return self.db.get_server_info(argin)
87205
def get_queues(self):
        """"""
        res = self.celery.control.inspect().active_queues() or dict()
        return [result.get('name') for host in res.values() for result in host]