create a deployment with the specified name
767115
def create_deployment(deployment_name,
                      token_manager=None,
                      app_url=defaults.APP_URL):
    
    headers = token_manager.get_access_token_headers()

    payload = {
        'name': deployment_name,
        'isAdmin': True
    }

    deployment_url = environment.get_deployment_url(app_url=app_url)
    response = requests.post('%s/api/v1/deployments' % deployment_url,
                             data=json.dumps(payload),
                             headers=headers)

    if response.status_code == 201:
        return response.json()

    else:
        raise JutException('Error %s: %s' % (response.status_code, response.text))
472030
def create(self, name, **kwargs):
        """"""
        return self._write_op(self._create_nosync, name, **kwargs)
119331
function serve(name, options, init) {
    var _pkg = pkg();
    if (chek_1.isPlainObject(name)) {
        init = options;
        options = name;
        name = undefined;
    }
    if (chek_1.isBoolean(options)) {
        init = options;
        options = undefined;
    }
    var defaults = {
        server: {
            baseDir: './dist'
        }
    };
    name = name || 'dev-server';
    options = chek_1.extend({}, defaults, options);
    var bsync = chek_1.tryRootRequire('browser-sync');
    if (!bsync)
        logger_1.log.error('browser-sync not found try >> npm install browser-sync -s');
    var server = bsync.create(name);
    if (init !== false)
        server.init(options, function (err) {
            if (err) {
                logger_1.log.error(err);
            }
            else {
                logger_1.log.notify("browser Sync server " + name + " started.");
            }
        });
    return server;
}
393635
function writeDeploymentConfigs(deployment) {
  const folderName = deployment[GENERATOR_NAME].deploymentType;
  checkPath(folderName);
  createFolderIfNeeded(folderName);
  writeConfigFile(deployment, path.join(folderName, '.yo-rc.json'));
}
116999
async function deploy() {
  // By default deploy to the staging deployment slot
  const remote = getRemote(process.argv.includes('--production') ? null : 'staging');

  // Initialize a new Git repository inside the `/build` folder
  // if it doesn't exist yet
  const repo = await GitRepo.open('build', { init: true });
  await repo.setRemote(remote.name, remote.url);

  // Fetch the remote repository if it exists
  if ((await repo.hasRef(remote.url, 'master'))) {
    await repo.fetch(remote.name);
    await repo.reset(`${remote.name}/master`, { hard: true });
    await repo.clean({ force: true });
  }

  // Build the project in RELEASE mode which
  // generates optimized and minimized bundles
  process.argv.push('--release');
  await run(require('./build'));

  // Push the contents of the build folder to the remote server via Git
  await repo.add('--all .');
  await repo.commit('Update');
  await repo.push(remote.name, 'master');

  // Check if the site was successfully deployed
  const response = await fetch(remote.website);
  console.log(`${remote.website} -> ${response.statusCode}`);
}
793778
def instance(instance_group_name, index_or_id, options = { deployment_name: Deployments::DEFAULT_DEPLOYMENT_NAME })
      find_instance(instances(options), instance_group_name, index_or_id)
    end
