Get all the nodes of a given cluster.

    Args:
        cluster(string): uid of the cluster (e.g 'rennes')
168821
def get_nodes(cluster):
    
    gk = get_api_client()
    site = get_cluster_site(cluster)
    return gk.sites[site].clusters[cluster].nodes.list()
927073
def get_all(self):
        

        clusters = []
        cluster_files = glob.glob("%s/*.%s" % (self.storage_path, self.file_ending))
        for fname in cluster_files:
            try:
                name = fname[:-len(self.file_ending)-1]
                clusters.append(self.get(name))
            except (ImportError, AttributeError) as ex:
                log.error("Unable to load cluster %s: `%s`", fname, ex)
                log.error("If cluster %s was created with a previous version of elasticluster, you may need to run `elasticluster migrate %s %s` to update it.", cluster_file, self.storage_path, fname)
        return clusters
421289
public List<Cluster<M>> getAllClusters() {
    ArrayList<Cluster<M>> res = new ArrayList<>(hierarchy.size());
    for(It<Cluster<M>> iter = hierarchy.iterAll(); iter.valid(); iter.advance()) {
      res.add(iter.get());
    }
    Collections.sort(res, Cluster.BY_NAME_SORTER);
    return res;
  }
1317771
void get_cluster_features(final Context ctx,
                              final List<Integer> cluster4,
                              final List<Integer> cluster6,
                              final List<Integer> cluster,
                              List<Integer> features)
    {
        if (!use_cluster)
        {
            return;
        }

        PUSH(features, CLUSTER(cluster, ctx.S0));
        PUSH(features, CLUSTER4(cluster4, ctx.S0));
        PUSH(features, CLUSTER6(cluster6, ctx.S0));
        PUSH(features, CLUSTER(cluster, ctx.S1));
        PUSH(features, CLUSTER(cluster, ctx.S2));
        PUSH(features, CLUSTER(cluster, ctx.N0));
        PUSH(features, CLUSTER4(cluster4, ctx.N0));
        PUSH(features, CLUSTER6(cluster6, ctx.N0));
        PUSH(features, CLUSTER(cluster, ctx.N1));
        PUSH(features, CLUSTER(cluster, ctx.N2));
        PUSH(features, CLUSTER(cluster, ctx.S0L));
        PUSH(features, CLUSTER(cluster, ctx.S0R));
        PUSH(features, CLUSTER(cluster, ctx.S0L2));
        PUSH(features, CLUSTER(cluster, ctx.S0R2));
        PUSH(features, CLUSTER(cluster, ctx.S0LL));
        PUSH(features, CLUSTER(cluster, ctx.S0RR));
        PUSH(features, CLUSTER(cluster, ctx.S1L));
        PUSH(features, CLUSTER(cluster, ctx.S1R));
        PUSH(features, CLUSTER(cluster, ctx.S1L2));
        PUSH(features, CLUSTER(cluster, ctx.S1R2));
        PUSH(features, CLUSTER(cluster, ctx.S1LL));
        PUSH(features, CLUSTER(cluster, ctx.S1RR));
    }
1165550
def get_cluster_assignment(self):
        """"""
        plan = self.get_cluster_plan()
        assignment = {}
        for elem in plan['partitions']:
            assignment[
                (elem['topic'], elem['partition'])
            ] = elem['replicas']

        return assignment
815656
def _labels_from_pyclusters(self):
        
        clusters = self.model.get_clusters()
        labels = []
        for i in range(0, len(clusters)):
            for j in clusters[i]:
                labels.insert(int(j), i)
        return labels
813360
public ListClustersResponse getClusters() {
    logger.info("Reading clusters.");
    return client.listCluster(
      ListClustersRequest.newBuilder().setParent(instanceName.getInstanceName()).build());
  }
1105352
def cluster_autocomplete(self, text, line, start_index, end_index):
        ""
        if not self.CACHED_CLUSTERS:
            clusters = [cluster.name for cluster in api.get_all_clusters()]
            self.CACHED_CLUSTERS = clusters

        if text:
            return [cluster for cluster in self.CACHED_CLUSTERS if cluster.startswith(text)]
        else:
            return self.CACHED_CLUSTERS
644186
def clusters_sites_obj(clusters):
    
    result = {}
    all_clusters = get_all_clusters_sites()
    clusters_sites = {c: s for (c, s) in all_clusters.items()
                        if c in clusters}
    for cluster, site in clusters_sites.items():

        # here we want the site python-grid5000 site object
        result.update({cluster: get_site_obj(site)})
    return result
35771
def get_cluster_plan(self):
        """"""

        _log.info('Fetching current cluster-topology from Zookeeper...')
        cluster_layout = self.get_topics(fetch_partition_state=False)
        # Re-format cluster-layout
        partitions = [
            {
                'topic': topic_id,
                'partition': int(p_id),
                'replicas': partitions_data['replicas']
            }
            for topic_id, topic_info in six.iteritems(cluster_layout)
            for p_id, partitions_data in six.iteritems(topic_info['partitions'])
        ]
        return {
            'version': 1,
            'partitions': partitions
        }
708116
def get_clusters(self, platform, retry_contexts, all_clusters):
        '''  '''

        possible_cluster_info = {}
        candidates = set(copy.copy(all_clusters))
        while candidates and not possible_cluster_info:
            wait_for_any_cluster(retry_contexts)

            for cluster in sorted(candidates, key=attrgetter('priority')):
                ctx = retry_contexts[cluster.name]
                if ctx.in_retry_wait:
                    continue
                if ctx.failed:
                    continue
                try:
                    cluster_info = self.get_cluster_info(cluster, platform)
                    possible_cluster_info[cluster] = cluster_info
                except OsbsException:
                    ctx.try_again_later(self.find_cluster_retry_delay)
            candidates -= set([c for c in candidates if retry_contexts[c.name].failed])

        ret = sorted(possible_cluster_info.values(), key=lambda c: c.cluster.priority)
        ret = sorted(ret, key=lambda c: c.load)
        return ret
1055897
def destinations(self, cluster='main'):
        """"""
        if not self.config.has_section(cluster):
            raise SystemExit("Cluster '%s' not defined in %s"
                             % (cluster, self.config_file))
        destinations = self.config.get(cluster, 'destinations')
        return destinations.replace(' ', '').split(',')
781745
def get_all_nodes(self):
        
        nodes = self.nodes.values()
        if nodes:
            return reduce(operator.add, nodes, list())
        else:
            return []
715663
def list_clusters(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_clusters function must be called with '
            '-f or --function.'
        )

    return {'Clusters': salt.utils.vmware.list_clusters(_get_si())}
934778
def getAllNodes(self):
        '''
            
        '''

        ret = TagCollection()

        for rootNode in self.getRootNodes():
            ret.append(rootNode)

            ret += rootNode.getAllChildNodes()

        return ret
876812
def cluster(dset,min_distance,min_cluster_size,prefix=None):
    ''''''
    if prefix==None:
        prefix = nl.suffix(dset,'_clust%d' % min_cluster_size)
    return available_method('cluster')(dset,min_distance,min_cluster_size,prefix)
1194096
public static clusternode[] get(nitro_service service) throws Exception{
		clusternode obj = new clusternode();
		clusternode[] response = (clusternode[])obj.get_resources(service);
		return response;
	}