Add Site Resource

        Add a cusotom implementation of a served http resource.

        :param pluginSubPath: The resource path where you want to serve this resource.
        :param resource: The resource to serve.
        :return: None
960125
def addMobileResource(self, pluginSubPath: bytes, resource: BasicResource) -> None:
        
        pluginSubPath = pluginSubPath.strip(b'/')
        self.__rootMobileResource.putChild(pluginSubPath, resource)
977853
def add_resource(self, resource):
        ''''''
        resource.validate()
        self.update(__raw__={
            '$push': {
                'resources': {
                    '$each': [resource.to_mongo()],
                    '$position': 0
                }
            }
        })
        self.reload()
        post_save.send(self.__class__, document=self,
                       resource_added=resource.id)
1221036
def add_sub_resource(self, relative_id, sub_resource):
        """"""
        existing_sub_resources = self.resources.get(sub_resource.RELATIVE_PATH_TEMPLATE, defaultdict(list))
        existing_sub_resources[relative_id].append(sub_resource)
        self.resources.update({sub_resource.RELATIVE_PATH_TEMPLATE: existing_sub_resources})
531607
public static base_responses add(nitro_service client, vpath resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			vpath addresources[] = new vpath[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new vpath();
				addresources[i].name = resources[i].name;
				addresources[i].destip = resources[i].destip;
				addresources[i].encapmode = resources[i].encapmode;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
126783
function addResourceRoute(routePath, controllerName) {
		resourceRouting.forEach(function(route) {
			var actionPath = route.path.replace(':controller', controllerName);
			route.verbs.forEach(function (verb) {
				addSingleRoute(verb, actionPath, controllerName, route.target.action);
			});
		});
	}
92303
public void addSubsystemFileSource(String subsystemFileName, File zipFile, ZipEntry zipEntry) {
       inputStreamSourceMap.put(subsystemFileName, new ZipEntryInputStreamSource(zipFile, zipEntry));
    }
1372030
def add(self, *resources):
        
        self.doapi_manager.request(self.url + '/resources', method='POST',
                                   data={"resources": _to_taggable(resources)})
510423
public static base_response add(nitro_service client, sslpolicy resource) throws Exception {
		sslpolicy addresource = new sslpolicy();
		addresource.name = resource.name;
		addresource.rule = resource.rule;
		addresource.reqaction = resource.reqaction;
		addresource.action = resource.action;
		addresource.undefaction = resource.undefaction;
		addresource.comment = resource.comment;
		return addresource.add_resource(client);
	}
1094627
def add_path(self, path):
        # type: (_BaseSourcePaths, str) -> None
        
        if isinstance(path, pathlib.Path):
            self._paths.append(path)
        else:
            self._paths.append(pathlib.Path(path))
259060
def add_resource(self, resource, *class_args, **class_kwargs):
        
        name = resource.__name__.lower()
        meta_resource = parse_docs(resource.__doc__, ["$shared"])
        self.meta[name] = meta_resource
        shared = self.meta["$shared"].copy()
        shared.update(meta_resource.get("$shared", {}))
        with MarkKey("%s.$shared" % resource.__name__):
            sp = SchemaParser(validators=self.validators, shared=shared)
        with MarkKey(resource.__name__):
            resource = resource(*class_args, **class_kwargs)
            # group actions by it's name, and
            # make action group a view function
            actions = defaultdict(lambda: {})
            for action in dir(resource):
                find = PATTERN_ACTION.findall(action)
                if not find:
                    continue
                httpmethod, action_name = find[0]
                action_group = actions[action_name]
                fn = getattr(resource, action)
                meta_action = parse_docs(
                    fn.__doc__, ["$input", "$output", "$error"])
                meta_resource[action] = meta_action
                with MarkKey(fn.__name__):
                    action_group[httpmethod] = \
                        self.make_action(fn, sp, meta_action)

        for action_name in actions:
            if action_name == "":
                url = "/" + name
                endpoint = name
            else:
                url = "/{0}/{1}".format(name, action_name)
                endpoint = "{0}@{1}".format(name, action_name)
            action_group = actions[action_name]
            self.app.add_url_rule(
                url, endpoint=endpoint,
                view_func=self.make_view(action_group),
                methods=set(action_group)
            )
20157
async def put(self, request, resource=None, **kwargs):
        
        if resource is None:
            raise RESTNotFound(reason='Resource not found')

        return await self.post(request, resource=resource, **kwargs)
777139
def add(self, subj: Node, pred: URIRef, obj: Node) -> "FHIRResource":
        
        self._g.add((subj, pred, obj))
        return self
23751
def add_plugin(self, plugin):
        
        self.plugin_by_name[plugin.get_plugin_name()] = plugin
        self.plugins.append(plugin)
117794
def add(resource)
      if @list.key? resource.route
        raise DuplicateResource, "A resource accessible via #{resource.http_verb} #{resource.url} already exists"
      end
      @list[resource.route] = resource
    end
1019494
def add_get(self, path: str, handler: _WebHandler, *,
                name: Optional[str]=None, allow_head: bool=True,
                **kwargs: Any) -> AbstractRoute:
        
        resource = self.add_resource(path, name=name)
        if allow_head:
            resource.add_route(hdrs.METH_HEAD, handler, **kwargs)
        return resource.add_route(hdrs.METH_GET, handler, **kwargs)
996216
private JsonObject newSubrequest(RestEntry<JsonObject> record) {
    Preconditions.checkArgument(record.getResourcePath().isPresent(), "Resource path is not defined");
    JsonObject subReq = new JsonObject();
    subReq.addProperty("url", record.getResourcePath().get());
    subReq.add("richInput", record.getRestEntryVal());

    switch (operation) {
      case INSERT_ONLY_NOT_EXIST:
        subReq.addProperty("method", "POST");
        break;
      case UPSERT:
        subReq.addProperty("method", "PATCH");
        break;
      default:
        throw new IllegalArgumentException(operation + " is not supported.");
    }
    return subReq;
  }
31803
def add_path(searchpath, encoding='utf-8', followlinks=False):
    """"""
    if not _has_jinja:
        raise RuntimeError(_except_text)
    _jload.add_loader(FileSystemLoader(searchpath, encoding, followlinks))