170963
async function create(name, options, api, env) {
  // Grab the cwd and npmClient off of the environment. We can use these to
  // create the folder for the project and for determining what client to use
  // for npm-related commands
  const { CLI_ENV, cwd, npmClient } = env;
  // We support a couple of options for our `create` command, some only exist
  // during development (like link and linkCli).
  const { link, linkCli, plugins = [], presets = [], skip } = options;
  const root = path.join(cwd, name);

  logger.trace('Creating project:', name, 'at:', root);

  if (await fs.exists(root)) {
    throw new Error(`A folder already exists at \`${root}\``);
  }

  // Create the root directory for the new project
  await fs.ensureDir(root);

  const {
    writePackageJson,
    installDependencies,
    linkDependencies,
  } = await createClient(npmClient, root);
  const packageJson = {
    name,
    private: true,
    license: 'MIT',
    scripts: {},
    dependencies: {},
    devDependencies: {},
    toolkit: {},
  };

  // Write the packageJson to the newly created `root` folder
  await writePackageJson(packageJson);

  const installer = linkCli ? linkDependencies : installDependencies;
  await installer(['@carbon/toolkit']);

  if (CLI_ENV === 'production') {
    clearConsole();
  }

  if (skip) {
    displaySuccess(root, name, npmClient);
    return;
  }

  const toolkit = await which('toolkit', { cwd: root });

  if (presets.length > 0) {
    const args = ['add', ...presets, link && '--link'].filter(Boolean);
    await spawn(toolkit, args, {
      cwd: root,
      stdio: 'inherit',
    });
  }

  if (plugins.length > 0) {
    const args = ['add', ...plugins, link && '--link'].filter(Boolean);
    await spawn(toolkit, args, {
      cwd: root,
      stdio: 'inherit',
    });
  }

  displaySuccess(root, name, npmClient);
}
1180796
def create(self):
        """"""
        self.server_attrs = self.consul.create_server(
                "%s-%s" % (self.stack.name, self.name),
                self.disk_image_id,
                self.instance_type,
                self.ssh_key_name,
                tags=self.tags,
                availability_zone=self.availability_zone,
                timeout_s=self.launch_timeout_s,
                security_groups=self.security_groups,
                **self.provider_extras
                )
        log.debug('Post launch delay: %d s' % self.post_launch_delay_s)
        time.sleep(self.post_launch_delay_s)
1043558
public DeploymentNode getDeploymentNodeWithName(String name) {
        if (name == null || name.trim().length() == 0) {
            throw new IllegalArgumentException("A name must be specified.");
        }

        for (DeploymentNode deploymentNode : getChildren()) {
            if (deploymentNode.getName().equals(name)) {
                return deploymentNode;
            }
        }

        return null;
    }
166745
def create(self, ids):
        

        url = build_uri_with_ids('api/v3/pool/deploy/%s/', ids)
        return super(ApiPoolDeploy, self).post(url)
1244486
def create(self, name, instance_dir=None, config='solrconfig.xml', schema='schema.xml'):
        """"""
        params = {
            'action': 'CREATE',
            'name': name,
            'config': config,
            'schema': schema,
        }

        if instance_dir is None:
            params.update(instanceDir=name)
        else:
            params.update(instanceDir=instance_dir)

        return self._get_url(self.url, params=params)
1344062
def set_name(self, name):
        """"""
        if not name:
            name = ''
        self._client['config']['name'] = name
        yield from self._server.client_name(self.identifier, name)
1232009
def deploy(self, image_name, ip, flavor='m1.small'):
        
        body_value = {
            "port": {
                "admin_state_up": True,
                "name": self.name + '_provision',
                "network_id": os_utils.get_network_id(self.nova_api, 'provision_bob'),
                'fixed_ips': [{'ip_address': ip}]}}
        response = self.neutron.create_port(body=body_value)
        self._provision_port_id = response['port']['id']
        self.mac = response['port']['mac_address']

        image_id_to_boot_from = os_utils.get_image_id(self.nova_api, image_name)
        flavor_id = os_utils.get_flavor_id(self.nova_api, flavor)
        # TODO(Gonéri): We don't need keypair for the BM nodes
        keypair_id = os_utils.get_keypair_id(self.nova_api, self._keypair)
        # Ensure with get DHCP lease on the provision network first
        nics = [{'port-id': self._provision_port_id}]

        self._os_instance = os_provisioner.build_openstack_instance(
            self.nova_api,
            self.name,
            image_id_to_boot_from,
            flavor_id,
            keypair_id,
            nics)

        if not self._os_instance:
            LOG.error("deployment has failed")
            raise Exception()

        os_provisioner.add_provision_security_group(self.nova_api)
        os_utils.add_security_groups(self._os_instance, ['provision'])
        os_utils.add_security_groups(self._os_instance, self._security_groups)
        LOG.info("add security groups '%s'" % self._security_groups)
        LOG.info("instance '%s' ready to use" % self.name)

        # the instance should be off for Ironic
        self._os_instance.stop()
1055679
def create_spawnve(original_name):
    

    def new_spawnve(mode, path, args, env):
        import os
        send_process_created_message()
        return getattr(os, original_name)(mode, path, patch_args(args), env)

    return new_spawnve
