Use this API to add dnskey resources.
16127
public static base_responses add(nitro_service client, dnskey resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dnskey addresources[] = new dnskey[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new dnskey();
				addresources[i].keyname = resources[i].keyname;
				addresources[i].publickey = resources[i].publickey;
				addresources[i].privatekey = resources[i].privatekey;
				addresources[i].expires = resources[i].expires;
				addresources[i].units1 = resources[i].units1;
				addresources[i].notificationperiod = resources[i].notificationperiod;
				addresources[i].units2 = resources[i].units2;
				addresources[i].ttl = resources[i].ttl;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
1320522
def add_resource(self, resource_id, attributes, parents=[],
            issuer='default'):
        
        # MAINT: consider test to avoid adding duplicate resource id
        assert isinstance(attributes, (dict)), "attributes expected to be dict"

        attrs = []
        for key in attributes.keys():
            attrs.append({
                'issuer': issuer,
                'name': key,
                'value': attributes[key]
                })

        body = {
            "resourceIdentifier": resource_id,
            "parents": parents,
            "attributes": attrs,
        }

        return self._put_resource(resource_id, body)
712452
private boolean add(ResourceInternal<T> resource) {
    try {
      mLock.lock();
      if (mResources.size() >= mMaxCapacity) {
        return false;
      } else {
        mResources.put(resource.mResource, resource);
        return true;
      }
    } finally {
      mLock.unlock();
    }
  }
597804
function addResources (statebox, options) {
  options.messages.info('Adding resources...')
  const stateResources = options.pluginComponents.stateResources
  if (!_.isObject(stateResources)) {
    return
  }

  const resourceClasses = {}
  for (const [name, resource] of Object.entries(stateResources)) {
    options.messages.detail(`Adding ${name}`)
    resourceClasses[name] = resource.componentModule
  } // for ...

  statebox.createModuleResources(resourceClasses)

  statebox.registerResourceResolver('function', functionResolver)
}
380398
def add_resources_to_registry():
    
    from deform.widget import default_resource_registry

    default_resource_registry.set_js_resources("jqueryui", None, None)
    default_resource_registry.set_js_resources("datetimepicker", None, None)
    default_resource_registry.set_js_resources("custom_dates", None, None)
    default_resource_registry.set_js_resources(
        "radio_choice_toggle", None, None
    )
    default_resource_registry.set_js_resources("checkbox_toggle", None, None)

    from js.deform import resource_mapping
    # fix missing resource
    from js.select2 import select2
    resource_mapping['select2'] = select2
    # add the datetimepicker
    from js.jquery_timepicker_addon import timepicker
    resource_mapping['datetimepicker'] = timepicker

    resource_mapping['custom_dates'] = custom_dates
    resource_mapping['radio_choice_toggle'] = radio_choice_toggle
    resource_mapping['checkbox_toggle'] = checkbox_toggle
544326
def addSource(self, source, data):
    """"""
    self._aggregate(source, self._aggregators, data, self._result)
1330686
public static base_responses add(nitro_service client, dnsaction64 resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dnsaction64 addresources[] = new dnsaction64[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new dnsaction64();
				addresources[i].actionname = resources[i].actionname;
				addresources[i].prefix = resources[i].prefix;
				addresources[i].mappedrule = resources[i].mappedrule;
				addresources[i].excluderule = resources[i].excluderule;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
1083125
public static base_responses add(nitro_service client, streamidentifier resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			streamidentifier addresources[] = new streamidentifier[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new streamidentifier();
				addresources[i].name = resources[i].name;
				addresources[i].selectorname = resources[i].selectorname;
				addresources[i].interval = resources[i].interval;
				addresources[i].samplecount = resources[i].samplecount;
				addresources[i].sort = resources[i].sort;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
75005
public static base_responses add(nitro_service client, dnstxtrec resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dnstxtrec addresources[] = new dnstxtrec[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new dnstxtrec();
				addresources[i].domain = resources[i].domain;
				addresources[i].String = resources[i].String;
				addresources[i].ttl = resources[i].ttl;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
1372030
def add(self, *resources):
        
        self.doapi_manager.request(self.url + '/resources', method='POST',
                                   data={"resources": _to_taggable(resources)})
396700
def add_assigned_resource(self, resource_type: str,
                              value: Union[str, int, float, bool],
                              parameters: dict = None):
        
        if parameters is None:
            parameters = dict()
        resources = DB.get_hash_value(self.key, 'resources_assigned')
        resources = ast.literal_eval(resources)
        resources.append(dict(type=resource_type, value=value,
                              parameters=parameters))
        DB.set_hash_value(self.key, 'resources_assigned', resources)
1265518
public static base_response add(nitro_service client, dnsaaaarec resource) throws Exception {
		dnsaaaarec addresource = new dnsaaaarec();
		addresource.hostname = resource.hostname;
		addresource.ipv6address = resource.ipv6address;
		addresource.ttl = resource.ttl;
		return addresource.add_resource(client);
	}
870731
def add_resource(mt_file, ref, cache):
    """"""

    if isinstance(mt_file, MetapackDoc):
        doc = mt_file
    else:
        doc = MetapackDoc(mt_file)

    if not 'Resources' in doc:
        doc.new_section('Resources')

    doc['Resources'].args = [e for e in set(doc['Resources'].args + ['Name', 'StartLine', 'HeaderLines', 'Encoding']) if
                             e]

    seen_names = set()

    u = parse_app_url(ref)

    # The web and file URLs don't list the same.

    if u.proto == 'file':
        entries = u.list()
    else:
        entries = [ssu for su in u.list() for ssu in su.list()]

    errors = []

    for e in entries:
        if not add_single_resource(doc, e, cache=cache, seen_names=seen_names):
            errors.append(e)

    if errors:
        prt()
        warn("Found, but failed to add these urls:")
        for e in errors:
            print('    ', e)

    write_doc(doc, mt_file)
569599
public static base_response add(nitro_service client, linkset resource) throws Exception {
		linkset addresource = new linkset();
		addresource.id = resource.id;
		return addresource.add_resource(client);
	}
1195236
def _add_resources(data, runtime):
    
    if "config" not in data:
        data["config"] = {}
    # Convert input resources, which may be a JSON string
    resources = data.get("resources", {}) or {}
    if isinstance(resources, six.string_types) and resources.startswith(("{", "[")):
        resources = json.loads(resources)
        data["resources"] = resources
    assert isinstance(resources, dict), (resources, data)
    data["config"]["resources"] = resources
    # Add in memory and core usage from CWL
    memory = int(float(runtime["ram"]) / float(runtime["cores"]))
    data["config"]["resources"].update({"default": {"cores": int(runtime["cores"]),
                                                    "memory": "%sM" % memory,
                                                    "jvm_opts": ["-Xms%sm" % min(1000, memory // 2),
                                                                    "-Xmx%sm" % memory]}})
    data["config"]["algorithm"]["num_cores"] = int(runtime["cores"])
    return data
518745
public static base_responses add(nitro_service client, lbmetrictable resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			lbmetrictable addresources[] = new lbmetrictable[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new lbmetrictable();
				addresources[i].metrictable = resources[i].metrictable;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
1260834
async def AddPendingResources(self, addcharmwithauthorization, entity, resources):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='Resources',
                   request='AddPendingResources',
                   version=1,
                   params=_params)
        _params['AddCharmWithAuthorization'] = addcharmwithauthorization
        _params['Entity'] = entity
        _params['Resources'] = resources
        reply = await self.rpc(msg)
        return reply