Create resource.
		
		:param resort.engine.execution.Context context:
		   Current execution context.
553193
def insert(self, context):
	
		
		
		status_code, msg = self.__endpoint.post(
			"/resources/custom-resource",
			data={
				"id": self.__name,
				"restype": self.__restype,
				"factoryclass": self.__factclass,
				"property": props_value(self.__props)
			}
		)
		self.__available = True
901719
@Override
	public InputStream createResourceAsStream(GeneratorContext context) {

		String path = context.getPath();
		return rd.getResourceAsStream(path);
	}
90813
def build_context(operation, dependencies)
      RailsWorkflow::Context.new(
        parent: operation,
        data: prepare_context_data(dependencies) || operation.process.data
      )
    end
882671
def create_resource(resource, opts = {})
      data, _status_code, _headers = create_resource_with_http_info(resource, opts)
      return data
    end
646241
def create(self, project, slug, content, **attrs):
        
        attrs.update({'project': project, 'slug': slug, 'content': content})
        return self._new_resource(payload=attrs)
881124
def create(self):
        
        self.service.create()

        # Set environment variables for immediate use
        predix.config.set_env_value(self.use_class, 'uri', self._get_uri())
        predix.config.set_env_value(self.use_class, 'zone_id',
                self._get_zone_id())
1367771
protected Map<String, Object> createContext() {
    Map<String, Object> context = Maps.newHashMap();

    context.put("log", createLogger());
    context.put("container", containerHelper);
    context.put("plugin", pluginDescriptor);
    context.put("pluginContext", getPluginContext());
    context.put("mojo", mojoExecution);
    context.put("basedir", basedir);
    context.put("project", project);
    context.put("properties", createProperties());
    context.put("session", session);
    context.put("settings", settings);
    context.put("ant", MagicContext.ANT_BUILDER);
    context.put("fail", new FailClosureTarget());

    return context;
  }
891960
def create(self, project, title, href, **attrs):
        
        attrs.update({'project': project, 'title': title, 'href': href})
        return self._new_resource(payload=attrs)
933218
def create(self, params, args, data):
        # type: (str, dict, dict) -> AppModel
        
        ctx = self._create_context(params, args, data)
        model = self._create_one(ctx)
        self._save_one(model, ctx)
        return self._return_saved_one(model, ctx)
653774
def generate_context(force_overwrite=False, drop_secret_key=False):
    

    print('... generating context')
    context_fp = '%s/context.json' % os.environ['PRODUCT_DIR']
    context = {}

    if os.path.isfile(context_fp):
        print('... augment existing context.json')

        with open(context_fp, 'r') as context_f:
            content = context_f.read().strip() or '{}'
            try:
                context = json.loads(content)
            except ValueError:
                print('ERROR: not valid json in your existing context.json!!!')
                return

        if force_overwrite:
            print('... overwriting existing context.json')
            if drop_secret_key:
                print('... generating new SECRET_KEY')
                context = {}
            else:
                print('... using existing SECRET_KEY from existing context.json')
                context = {'SECRET_KEY': context['SECRET_KEY']}

    with open(context_fp, 'w') as context_f:
        new_context = tasks.get_context_template()

        new_context.update(context)
        context_f.write(json.dumps(new_context, indent=4, sort_keys=True))
    print()
    print('*** Successfully generated context.json')
1337428
def create_context(self, message_queue, task_id):
        
        parent_data = ParentData(self.parent.kind, self.parent.remote_id)
        path_data = self.local_file.get_path_data()
        params = parent_data, path_data, self.local_file.remote_id
        return UploadContext(self.settings, params, message_queue, task_id)
804157
def set_execution_context(self, execution_context):
        """"""
        if self._execution_context:
            raise errors.AlreadyInContextError

        self._execution_context = execution_context
158563
def create_context(ctx):
    
    ctx_cls_name = ctx.get("class", "insights.core.context.HostContext")
    if "." not in ctx_cls_name:
        ctx_cls_name = "insights.core.context." + ctx_cls_name
    ctx_cls = dr.get_component(ctx_cls_name)
    ctx_args = ctx.get("args", {})
    return ctx_cls(**ctx_args)
210831
def create_build_context(image, inputs, wdir):
    
    assert os.path.isabs(wdir)

    dockerlines = ["FROM %s" % image,
                    "RUN mkdir -p %s" % wdir]
    build_context = {}

    # This loop creates a Build Context for building the provisioned image
    # We create a tar archive to be added to the root of the image filesystem
    if inputs:
        dockerlines.append('COPY root /')
        for ifile, (path, obj) in enumerate(inputs.items()):
            if not os.path.isabs(path):
                path = os.path.join(wdir, path)
            assert path[0] == '/'
            build_context['root' + path] = obj

    dockerstring = '\n'.join(dockerlines)
    build_context['Dockerfile'] = pyccc.BytesContainer(dockerstring.encode('utf-8'))
    return build_context
645886
def create(context, resource, **kwargs):
    """"""
    data = utils.sanitize_kwargs(**kwargs)
    uri = '%s/%s' % (context.dci_cs_api, resource)
    r = context.session.post(uri, timeout=HTTP_TIMEOUT,
                             json=data)
    return r
275287
def create(self, resource, obj,
               operation_timeout=None, max_envelope_size=None, locale=None):
        
        if isinstance(resource, str):
            resource = ResourceLocator(resource)

        headers = self._build_headers(resource, Session.CreateAction,
                                      operation_timeout, max_envelope_size, locale)
        return self.service.invoke(headers, obj)
717881
public Reader createResource(GeneratorContext context) {
		String data = null;
		try {
			if (dwrLibraries.containsKey(context.getPath())) {
				// Static script
				data = getStaticScript(dwrLibraries.get(context.getPath()),
						context);
			} else if (ALL_INTERFACES_KEY.equals(context.getPath())) {
				// All interfaces
				data = getAllPublishedInterfaces(context);
			} else {
				// This must be a specific interface ...
				StringBuilder sb = new StringBuilder();
				StringTokenizer tk = new StringTokenizer(context.getPath(), "|");
				while (tk.hasMoreTokens()) {
					sb.append(getInterfaceScript(tk.nextToken(), context));
				}
				data = sb.toString();
			}

		} catch (IOException e) {
			throw new RuntimeException(
					"An IO error occured while getting content from DWR", e);
		}
		return new StringReader(data);
	}