381676
def deploy(self, name, kwargs, data, line_number, in_deploy=True):
        '''
        
        '''

        # Handle nested deploy names
        if self.deploy_name:
            name = _make_name(self.deploy_name, name)

        # Store the previous values
        old_in_deploy = self.in_deploy
        old_deploy_name = self.deploy_name
        old_deploy_kwargs = self.deploy_kwargs
        old_deploy_data = self.deploy_data
        old_deploy_line_numbers = self.deploy_line_numbers
        self.in_deploy = in_deploy

        # Limit the new hosts to a subset of the old hosts if they existed
        if (
            old_deploy_kwargs
            and old_deploy_kwargs.get('hosts') is not None
        ):
            # If we have hosts - subset them based on the old hosts
            if 'hosts' in kwargs:
                kwargs['hosts'] = [
                    host for host in kwargs['hosts']
                    if host in old_deploy_kwargs['hosts']
                ]
            # Otherwise simply carry the previous hosts
            else:
                kwargs['hosts'] = old_deploy_kwargs['hosts']

        # Make new line numbers - note convert from and back to tuple to avoid
        # keeping deploy_line_numbers mutable.
        new_line_numbers = list(self.deploy_line_numbers or [])
        new_line_numbers.append(line_number)
        new_line_numbers = tuple(new_line_numbers)

        # Set the new values
        self.deploy_name = name
        self.deploy_kwargs = kwargs
        self.deploy_data = data
        self.deploy_line_numbers = new_line_numbers
        logger.debug('Starting deploy {0} (args={1}, data={2})'.format(
            name, kwargs, data,
        ))

        yield

        # Restore the previous values
        self.in_deploy = old_in_deploy
        self.deploy_name = old_deploy_name
        self.deploy_kwargs = old_deploy_kwargs
        self.deploy_data = old_deploy_data
        self.deploy_line_numbers = old_deploy_line_numbers

        logger.debug('Reset deploy to {0} (args={1}, data={2})'.format(
            old_deploy_name, old_deploy_kwargs, old_deploy_data,
        ))
841450
def create_space(deployment_name,
                 space_name,
                 security_policy='public',
                 events_retention_days=0,
                 metrics_retention_days=0,
                 token_manager=None,
                 app_url=defaults.APP_URL):
    
    deployment_id = get_deployment_id(deployment_name,
                                      token_manager=token_manager,
                                      app_url=app_url)

    payload = {
        'name': space_name,
        'security_policy': security_policy,
        'events_retention_days': events_retention_days,
        'metrics_retention_days': metrics_retention_days,
    }

    headers = token_manager.get_access_token_headers()
    deployment_url = environment.get_deployment_url(app_url=app_url)
    response = requests.post('%s/api/v1/deployments/%s/spaces' %
                             (deployment_url, deployment_id),
                             data=json.dumps(payload),
                             headers=headers)

    if response.status_code == 201:
        return response.json()
    else:
        raise JutException('Error %s: %s' % (response.status_code, response.text))
187805
def replace_deployment(name,
                       metadata,
                       spec,
                       source,
                       template,
                       saltenv,
                       namespace='default',
                       **kwargs):
    '''
    
    '''
    body = __create_object_body(
        kind='Deployment',
        obj_class=AppsV1beta1Deployment,
        spec_creator=__dict_to_deployment_spec,
        name=name,
        namespace=namespace,
        metadata=metadata,
        spec=spec,
        source=source,
        template=template,
        saltenv=saltenv)

    cfg = _setup_conn(**kwargs)

    try:
        api_instance = kubernetes.client.ExtensionsV1beta1Api()
        api_response = api_instance.replace_namespaced_deployment(
            name, namespace, body)

        return api_response.to_dict()
    except (ApiException, HTTPError) as exc:
        if isinstance(exc, ApiException) and exc.status == 404:
            return None
        else:
            log.exception(
                'Exception when calling '
                'ExtensionsV1beta1Api->replace_namespaced_deployment'
            )
            raise CommandExecutionError(exc)
    finally:
        _cleanup(**cfg)