Create a new cluster using information provided in `cluster_info`.
8026
def create(cls, cluster_info):
        
        conn = Qubole.agent(version="v2")
        return conn.post(cls.rest_entity_path, data=cluster_info)
690646
def create(self, name, plugin_name, hadoop_version, description=None,
               cluster_configs=None, node_groups=None, anti_affinity=None,
               net_id=None, default_image_id=None, use_autoconfig=None,
               shares=None, is_public=None, is_protected=None,
               domain_name=None):
        """"""

        data = {
            'name': name,
            'plugin_name': plugin_name,
            'hadoop_version': hadoop_version,
        }

        return self._do_create(data, description, cluster_configs,
                               node_groups, anti_affinity, net_id,
                               default_image_id, use_autoconfig, shares,
                               is_public, is_protected, domain_name)
224394
def create(name, num_cache_nodes=None, engine=None, cache_node_type=None,
           replication_group_id=None, engine_version=None,
           cache_parameter_group_name=None, cache_subnet_group_name=None,
           cache_security_group_names=None, security_group_ids=None,
           snapshot_arns=None, preferred_availability_zone=None,
           preferred_maintenance_window=None, port=None,
           notification_topic_arn=None, auto_minor_version_upgrade=None,
           wait=None, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        conn.create_cache_cluster(
            name, num_cache_nodes, cache_node_type, engine,
            replication_group_id, engine_version, cache_parameter_group_name,
            cache_subnet_group_name, cache_security_group_names,
            security_group_ids, snapshot_arns, preferred_availability_zone,
            preferred_maintenance_window, port, notification_topic_arn,
            auto_minor_version_upgrade)
        if not wait:
            log.info('Created cache cluster %s.', name)
            return True
        while True:
            time.sleep(3)
            config = get_config(name, region, key, keyid, profile)
            if not config:
                return True
            if config['cache_cluster_status'] == 'available':
                return True
        log.info('Created cache cluster %s.', name)
    except boto.exception.BotoServerError as e:
        msg = 'Failed to create cache cluster {0}.'.format(name)
        log.error(msg)
        log.debug(e)
        return False
868673
def restart_cluster(name):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Restarting cluster'
        return ret

    __salt__['trafficserver.restart_cluster']()

    ret['result'] = True
    ret['comment'] = 'Restarted cluster'
    return ret
1061976
def create_new(cls, mapreduce_id, shard_number):
    
    shard_id = cls.shard_id_from_number(mapreduce_id, shard_number)
    state = cls(key_name=shard_id,
                mapreduce_id=mapreduce_id)
    return state
889025
def clone(cls, cluster_id_label, cluster_info):
        
        conn = Qubole.agent(version="v2")
        return conn.post(cls.element_path(cluster_id_label) + '/clone', data=cluster_info)
363292
def from_list(cls, values, settings):
        
        logger.debug('Creating Cluster from list')
        self = cls()
        self.settings = settings
        self.instances = []

        for instance in values:
            uid, ip, port = instance['uid'], instance['ip'], instance['port']
            new_instance = Instance.new(settings=settings, cluster=self, uid=uid, ip=ip, port=port)
            self.instances.append(new_instance)
        return self
1154934
public void createCluster() {
        AmazonElasticMapReduce emr = sparkEmrClientBuilder.build();
        Optional<ClusterSummary> csr = findClusterWithName(emr, sparkClusterName);
        if (csr.isPresent()) {
            String msg = String.format("A cluster with name %s and id %s is already deployed", sparkClusterName, csr.get().getId());
            log.error(msg);
            throw new IllegalStateException(msg);
        } else {
            RunJobFlowResult res = emr.runJobFlow(sparkRunJobFlowRequest);
            String msg = String.format("Your cluster is launched with name %s and id %s.", sparkClusterName, res.getJobFlowId());
            log.info(msg);
        }

    }
333355
def update(self, cluster_id, name=NotUpdated, description=NotUpdated,
               is_public=NotUpdated, is_protected=NotUpdated,
               shares=NotUpdated):
        """"""

        data = {}
        self._copy_if_updated(data, name=name, description=description,
                              is_public=is_public, is_protected=is_protected,
                              shares=shares)

        return self._patch('/clusters/%s' % cluster_id, data)
1239594
def create_datastore_cluster(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The create_datastore_cluster function must be called with '
            '-f or --function.'
        )

    datastore_cluster_name = kwargs.get('name') if kwargs and 'name' in kwargs else None
    datacenter_name = kwargs.get('datacenter') if kwargs and 'datacenter' in kwargs else None

    if not datastore_cluster_name:
        raise SaltCloudSystemExit(
            'You must specify name of the new datastore cluster to be created.'
        )

    if not datastore_cluster_name or len(datastore_cluster_name) >= 80:
        raise SaltCloudSystemExit(
            'The datastore cluster name must be a non empty string of less than 80 characters.'
        )

    if not datacenter_name:
        raise SaltCloudSystemExit(
            'You must specify name of the datacenter where the datastore cluster should be created.'
        )

    # Get the service instance
    si = _get_si()

    # Check if datastore cluster already exists
    datastore_cluster_ref = salt.utils.vmware.get_mor_by_property(si, vim.StoragePod, datastore_cluster_name)
    if datastore_cluster_ref:
        return {datastore_cluster_name: 'datastore cluster already exists'}

    datacenter_ref = salt.utils.vmware.get_mor_by_property(si, vim.Datacenter, datacenter_name)
    if not datacenter_ref:
        raise SaltCloudSystemExit(
            'The specified datacenter does not exist.'
        )

    try:
        datacenter_ref.datastoreFolder.CreateStoragePod(name=datastore_cluster_name)
    except Exception as exc:
        log.error(
            'Error creating datastore cluster %s: %s',
            datastore_cluster_name, exc,
            # Show the traceback if the debug logging level is enabled
            exc_info_on_loglevel=logging.DEBUG
        )
        return False

    return {datastore_cluster_name: 'created'}
639988
def cluster(&block)
      cluster = Cluster.new(self, :logger => logger)
      block ? block.call(cluster) : cluster
    end
385945
def get_cluster(self, name):
        """"""
        clusters = self.data['clusters']
        for cluster in clusters:
            if cluster['name'] == name:
                return cluster
        raise KubeConfError("Cluster name not found.")
532845
def from_node(index, data, modify_index=None):
        

        try:
            data = json.loads(data)
        except (TypeError, ValueError):
            data = None
            modify_index = 0
        if not isinstance(data, dict):
            data = {}
        return ClusterConfig(index, data, index if modify_index is None else modify_index)
207169
def _write_cluster(metacluster, cluster, loci, idx, path):
    
    out_file = op.join(path, 'log', str(idx) + '.bed')
    with utils.safe_run(out_file):
        with open(out_file, 'w') as out_handle:
            for idc in metacluster:
                for idl in cluster[idc].loci2seq:
                    pos = loci[idl].list()
                    print("\t".join(pos[:4] + [str(len(cluster[idc].loci2seq[idl]))] + [pos[-1]]), file=out_handle, end="")
929657
def merge(self, cluster_ids=None, to=None):
        """"""
        if cluster_ids is None:
            cluster_ids = self.selected
        if len(cluster_ids or []) <= 1:
            return
        self.clustering.merge(cluster_ids, to=to)
        self._global_history.action(self.clustering)
21418
def create_in_cluster(self):
        
        try:
            self.api.create_namespaced_deployment(self.namespace, self.body)
        except ApiException as e:
            raise ConuException(
                "Exception when calling Kubernetes API - create_namespaced_deployment: %s\n" % e)

        logger.info("Creating Deployment %s in namespace: %s", self.name, self.namespace)
1238012
def create_or_update_cluster(config_file, override_min_workers,
                             override_max_workers, no_restart, restart_only,
                             yes, override_cluster_name):
    """"""
    config = yaml.load(open(config_file).read())
    if override_min_workers is not None:
        config["min_workers"] = override_min_workers
    if override_max_workers is not None:
        config["max_workers"] = override_max_workers
    if override_cluster_name is not None:
        config["cluster_name"] = override_cluster_name
    config = _bootstrap_config(config)
    get_or_create_head_node(config, config_file, no_restart, restart_only, yes,
                            override_cluster_name)