Add just a single resource.
183894
def add(self, resource, replace=False):
        """"""
        uri = resource.uri
        if (uri in self and not replace):
            raise ResourceSetDupeError(
                "Attempt to add resource already in this set")
        self[uri] = resource
544326
def addSource(self, source, data):
    """"""
    self._aggregate(source, self._aggregators, data, self._result)
874637
@Override
    public T addAsResource(Asset resource, ArchivePath target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNull(target, "Target should be specified");

        ArchivePath location = new BasicPath(getResourcePath(), target);
        return add(resource, location);
    }
165292
def register_resource(mod, view, **kwargs):
    """"""
    resource_name = view.__name__.lower()[:-8]
    endpoint = kwargs.get('endpoint', "{}_api".format(resource_name))
    plural_resource_name = inflect.engine().plural(resource_name)
    path = kwargs.get('url', plural_resource_name).strip('/')
    url = '/{}'.format(path)
    setattr(view, '_url', url)  # need this for 201 location header
    view_func = view.as_view(endpoint)

    mod.add_url_rule(url, view_func=view_func,
                     methods=['GET', 'POST', 'OPTIONS'])
    mod.add_url_rule('{}/<obj_id>'.format(url),
                     view_func=view_func,
                     methods=['GET', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'])
971926
def add(self, name, *args):
        """"""
        self._add(False, self.authority, name, *args)
1146890
public static ns add(nitro_service client, ns resource) throws Exception
	{
		resource.validate("add");
		return ((ns[]) resource.perform_operation(client, "add"))[0];
	}
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)
1185453
@Override
    public T addAsResource(String resourceName, ArchivePath target) throws IllegalArgumentException {
        Validate.notNull(resourceName, "ResourceName should be specified");
        Validate.notNull(target, "Target should be specified");

        File resource = fileFromResource(resourceName);
        return addAsResource(resource, target);
    }
876044
def addServerResource(self, pluginSubPath: bytes, resource: BasicResource) -> None:
        
        pluginSubPath = pluginSubPath.strip(b'/')
        self.__rootServerResource.putChild(pluginSubPath, resource)
787922
def add_single(self, hostname, ports, nickname=None, **kws):
        '''
            
        '''
        nickname = nickname or hostname

        self[hostname.lower()] = ServerInfo(nickname, hostname, ports, **kws)
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
445643
def add(self, resource):
        
        if isinstance(resource, collections.Iterable):
            for r in resource:
                self.add_if_changed(r)
        else:
            self.add_if_changed(resource)
145011
def addAdminResource(self, pluginSubPath: bytes, resource: BasicResource) -> None:
        
        pluginSubPath = pluginSubPath.strip(b'/')
        self.__rootAdminResource.putChild(pluginSubPath, resource)
681003
def add_changed_resources(self, resources, change=None):
        
        for resource in resources:
            rc = Resource(resource=resource, change=change)
            self.add(rc)
908616
def bulk_add(
        self, item_id, ref_id=None, tags=None, time=None, title=None,
        url=None, wait=True
    ):
        '''
        

        '''
1251114
public void put(String ID,
                    String resourceName,
                    int dir,
                    boolean visible) {
        registerEntry(ID, new ResourceEntry(resourceName, dir), visible);
    }