Create a new on demand device under the given project.
542265
def create_demand(self,
                      project_id,
                      facility,
                      plan,
                      operating_system,
                      tags=None,
                      userdata='',
                      hostname=None,
                      count=1):
        
        tags = {} if tags is None else tags
        hostname = self.get_random_hostname() if hostname is None else hostname
        devices = []
        for i in range(1, count + 1):
            new_hostname = hostname if count == 1 else hostname + '-' + str(i)
            self.logger.info('Adding to project %s: %s, %s, %s, %s, %r',
                             project_id,
                             new_hostname,
                             facility,
                             plan,
                             operating_system,
                             tags)
            try:
                device = self.manager.create_device(project_id=project_id,
                                                    hostname=new_hostname,
                                                    facility=facility,
                                                    plan=plan,
                                                    tags=tags,
                                                    userdata=userdata,
                                                    operating_system=operating_system)
                devices.append(device)
            except packet.baseapi.Error as msg:
                raise PacketManagerException(msg)
        return devices
1204791
def create(name, database=None, auto=False, auto_source=False, directory=None, verbose=None):
    """"""
    router = get_router(directory, database, verbose)
    if auto and auto_source:
        auto = auto_source
    router.create(name, auto=auto)
385348
def _create_project(self, path):
        """"""
        self.open_project(path=path)
        self.setup_menu_actions()
        self.add_to_recent(path)
871349
def new_device(self, name, type):
        
        # at least android client also includes a "cid" with is derived from the unique device id
        # and encrypted with a public key in the apk.  The field appears to be optional
        url = posixpath.join(self.rootpath, name)
        r = self.post(url, {'type': type})
        return r
1075025
def network_create(provider, names, **kwargs):
    '''
    

    '''
    client = _get_client()
    return client.extra_action(provider=provider, names=names, action='network_create', **kwargs)
234632
def create_project(self, project_path):
        
        shutil.copytree(self.project_path, project_path)

        self.update_file(project_path, 'requirements.txt', {
            'trionyx_version': trionyx.__version__
        })

        self.update_file(project_path, 'config/local_settings.py', {
            'secret_key': utils.random_string(32)
        })
1157394
def init_device(self):
        """"""
        Device.init_device(self)

        # Add anything here that has to be done before the device is set to
        # its ON state.

        self._set_master_state('on')
        self._devProxy = DeviceProxy(self.get_name())
9669
def create_project(self, name, **kwargs):
        
        data = self._wrap_dict("project", kwargs)
        data["customer"]["name"] = name
        return self.post("/projects.json", data=data)
1346641
def new(self, name=None, stack='cedar', region=None):
        """"""

        payload = {}

        if name:
            payload['app[name]'] = name

        if stack:
            payload['app[stack]'] = stack

        if region:
            payload['app[region]'] = region

        r = self._h._http_resource(
            method='POST',
            resource=('apps',),
            data=payload
        )

        name = json.loads(r.content).get('name')
        return self._h.apps.get(name)
172000
def newDevice(deviceJson, lupusec):
    """"""
    type_tag = deviceJson.get('type')

    if not type_tag:
        _LOGGER.info('Device has no type')

    if type_tag in CONST.TYPE_OPENING:
        return LupusecBinarySensor(deviceJson, lupusec)
    elif type_tag in CONST.TYPE_SENSOR:
        return LupusecBinarySensor(deviceJson, lupusec)
    elif type_tag in CONST.TYPE_SWITCH:
        return LupusecSwitch(deviceJson, lupusec)
    else:
        _LOGGER.info('Device is not known')
    return None
1183402
def create_volume(self, project_id, plan, size, facility, label=""):
        
        try:
            return self.manager.create_volume(project_id, label, plan, size, facility)
        except packet.baseapi.Error as msg:
            raise PacketManagerException(msg)
1091777
def _create(self, **kwargs):
        """"""
        if 'uri' in self._meta_data:
            error = "There was an attempt to assign a new uri to this "\
                    "resource, the _meta_data['uri'] is %s and it should"\
                    " not be changed." % (self._meta_data['uri'])
            raise URICreationCollision(error)
        self._check_exclusive_parameters(**kwargs)
        requests_params = self._handle_requests_params(kwargs)
        self._minimum_one_is_missing(**kwargs)
        self._check_create_parameters(**kwargs)
        kwargs = self._check_for_python_keywords(kwargs)

        # Reduce boolean pairs as specified by the meta_data entry below
        for key1, key2 in self._meta_data['reduction_forcing_pairs']:
            kwargs = self._reduce_boolean_pair(kwargs, key1, key2)

        # Make convenience variable with short names for this method.
        _create_uri = self._meta_data['container']._meta_data['uri']
        session = self._meta_data['bigip']._meta_data['icr_session']

        kwargs = self._prepare_request_json(kwargs)

        # Invoke the REST operation on the device.
        response = session.post(_create_uri, json=kwargs, **requests_params)

        # Make new instance of self
        result = self._produce_instance(response)
        return result
470433
@Deprecated
    public Project createProject(Project project) throws RedmineException {
        return transport.addObject(project, new BasicNameValuePair("include",
                "trackers"));
    }
665835
protected function _createDevice()
    {
        $browserType = $this->getBrowserType();
        $classname   = $this->_getUserAgentDevice($browserType);
        $this->_device = new $classname($this->getUserAgent(), $this->getServer(), $this->getConfig());
    }
439289
def create_project(project, opts = {})
      data, _status_code, _headers = create_project_with_http_info(project, opts)
      return data
    end
994381
def add_project(project,**kwargs):
    
    user_id = kwargs.get('user_id')

    existing_proj = get_project_by_name(project.name,user_id=user_id)

    if len(existing_proj) > 0:
        raise HydraError("A Project with the name \"%s\" already exists"%(project.name,))

    #check_perm(user_id, 'add_project')
    proj_i = Project()
    proj_i.name = project.name
    proj_i.description = project.description
    proj_i.created_by = user_id

    attr_map = hdb.add_resource_attributes(proj_i, project.attributes)
    db.DBSession.flush() #Needed to get the resource attr's ID
    proj_data = _add_project_attribute_data(proj_i, attr_map, project.attribute_data)
    proj_i.attribute_data = proj_data

    proj_i.set_owner(user_id)

    db.DBSession.add(proj_i)
    db.DBSession.flush()

    return proj_i
559967
private static IProject createBaseProject(String projectName, URI location)
	{
		// it is acceptable to use the ResourcesPlugin class
		IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);

		if (!newProject.exists())
		{
			URI projectLocation = location;
			IProjectDescription desc = newProject.getWorkspace().newProjectDescription(newProject.getName());

			if (location != null
					|| ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location))
			{
				projectLocation = null;
			}

			desc.setLocationURI(projectLocation);
			try
			{
				newProject.create(desc, null);
				if (!newProject.isOpen())
				{
					newProject.open(null);
				}
			} catch (CoreException e)
			{
				VdmCore.log("VdmModelManager createBaseProject", e);
			}
		}

		return newProject;
	}