Adds a host to the cluster.

    @param hostIds: List of IDs of hosts to add to cluster.
    @return: A list of ApiHostRef objects of the new
             hosts that were added to the cluster
    @since: API v3
774627
def add_hosts(self, hostIds):
    
    hostRefList = [ApiHostRef(self._get_resource_root(), x) for x in hostIds]
    return self._post("hosts", ApiHostRef, True, data=hostRefList,
        api_version=3)
1359614
def _get_ids_from_hostname(self, hostname):
        """"""
        results = self.list_hardware(hostname=hostname, mask="id")
        return [result['id'] for result in results]
1204119
public void setHostIdSet(java.util.Collection<String> hostIdSet) {
        if (hostIdSet == null) {
            this.hostIdSet = null;
            return;
        }

        this.hostIdSet = new com.amazonaws.internal.SdkInternalList<String>(hostIdSet);
    }
40422
def collect_hosts(hosts, randomize=True):
    

    if isinstance(hosts, six.string_types):
        hosts = hosts.strip().split(',')

    result = []
    afi = socket.AF_INET
    for host_port in hosts:

        host, port, afi = get_ip_port_afi(host_port)

        if port < 0:
            port = DEFAULT_KAFKA_PORT

        result.append((host, port, afi))

    if randomize:
        shuffle(result)

    return result
112005
def add_ipv4addr(self, ipv4addr):
        
        for addr in self.ipv4addrs:
            if ((isinstance(addr, dict) and addr['ipv4addr'] == ipv4addr) or
                (isinstance(addr, HostIPv4) and addr.ipv4addr == ipv4addr)):
                raise ValueError('Already exists')
        self.ipv4addrs.append({'ipv4addr': ipv4addr})
220181
private ImmutableList<EndPoint> getEndPointsFromHostDiscovery() {
        Iterable<ServiceEndPoint> hosts = _hostDiscovery.getHosts();

        ImmutableList.Builder<EndPoint> endPoints = ImmutableList.builder();
        for (final ServiceEndPoint host : hosts) {
            if (host.equals(_self)) {
                continue;
            }
            endPoints.add(new EndPoint() {
                @Override
                public String getAddress() {
                    return _endPointAdapter.toEndPointAddress(host);
                }

                @Override
                public boolean isValid() {
                    return Iterables.contains(_hostDiscovery.getHosts(), host);
                }
            });
        }

        return endPoints.build();
    }
1151306
def collect_hosts(api, wanted_hostnames):
  
  all_hosts = api.get_all_hosts(view='full')
  all_hostnames = set([ h.hostname for h in all_hosts])
  wanted_hostnames = set(wanted_hostnames)

  unknown_hosts = wanted_hostnames.difference(all_hostnames)
  if len(unknown_hosts) != 0:
    msg = "The following hosts are not found in Cloudera Manager. "\
          "Please check for typos:\n%s" % ('\n'.join(unknown_hosts))
    LOG.error(msg)
    raise RuntimeError(msg)

  return [ h for h in all_hosts if h.hostname in wanted_hostnames ]
244135
def collect_hosts(hosts, randomize=True):
    

    if isinstance(hosts, six.string_types):
        hosts = hosts.strip().split(',')

    result = []
    for host_port in hosts:

        res = host_port.split(':')
        host = res[0]
        port = int(res[1]) if len(res) > 1 else DEFAULT_KAFKA_PORT
        result.append((host.strip(), port))

    if randomize:
        shuffle(result)

    return result
584111
public java.util.List<String> getHostIds() {
        if (hostIds == null) {
            hostIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return hostIds;
    }
112526
function HostList(options) {
  if (!(this instanceof HostList))
    return new HostList(options);

  this.options = new HostListOptions(options);
  this.network = this.options.network;
  this.logger = this.options.logger.context('hostlist');
  this.address = this.options.address;
  this.resolve = this.options.resolve;

  this.dnsSeeds = [];
  this.dnsNodes = [];

  this.map = new Map();
  this.fresh = [];
  this.totalFresh = 0;
  this.used = [];
  this.totalUsed = 0;
  this.nodes = [];
  this.local = new Map();
  this.banned = new Map();

  this.timer = null;
  this.needsFlush = false;

  this._init();
}
1024476
def addHost(self, name=None):
        '''
        
        '''
        if name is None:
            while True:
                name = 'h' + str(self.__hnum)
                self.__hnum += 1
                if name not in self.__nxgraph:
                    break
        self.__addNode(name, Host)
        return name
1178636
public void setLayerIds(String[] serverLayerIds) {
		for (String serverLayerId : serverLayerIds) {
			addLayerWithFilter(serverLayerId, serverLayerId, null);
		}
	}
1168424
def get_broker_list(cluster_config):
    
    with ZK(cluster_config) as zk:
        brokers = sorted(list(zk.get_brokers().items()), key=itemgetter(0))
        return [(id, data['host']) for id, data in brokers]
68281
public void setAllocationIds(java.util.Collection<String> allocationIds) {
        if (allocationIds == null) {
            this.allocationIds = null;
            return;
        }

        this.allocationIds = new com.amazonaws.internal.SdkInternalList<String>(allocationIds);
    }
14629
def add(self, host_value):
        
        host_obj = self._host_factory(host_value)
        if self._get_match(host_obj) is not None:
            return
        self._add_new(host_obj)
856582
public static base_responses add(nitro_service client, clusternode resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			clusternode addresources[] = new clusternode[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new clusternode();
				addresources[i].nodeid = resources[i].nodeid;
				addresources[i].ipaddress = resources[i].ipaddress;
				addresources[i].state = resources[i].state;
				addresources[i].backplane = resources[i].backplane;
				addresources[i].priority = resources[i].priority;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
803677
function (config, ID) {

        if (!ID) ID = '/';

        if (typeof config[environment] === 'string') hosts[ID] = config[environment];

        for (let element in config) {

            let elementID = (ID === '/') ? '/' + element : ID + '/' + element;
            if (typeof config[element] === 'object') iterate(config[element], elementID);

        }

    }