/** * Creates an account and add this user to it. */ public CBUser createAccount(String name) throws IOException { CBAccount acc = new CBAccount(); acc.name = name; return root.jsonPOJORequest("v2/users/" + id + "/accounts", acc, CBUser.class, "POST"); }
/** * Creates a new {@link BeesClient} that uses the access token encapsulated in this {@link OauthToken} */ public BeesClient createClient() { BeesClientConfiguration config = new BeesClientConfiguration(); config.setOAuthToken(accessToken); return new BeesClient(config); }
/** * @since 1.1.4 */ public ApplicationDeployArchiveResponse applicationDeployArchive( String appId, String environment, String description, File earFile, File srcFile, String archiveType, boolean deltaDeploy, Map<String, String> parameters, UploadProgress progress) throws Exception { return applicationDeployArchive(new ApplicationDeployArgs.Builder(appId) .environment(environment).description(description) .deployPackage(earFile, archiveType).srcFile(srcFile) .incrementalDeployment(deltaDeploy).withParams(parameters) .withProgressFeedback(progress).build()); }
/** * Creates a new {@link BeesClient} that uses the access token encapsulated in this {@link OauthToken}. * * @param current * The configuration parameter to inherit from. This method does not mutate this object. */ public BeesClient createClient(BeesClientConfiguration current) { // TODO: there should be a copy constructor BeesClientConfiguration config = new BeesClientConfiguration(current.getServerApiUrl()); config.setOAuthToken(accessToken); return new BeesClient(config); }
@Override public String executeRequest(String url) throws Exception { trace("API call: " + url); String response = super.executeRequest(url); traceResponse(response); return response; }
protected void processError(String response, int code) throws BeesClientException { ErrorResponse er = new ErrorResponse(); er.errorCode = "" + code; if (isVerbose()) { er.message = response; } else { er.message = HttpStatus.getStatusText(code); } throw new BeesClientException(er); }
public BeesClient(String server, String apikey, String secret, String format, String version) { // TODO: this encodePassword is considered harmful as it creates assymetry between two constructors super(server, apikey, encodePassword(secret, version), format, version); init(); }
public static TokenValidator from(BeesClient bees) { return from(bees.getOauthClient()); }
public static TokenGenerator from(BeesClient bees) { return from(bees.getOauthClient()); }
/** * @since 1.1.4 */ public ApplicationDeployArchiveResponse applicationDeployArchive( String appId, String environment, String description, File earFile, File srcFile, String archiveType, boolean deltaDeploy, UploadProgress progress) throws Exception { return applicationDeployArchive(appId, environment, description, earFile, srcFile, archiveType, deltaDeploy, null, progress); }
@Override public CachedToken load(String token) throws Exception { return new CachedToken(base.validateToken(token)); } });
/** * @since 1.1.4 */ public Builder warFile(File file) { return deployPackage(file, "war"); }
/** * Creates an user, including a partial user creation. * * @see <a href="https://sites.google.com/a/cloudbees * .com/account-provisioning-api/home/user-api#TOC-Create-a-User">API spec</a> */ public CBUser createUser(CBUser user) throws IOException { return jsonPOJORequest("v2/users", user, CBUser.class, "POST"); }
public ServerPoolInfo serverPoolInfo(String poolId) throws Exception { return serverPoolInfo(poolId, false); } public ServerPoolInfo serverPoolInfo(String poolId, boolean withApplications) throws Exception
/** * @since 1.1.4 */ public ApplicationDeployArchiveResponse applicationDeployArchive( String appId, String environment, String description, File earFile, File srcFile, String archiveType, boolean deltaDeploy, Map<String, String> parameters, UploadProgress progress) throws Exception { return applicationDeployArchive(new ApplicationDeployArgs.Builder(appId) .environment(environment).description(description) .deployPackage(earFile, archiveType).srcFile(srcFile) .incrementalDeployment(deltaDeploy).withParams(parameters) .withProgressFeedback(progress).build()); }
/** * Creates a new {@link BeesClient} that uses the access token encapsulated in this {@link OauthToken}. * * @param current * The configuration parameter to inherit from. This method does not mutate this object. */ public BeesClient createClient(BeesClientConfiguration current) { // TODO: there should be a copy constructor BeesClientConfiguration config = new BeesClientConfiguration(current.getServerApiUrl()); config.setOAuthToken(accessToken); return new BeesClient(config); }
/** * Creates a new {@link BeesClient} that uses the access token encapsulated in this {@link OauthToken} */ public BeesClient createClient() { BeesClientConfiguration config = new BeesClientConfiguration(); config.setOAuthToken(accessToken); return new BeesClient(config); }
@Override public String executeRequest(String url) throws Exception { trace("API call: " + url); String response = super.executeRequest(url); traceResponse(response); return response; }
/** * Creates an account and add this user to it. */ public CBUser createAccount(String name) throws IOException { CBAccount acc = new CBAccount(); acc.name = name; return root.jsonPOJORequest("v2/users/" + id + "/accounts", acc, CBUser.class, "POST"); }