public ApplicationJarHashesResponse applicationJarHashes(String appId, Map<String, String> hashes) throws Exception { Map<String, String> params = new HashMap<String, String>(); params.put("app_id", appId); params.put("hashes", createParameter(hashes)); String url = getApiUrl("application.jarHashes").toString(); params.put("action", "application.jarHashes"); // use the upload method (POST) to handle the potentially large "hashes" parameter payload String response = executeUpload(url, params, new HashMap<String, File>(), null); return (ApplicationJarHashesResponse) readResponse(response); }
public ApplicationJarHashesResponse applicationJarHashes(String appId, Map<String, String> hashes) throws Exception { Map<String, String> params = new HashMap<String, String>(); params.put("app_id", appId); params.put("hashes", createParameter(hashes)); String url = getApiUrl("application.jarHashes").toString(); params.put("action", "application.jarHashes"); // use the upload method (POST) to handle the potentially large "hashes" parameter payload String response = executeUpload(url, params, new HashMap<String, File>(), null); return (ApplicationJarHashesResponse) readResponse(response); }
public com.cloudbees.api.ApplicationInstanceInfo applicationInstanceTagsUpdate(String instanceId, Map<String, String> tags, boolean replace) throws Exception { Map<String, String> params = new HashMap<String, String>(); params.put("instance_id", instanceId); params.put("reset", Boolean.toString(replace)); params.put("parameters", createParameter(tags)); String url = getApiUrl("application.instance.update").toString(); params.put("action", "application.instance.update"); // use the upload method (POST) to handle the potentially large tags payload String response = executeUpload(url, params, new HashMap<String, File>(), null); com.cloudbees.api.ApplicationInstanceInfo apiResponse = (com.cloudbees.api.ApplicationInstanceInfo)readResponse(response); return apiResponse; }
public com.cloudbees.api.ApplicationInstanceInfo applicationInstanceTagsUpdate(String instanceId, Map<String, String> tags, boolean replace) throws Exception { Map<String, String> params = new HashMap<String, String>(); params.put("instance_id", instanceId); params.put("reset", Boolean.toString(replace)); params.put("parameters", createParameter(tags)); String url = getApiUrl("application.instance.update").toString(); params.put("action", "application.instance.update"); // use the upload method (POST) to handle the potentially large tags payload String response = executeUpload(url, params, new HashMap<String, File>(), null); com.cloudbees.api.ApplicationInstanceInfo apiResponse = (com.cloudbees.api.ApplicationInstanceInfo)readResponse(response); return apiResponse; }
public ConfigurationParametersUpdateResponse configurationParametersUpdate(String resourceId, String configType, File resourceFile) throws Exception { assertNotNull(resourceId,"resourceId"); assertNotNull(configType,"configType"); assertNotNull(resourceFile,"resourceFile"); Map<String, String> params = new HashMap<String, String>(); Map<String, File> fileParams = new HashMap<String, File>(); params.put("resource_id", resourceId); params.put("config_type", configType); fileParams.put("resources", resourceFile); String url = getApiUrl("configuration.parameters.update").toString(); params.put("action", "configuration.parameters.update"); // use the upload method (POST) to handle the potentially large resource list String response = executeUpload(url, params, fileParams, null); return (ConfigurationParametersUpdateResponse) readResponse(response); }
public ConfigurationParametersUpdateResponse configurationParametersUpdate(String resourceId, String configType, File resourceFile) throws Exception { assertNotNull(resourceId,"resourceId"); assertNotNull(configType,"configType"); assertNotNull(resourceFile,"resourceFile"); Map<String, String> params = new HashMap<String, String>(); Map<String, File> fileParams = new HashMap<String, File>(); params.put("resource_id", resourceId); params.put("config_type", configType); fileParams.put("resources", resourceFile); String url = getApiUrl("configuration.parameters.update").toString(); params.put("action", "configuration.parameters.update"); // use the upload method (POST) to handle the potentially large resource list String response = executeUpload(url, params, fileParams, null); return (ConfigurationParametersUpdateResponse) readResponse(response); }
protected Object apiCall(String apiMethod, Map<String, String> settings, Map<String, String> params) throws Exception { Map<String, File> fileParams = new HashMap<String, File>(); if (settings != null) { for (Map.Entry<String, String> entry : settings.entrySet()) { String value = entry.getValue().toLowerCase(); int idx = value.startsWith("file://") ? 7 : 0; if (idx == 0) idx = value.startsWith("files://") ? 8 : 0; if (idx > 0) { File file = new File(entry.getValue().substring(idx)); fileParams.put("FILE." + entry.getKey(), file); params.put("FILENAME." + entry.getKey(), file.getName()); } } } String response; // If files are to be uploaded use POST to upload if (fileParams.size() > 0) { String url = getApiUrl(apiMethod).toString(); params.put("action", apiMethod); response = executeUpload(url, params, fileParams, new UploadProgress() { public void handleBytesWritten(long l, long l1, long l2) {} }); } else { String url = getRequestURL(apiMethod, params); response = executeRequest(url); } return readResponse(response); }
protected Object apiCall(String apiMethod, Map<String, String> settings, Map<String, String> params) throws Exception { Map<String, File> fileParams = new HashMap<String, File>(); if (settings != null) { for (Map.Entry<String, String> entry : settings.entrySet()) { String value = entry.getValue().toLowerCase(); int idx = value.startsWith("file://") ? 7 : 0; if (idx == 0) idx = value.startsWith("files://") ? 8 : 0; if (idx > 0) { File file = new File(entry.getValue().substring(idx)); fileParams.put("FILE." + entry.getKey(), file); params.put("FILENAME." + entry.getKey(), file.getName()); } } } String response; // If files are to be uploaded use POST to upload if (fileParams.size() > 0) { String url = getApiUrl(apiMethod).toString(); params.put("action", apiMethod); response = executeUpload(url, params, fileParams, new UploadProgress() { public void handleBytesWritten(long l, long l1, long l2) {} }); } else { String url = getRequestURL(apiMethod, params); response = executeRequest(url); } return readResponse(response); }
params.put("expires", Long.toString(expireTime / 1000)); String url = getApiUrl("application.deployArchive").toString(); params.put("action", "application.deployArchive"); String response = executeUpload(url, params, fileParams, args.progress);
params.put("expires", Long.toString(expireTime / 1000)); String url = getApiUrl("application.deployArchive").toString(); params.put("action", "application.deployArchive"); String response = executeUpload(url, params, fileParams, args.progress);