Use this API to add cachepolicy resources.
978132
public static base_responses add(nitro_service client, cachepolicy resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			cachepolicy addresources[] = new cachepolicy[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new cachepolicy();
				addresources[i].policyname = resources[i].policyname;
				addresources[i].rule = resources[i].rule;
				addresources[i].action = resources[i].action;
				addresources[i].storeingroup = resources[i].storeingroup;
				addresources[i].invalgroups = resources[i].invalgroups;
				addresources[i].invalobjects = resources[i].invalobjects;
				addresources[i].undefaction = resources[i].undefaction;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
523232
public static cachepolicy_stats[] get(nitro_service service) throws Exception{
		cachepolicy_stats obj = new cachepolicy_stats();
		cachepolicy_stats[] response = (cachepolicy_stats[])obj.stat_resources(service);
		return response;
	}
631391
private void addPolicy(String pid, InputStream dsContent) throws GeneralException {
        LOG.info("Adding policy " + pid);

        String policy;

        try {
            policy = IOUtils.toString(dsContent);
            dsContent.close();
            m_policyIndex.addPolicy(pid, policy);
        } catch (IOException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        } catch (PolicyIndexException e) {
            throw new GeneralException("Error adding policy " + pid + " to policy index: " + e.getMessage(), e);
        }


    }
390300
def cache_add(self, resource_url, cache_id):
        
        # Add entry to cache index
        self.cache[resource_url] = cache_id
        # Write cache index content to database file
        with open(self.db_file, 'w') as f:
            for resource in self.cache:
                f.write(resource + '\t' + self.cache[resource] + '\n')
1228472
public static cachepolicylabel[] get(nitro_service service) throws Exception{
		cachepolicylabel obj = new cachepolicylabel();
		cachepolicylabel[] response = (cachepolicylabel[])obj.get_resources(service);
		return response;
	}
347698
public static base_response add(nitro_service client, cacheforwardproxy resource) throws Exception {
		cacheforwardproxy addresource = new cacheforwardproxy();
		addresource.ipaddress = resource.ipaddress;
		addresource.port = resource.port;
		return addresource.add_resource(client);
	}
877839
def add_policy(self, scaling_group, name, policy_type, cooldown,
            change=None, is_percent=False, desired_capacity=None, args=None):
        
        uri = "/%s/%s/policies" % (self.uri_base, utils.get_id(scaling_group))
        body = self._create_policy_body(name, policy_type, cooldown,
                change=change, is_percent=is_percent,
                desired_capacity=desired_capacity, args=args)
        # "body" needs to be a list
        body = [body]
        resp, resp_body = self.api.method_post(uri, body=body)
        pol_info = resp_body.get("policies")[0]
        return AutoScalePolicy(self, pol_info, scaling_group)
953294
public static cachepolicy_binding get(nitro_service service, String policyname) throws Exception{
		cachepolicy_binding obj = new cachepolicy_binding();
		obj.set_policyname(policyname);
		cachepolicy_binding response = (cachepolicy_binding) obj.get_resource(service);
		return response;
	}
413574
private void buildInstalledPackagesCache(Context context) {
        final List<PackageInfo> installedPackages =
                context.getPackageManager().getInstalledPackages(0);

        for (PackageInfo installedPackage : installedPackages) {
            addInstalledPackageToCache(installedPackage.packageName);
        }
    }
249457
protected void addNoCacheHeaders(HttpServletResponse response) {
		String cacheControlValue = response.getHeader(WebConstants.HEADER_CACHE_CONTROL);

		if (cacheControlValue != null && !cacheControlValue.isEmpty()) {
			cacheControlValue = cacheControlValue + ", " + WebConstants.CACHE_CONTROL_NO_STORE;
		} else {
			cacheControlValue = WebConstants.CACHE_CONTROL_NO_STORE;
		}

		response.setHeader(WebConstants.HEADER_CACHE_CONTROL, cacheControlValue);
		response.setHeader(WebConstants.HEADER_PRAGMA, WebConstants.PRAGMA_NO_CACHE);
	}
978831
@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("favicon.ico")
			.addResourceLocations("/assets/favicon.ico").setCachePeriod(RESOURCE_CACHE_PERIOD);
		registry.addResourceHandler("robots.txt")
			.addResourceLocations("assets/robots.txt").setCachePeriod(RESOURCE_CACHE_PERIOD);
		registry.addResourceHandler("/assets/**")
			.addResourceLocations("/assets/").setCachePeriod(RESOURCE_CACHE_PERIOD);
		registry.addResourceHandler("/Documentation/**")
			.addResourceLocations("/Documentation/").setCachePeriod(RESOURCE_CACHE_PERIOD);
	}
1208171
public EVCacheLatch add(String canonicalKey, CachedData cd, int timeToLive, Policy policy) throws Exception {
        if (cd == null) return null; 
        addDataSizeSummary.record(cd.getData().length);
        addTTLSummary.record(timeToLive);
        
        final EVCacheClient[] clients = _pool.getEVCacheClientForWrite();
        final EVCacheLatchImpl latch = new EVCacheLatchImpl(policy, clients.length - _pool.getWriteOnlyEVCacheClients().length, _appName);

        Boolean firstStatus = null;
        for (EVCacheClient client : clients) {
            final Future<Boolean> f = client.add(canonicalKey, timeToLive, cd, latch);
            if(log.isDebugEnabled()) log.debug("ADD : Op Submitted : APP " + _appName + ", key " + canonicalKey + "; future : " + f + "; client : " + client);
            boolean status = f.get().booleanValue();
            if(!status) { // most common case
                if(firstStatus == null) {
                    for(int i = 0; i < clients.length; i++) {
                        latch.countDown();
                    }
                    return latch;
                } else {
                    return fixup(client, clients, canonicalKey, timeToLive, policy);
                }
            }
            if(firstStatus == null) firstStatus = Boolean.valueOf(status);
        }
        return latch;
    }
519337
public void addPolicy(final String name, final ExpirationPolicy policy) {
        LOGGER.trace("Adding expiration policy [{}] with name [{}]", policy, name);
        this.policies.put(name, policy);
    }
1152739
public static base_response add(nitro_service client, vpnsessionpolicy resource) throws Exception {
		vpnsessionpolicy addresource = new vpnsessionpolicy();
		addresource.name = resource.name;
		addresource.rule = resource.rule;
		addresource.action = resource.action;
		return addresource.add_resource(client);
	}
1066877
private static void addCacheInfoUpdate(CacheStatus cacheStatus) {
    long cacheSize = cacheStatus.size;
    synchronized (baseDirSize) {
      Long dirSize = baseDirSize.get(cacheStatus.getBaseDir());
      if( dirSize == null ) {
        dirSize = Long.valueOf(cacheSize);
      } else {
        dirSize += cacheSize;
      }
      baseDirSize.put(cacheStatus.getBaseDir(), dirSize);
    }
    synchronized (baseDirNumberSubDir) {
      Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir());
      if( dirSubDir == null ) {
        dirSubDir = 1;
      } else {
        dirSubDir += 1;
      }
      baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir);
    }
  }
134388
public static base_response add(nitro_service client, policypatset resource) throws Exception {
		policypatset addresource = new policypatset();
		addresource.name = resource.name;
		addresource.indextype = resource.indextype;
		return addresource.add_resource(client);
	}
1178131
public static base_responses add(nitro_service client, cacheforwardproxy resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			cacheforwardproxy addresources[] = new cacheforwardproxy[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new cacheforwardproxy();
				addresources[i].ipaddress = resources[i].ipaddress;
				addresources[i].port = resources[i].port;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}