Create a new AdminClient for making topics, partitions, and more.

This is a factory method because it immediately starts an
active handle with the brokers.
347647
function createAdminClient(conf) {
  var client = new AdminClient(conf);

  // Wrap the error so we throw if it failed with some context
  LibrdKafkaError.wrap(client.connect(), true);

  // Return the client if we succeeded
  return client;
}
179975
def create(self, **kwargs):
        '''
        '''

        try:
            cluster = getattr(self, "cluster", None)
        except NoClusterToManage:
            cluster = None
        if cluster is not None:
            msg = 'The ClusterManager is already managing a cluster.'
            raise AlreadyManagingCluster(msg)

        self._check_device_number(kwargs['devices'])
        self.trust_domain.create(
            devices=kwargs['devices'],
            partition=kwargs['device_group_partition']
        )
        self.device_group.create(**kwargs)
        self.cluster = Cluster(**kwargs)
1280980
protected PersistenceBrokerInternal createNewBrokerInstance(PBKey key) throws PBFactoryException
    {
        if (key == null) throw new PBFactoryException("Could not create new broker with PBkey argument 'null'");
        // check if the given key really exists
        if (MetadataManager.getInstance().connectionRepository().getDescriptor(key) == null)
        {
            throw new PBFactoryException("Given PBKey " + key + " does not match in metadata configuration");
        }
        if (log.isEnabledFor(Logger.INFO))
        {
            // only count created instances when INFO-Log-Level
            log.info("Create new PB instance for PBKey " + key +
                    ", already created persistence broker instances: " + instanceCount);
            // useful for testing
            ++this.instanceCount;
        }

        PersistenceBrokerInternal instance = null;
        Class[] types = {PBKey.class, PersistenceBrokerFactoryIF.class};
        Object[] args = {key, this};
        try
        {
            instance = (PersistenceBrokerInternal) ClassHelper.newInstance(implementationClass, types, args);
            OjbConfigurator.getInstance().configure(instance);
            instance = (PersistenceBrokerInternal) InterceptorFactory.getInstance().createInterceptorFor(instance);
        }
        catch (Exception e)
        {
            log.error("Creation of a new PB instance failed", e);
            throw new PBFactoryException("Creation of a new PB instance failed", e);
        }
        return instance;
    }
517964
static Channel createNewInstance(String name, HFClient clientContext) throws InvalidArgumentException {
        return new Channel(name, clientContext);
    }
798156
def create(self, project, email, role, **attrs):
        
        attrs.update({'project': project, 'email': email, 'role': role})
        return self._new_resource(payload=attrs)
1219739
def create(name, allocated_storage, db_instance_class, engine,
           master_username, master_user_password, db_name=None,
           db_security_groups=None, vpc_security_group_ids=None,
           vpc_security_groups=None, availability_zone=None,
           db_subnet_group_name=None, preferred_maintenance_window=None,
           db_parameter_group_name=None, backup_retention_period=None,
           preferred_backup_window=None, port=None, multi_az=None,
           engine_version=None, auto_minor_version_upgrade=None,
           license_model=None, iops=None, option_group_name=None,
           character_set_name=None, publicly_accessible=None, wait_status=None,
           tags=None, db_cluster_identifier=None, storage_type=None,
           tde_credential_arn=None, tde_credential_password=None,
           storage_encrypted=None, kms_key_id=None, domain=None,
           copy_tags_to_snapshot=None, monitoring_interval=None,
           monitoring_role_arn=None, domain_iam_role_name=None, region=None,
           promotion_tier=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    if not allocated_storage:
        raise SaltInvocationError('allocated_storage is required')
    if not db_instance_class:
        raise SaltInvocationError('db_instance_class is required')
    if not engine:
        raise SaltInvocationError('engine is required')
    if not master_username:
        raise SaltInvocationError('master_username is required')
    if not master_user_password:
        raise SaltInvocationError('master_user_password is required')
    if availability_zone and multi_az:
        raise SaltInvocationError('availability_zone and multi_az are mutually'
                                  ' exclusive arguments.')
    if wait_status:
        wait_stati = ['available', 'modifying', 'backing-up']
        if wait_status not in wait_stati:
            raise SaltInvocationError(
                'wait_status can be one of: {0}'.format(wait_stati))
    if vpc_security_groups:
        v_tmp = __salt__['boto_secgroup.convert_to_group_ids'](
                groups=vpc_security_groups, region=region, key=key, keyid=keyid,
                profile=profile)
        vpc_security_group_ids = (vpc_security_group_ids + v_tmp
                                  if vpc_security_group_ids else v_tmp)

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        if not conn:
            return {'results': bool(conn)}

        kwargs = {}
        boto_params = set(boto3_param_map.keys())
        keys = set(locals().keys())
        tags = _tag_doc(tags)

        for param_key in keys.intersection(boto_params):
            val = locals()[param_key]
            if val is not None:
                mapped = boto3_param_map[param_key]
                kwargs[mapped[0]] = mapped[1](val)

        # Validation doesn't want parameters that are None
        # https://github.com/boto/boto3/issues/400
        kwargs = dict((k, v) for k, v in six.iteritems(kwargs) if v is not None)

        rds = conn.create_db_instance(**kwargs)

        if not rds:
            return {'created': False}
        if not wait_status:
            return {'created': True, 'message':
                    'RDS instance {0} created.'.format(name)}

        while True:
            jmespath = 'DBInstances[*].DBInstanceStatus'
            status = describe_db_instances(name=name, jmespath=jmespath,
                                           region=region, key=key, keyid=keyid,
                                           profile=profile)
            if status:
                stat = status[0]
            else:
                # Whoops, something is horribly wrong...
                return {'created': False,
                        'error': "RDS instance {0} should have been created but"
                                 " now I can't find it.".format(name)}
            if stat == wait_status:
                return {'created': True,
                        'message': 'RDS instance {0} created (current status '
                        '{1})'.format(name, stat)}
            time.sleep(10)
            log.info('Instance status after 10 seconds is: %s', stat)

    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
102833
function create(fileToCreate) {
  //Creating a unique channel to get the response
  var topicUid = shortid.generate();
  var topicParams = {topicUid: topicUid, itemToCreate: fileToCreate};
  var donePromise = mediator.promise(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE, CONSTANTS.DONE_PREFIX, topicUid));
  var errorPromise = mediator.promise(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE, CONSTANTS.ERROR_PREFIX, topicUid));
  mediator.publish(fileSubscribers.getTopic(CONSTANTS.TOPICS.CREATE), topicParams);

  return getTopicPromises(donePromise, errorPromise);
}
527129
def create_service(self, *args, **kwargs):
        
        return self._client.create_service(*args, scope=self.id, **kwargs)
