Returns a list of all hosts registered in the Helios cluster whose name matches the given
pattern.
779684
public ListenableFuture<List<String>> listHosts(final String namePattern) {
    return listHosts(ImmutableMultimap.of("namePattern", namePattern));
  }
445858
def get_host_map(root):
  ''' 
  '''
  hosts_map = {}
  for host in root.get_all_hosts():
    hosts_map[host.hostId] = {"hostname": NAGIOS_HOSTNAME_FORMAT % (host.hostname,),
                              "address": host.ipAddress}

  ''' Also define "virtual hosts" for the CM clusters- they will be the hosts
      to which CM services are mapped
  '''
  for cluster in root.get_all_clusters():
    hosts_map[cluster.name] = {"hostname": cluster.name,
                               "address": quote(cluster.name)}
  hosts_map[CM_DUMMY_HOST] = {"hostname": CM_DUMMY_HOST,
                              "address": CM_DUMMY_HOST}
  return hosts_map
1036622
@GET
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public List<String> list(@QueryParam("namePattern") final String namePattern,
                           @QueryParam("selector") final List<String> hostSelectors) {

    List<String> hosts = namePattern == null ? model.listHosts() : model.listHosts(namePattern);

    if (!hostSelectors.isEmpty()) {
      // check that all supplied selectors are parseable/valid
      final List<HostSelector> selectors = hostSelectors.stream()
          .map(selectorStr -> {
            final HostSelector parsed = HostSelector.parse(selectorStr);
            if (parsed == null) {
              throw new WebApplicationException(
                  Response.status(Response.Status.BAD_REQUEST)
                      .entity("Invalid host selector: " + selectorStr)
                      .build()
              );
            }
            return parsed;
          })
          .collect(Collectors.toList());

      final Map<String, Map<String, String>> hostsAndLabels = getLabels(hosts);

      final HostMatcher matcher = new HostMatcher(hostsAndLabels);
      hosts = matcher.getMatchingHosts(selectors);
    }

    return hosts;
  }
791480
def _get_ids_from_hostname(self, hostname):
        """"""
        results = self.list_instances(hostname=hostname, mask="id")
        return [result['id'] for result in results]
20638
def _get_hosts_from_ports(self, ports):
        
        hosts = map(lambda x: 'localhost:%d' % int(x.strip()), ports.split(','))
        return list(set(hosts))
983624
def get_hosts_dict(self) -> Dict:
        
        return {
            k: deserializer.inventory.InventoryElement.serialize(v).dict()
            for k, v in self.hosts.items()
        }
742343
def local_bind_hosts(self):
        
        self._check_is_started()
        return [_server.local_host for _server in self._server_list if
                _server.local_host is not None]
283059
def get_groupnames(self, hostgroups):
        
        group_names = []
        for hostgroup_id in self.hostgroups:
            hostgroup = hostgroups[hostgroup_id]
            group_names.append(hostgroup.get_name())
        return ','.join(sorted(group_names))
1299687
def _get_distinct_hostnames(self):
        
        hostnames = []
        for section in self.sections:
            hostnames.extend(self._group_get_hostnames(section['name']))
        return set(hostnames)
136825
def all_hosts_in(file)
      servers = []
      file.each do |line|
        if line.include?('Host ')
          servers << line.sub('Host ', '').strip
        end
      end
      servers
    end
1224137
def get_cluster_port_names(self, cluster_name):
        
        port_names = list()
        for host_name in self.get_hosts_by_clusters()[cluster_name]:
            port_names.extend(self.get_hosts_by_name(host_name))
        return port_names
497202
def get_hosts_info(self):
        
        result = []
        index = 0
        while index < self.host_numbers:
            host = self.get_generic_host_entry(index)
            result.append({
                'ip': host['NewIPAddress'],
                'name': host['NewHostName'],
                'mac': host['NewMACAddress'],
                'status': host['NewActive']})
            index += 1
        return result
945296
def _get_hgroup(name, array):
    ''''''
    hostgroup = None
    for temp in array.list_hgroups():
        if temp['name'] == name:
            hostgroup = temp
            break
    return hostgroup
55353
public static List<String> match(List<String> patterns, String name) {
        List<String> matches = new ArrayList<String>();
        for (String pattern : patterns) {
            if (match(pattern, name)) {
                matches.add(pattern);
            }
        }
        return matches;
    }
765758
def get_by_hostname(self, hostname):
        
        resources = self._client.get_all()

        resources_filtered = [x for x in resources if x['hostname'] == hostname]

        if resources_filtered:
            return resources_filtered[0]
        else:
            return None
437766
def _group_get_hostnames(self, group_name):
        
        hostnames = []

        hosts_section = self._get_section(group_name, 'hosts')
        if hosts_section:
            for entry in hosts_section['entries']:
                hostnames.extend(self.expand_hostdef(entry['name']))

        children_section = self._get_section(group_name, 'children')
        if children_section:
            for entry in children_section['entries']:
                hostnames.extend(self._group_get_hostnames(entry['name']))

        return hostnames
983304
def get_name(self, host_name):
        
        if wildcard_match(self._pattern, host_name):
            return host_name
        else:
            return self._fallback