522007
public Client<? extends Options, ? extends OptionsBuilder, ? extends RequestBuilder> newClient() {
        if (clientClassName == null) {
            return new DefaultClient();
        } else {
            try {
                return (Client) Thread.currentThread().getContextClassLoader().loadClass(clientClassName).newInstance();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
757966
def create_asset(self, **kwargs):
        
        asset = predix.admin.asset.Asset(**kwargs)
        asset.create()

        client_id = self.get_client_id()
        if client_id:
            asset.grant_client(client_id)

        asset.add_to_manifest(self)
        return asset
580249
CompletableFuture<Partition> join(
      PartitionManagementService managementService,
      ThreadContextFactory threadFactory) {
    election = managementService.getElectionService().getElectionFor(partitionId);
    server = new LogPartitionServer(
        this,
        managementService,
        config,
        threadFactory);
    client = new LogPartitionClient(this, managementService, threadFactory);
    return server.start().thenCompose(v -> client.start()).thenApply(v -> this);
  }
715625
protected RaftPartitionServer createServer(PartitionManagementService managementService) {
    return new RaftPartitionServer(
        this,
        config,
        managementService.getMembershipService().getLocalMember().id(),
        managementService.getMembershipService(),
        managementService.getMessagingService(),
        managementService.getPrimitiveTypes(),
        threadContextFactory);
  }
1106677
public Object createConnectionFactory() throws NotSupportedException {

        // Non-managed use is not supported
        final NotSupportedException exception = new NotSupportedException(NLS
                .getString("NON_MANAGED_ENVIRONMENT_CWSIV0351"));
        if (TRACE.isEventEnabled()) {
            SibTr.exception(this, TRACE, exception);
        }
        throw exception;

    }
1035719
public function createClient()
	{
		$client = ClientBuilder::fromConfig($this->environment->all());

		$this->setClient($client);
	}
1075025
def network_create(provider, names, **kwargs):
    '''
    

    '''
    client = _get_client()
    return client.extra_action(provider=provider, names=names, action='network_create', **kwargs)
1265884
def create_acs(self, **kwargs):
        
        acs = predix.admin.acs.AccessControl(**kwargs)
        acs.create()

        client_id = self.get_client_id()
        if client_id:
            acs.grant_client(client_id)

        acs.grant_client(client_id)
        acs.add_to_manifest(self)
        return acs
635255
static public ContentHandleFactory newFactory() {
    return new ContentHandleFactory() {
      @Override
      public Class<?>[] getHandledClasses() {
        return new Class<?>[]{ InputSource.class };
      }
      @Override
      public boolean isHandled(Class<?> type) {
        return InputSource.class.isAssignableFrom(type);
      }
      @Override
      public <C> ContentHandle<C> newHandle(Class<C> type) {
        @SuppressWarnings("unchecked")
        ContentHandle<C> handle = isHandled(type) ?
                                  (ContentHandle<C>) new InputSourceHandle() : null;
        return handle;
      }
    };
  }