com.cloudbees.api
Class BeesClient

java.lang.Object
  extended by com.cloudbees.api.BeesClientBase
      extended by com.cloudbees.api.BeesClient

public class BeesClient
extends BeesClientBase

Author:
Fabian Donze

Nested Class Summary
static class BeesClient.UsageError
           
 
Field Summary
 
Fields inherited from class com.cloudbees.api.BeesClientBase
format
 
Constructor Summary
BeesClient(BeesClientConfiguration beesClientConfiguration)
           
BeesClient(String server, String apikey, String secret, String format, String version)
           
 
Method Summary
 AccountKeysResponse accountKeys(String domain, String user, String password)
           
 AccountListResponse accountList()
           
 ApplicationCheckSumsResponse applicationCheckSums(String appId)
           
 ApplicationCheckSumsResponse applicationCheckSums(String appId, boolean traceResponse)
           
 ApplicationDeleteResponse applicationDelete(String appId)
           
 ApplicationDeployArchiveResponse applicationDeployArchive(String appId, String environment, String description, String earFile, String srcFile, String archiveType, boolean deltaDeploy, Map<String,String> parameters, UploadProgress progress)
           
 ApplicationDeployArchiveResponse applicationDeployArchive(String appId, String environment, String description, String earFile, String srcFile, String archiveType, boolean deltaDeploy, UploadProgress progress)
           
 ApplicationDeployArchiveResponse applicationDeployArchive(String appId, String environment, String description, String earFile, String srcFile, String archiveType, UploadProgress progress)
           
 ApplicationDeployArchiveResponse applicationDeployEar(String appId, String environment, String description, String earFile, String srcFile, UploadProgress progress)
           
 ApplicationDeployArchiveResponse applicationDeployWar(String appId, String environment, String description, String warFile, String srcFile, boolean deltaDeploy, UploadProgress progress)
           
 ApplicationDeployArchiveResponse applicationDeployWar(String appId, String environment, String description, String warFile, String srcFile, UploadProgress progress)
           
 ApplicationGetSourceUrlResponse applicationGetSourceUrl(String appId)
           
 ApplicationInfo applicationInfo(String appId)
           
 ApplicationJarHashesResponse applicationJarCrcs(String appId, Map<String,String> hashes)
          Deprecated.  
 ApplicationJarHashesResponse applicationJarHashes(String appId, Map<String,String> hashes)
           
 ApplicationListResponse applicationList()
          Returns all the applications in all the account sthat you belong to.
 ApplicationListResponse applicationList(String account)
          Returns all the applications in the specified account.
 ApplicationRestartResponse applicationRestart(String appId)
           
 ApplicationScaleResponse applicationScale(String appId, int unit)
           
 ApplicationSetMetaResponse applicationSetMeta(String appId, Map<String,String> metaAttrs)
           
 ApplicationStatusResponse applicationStart(String appId)
           
 ApplicationStatusResponse applicationStop(String appId)
           
 String call(String action, Map<String,String> params)
           
protected  String createParameter(Map<String,String> parameters)
           
 DatabaseCreateResponse databaseCreate(String domain, String dbId, String username, String password)
           
 DatabaseDeleteResponse databaseDelete(String dbId)
           
 DatabaseInfo databaseInfo(String dbId, boolean fetchPassword)
           
 DatabaseListResponse databaseList()
          Returns all the databases in all the account sthat you belong to.
 DatabaseListResponse databaseList(String account)
          Returns all the databases in the specified account.
 DatabaseSetPasswordResponse databaseSetPassword(String dbId, String password)
           
static String encodePassword(String password, String version)
           
protected static ApplicationConfiguration getAppConfig(File deployZip, String[] environments, String[] implicitEnvironments)
           
 ApplicationConfiguration getApplicationConfiguration(String warFilePath, String account, String[] environments)
           
protected  com.thoughtworks.xstream.XStream getXStream()
           
 void main(String[] args)
           
 void mainCall(String[] args)
           
protected  Object readResponse(String response)
           
 SayHelloResponse sayHello(String message)
           
 void tailLog(String appId, String logName, OutputStream out)
           
 
Methods inherited from class com.cloudbees.api.BeesClientBase
executeCometRequest, executeRequest, executeUpload, getApiUrl, getBeesClientConfiguration, getRequestURL, getRequestURL, getResponseString, getSignature, isVerbose, md5, processError, setVerbose, trace, traceResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeesClient

public BeesClient(BeesClientConfiguration beesClientConfiguration)

BeesClient

public BeesClient(String server,
                  String apikey,
                  String secret,
                  String format,
                  String version)
Method Detail

sayHello

public SayHelloResponse sayHello(String message)
                          throws Exception
Throws:
Exception

applicationGetSourceUrl

public ApplicationGetSourceUrlResponse applicationGetSourceUrl(String appId)
                                                        throws Exception
Throws:
Exception

applicationDelete

public ApplicationDeleteResponse applicationDelete(String appId)
                                            throws Exception
Throws:
Exception

applicationRestart

public ApplicationRestartResponse applicationRestart(String appId)
                                              throws Exception
Throws:
Exception

applicationStart

public ApplicationStatusResponse applicationStart(String appId)
                                           throws Exception
Throws:
Exception

applicationStop

public ApplicationStatusResponse applicationStop(String appId)
                                          throws Exception
Throws:
Exception

applicationList

public ApplicationListResponse applicationList()
                                        throws Exception
Returns all the applications in all the account sthat you belong to. Short-hand for applicationList(null).

Throws:
Exception

applicationList

public ApplicationListResponse applicationList(String account)
                                        throws Exception
Returns all the applications in the specified account.

Parameters:
account - if null, returns all the applications from all the accounts that you belong to.
Throws:
Exception
Since:
1.1.3

applicationInfo

public ApplicationInfo applicationInfo(String appId)
                                throws Exception
Throws:
Exception

applicationSetMeta

public ApplicationSetMetaResponse applicationSetMeta(String appId,
                                                     Map<String,String> metaAttrs)
                                              throws Exception
Throws:
Exception

applicationJarCrcs

public ApplicationJarHashesResponse applicationJarCrcs(String appId,
                                                       Map<String,String> hashes)
                                                throws Exception
Deprecated. 

Throws:
Exception

applicationJarHashes

public ApplicationJarHashesResponse applicationJarHashes(String appId,
                                                         Map<String,String> hashes)
                                                  throws Exception
Throws:
Exception

applicationDeployEar

public ApplicationDeployArchiveResponse applicationDeployEar(String appId,
                                                             String environment,
                                                             String description,
                                                             String earFile,
                                                             String srcFile,
                                                             UploadProgress progress)
                                                      throws Exception
Throws:
Exception

applicationDeployWar

public ApplicationDeployArchiveResponse applicationDeployWar(String appId,
                                                             String environment,
                                                             String description,
                                                             String warFile,
                                                             String srcFile,
                                                             UploadProgress progress)
                                                      throws Exception
Throws:
Exception

applicationDeployWar

public ApplicationDeployArchiveResponse applicationDeployWar(String appId,
                                                             String environment,
                                                             String description,
                                                             String warFile,
                                                             String srcFile,
                                                             boolean deltaDeploy,
                                                             UploadProgress progress)
                                                      throws Exception
Throws:
Exception

applicationDeployArchive

public ApplicationDeployArchiveResponse applicationDeployArchive(String appId,
                                                                 String environment,
                                                                 String description,
                                                                 String earFile,
                                                                 String srcFile,
                                                                 String archiveType,
                                                                 UploadProgress progress)
                                                          throws Exception
Throws:
Exception

applicationDeployArchive

public ApplicationDeployArchiveResponse applicationDeployArchive(String appId,
                                                                 String environment,
                                                                 String description,
                                                                 String earFile,
                                                                 String srcFile,
                                                                 String archiveType,
                                                                 boolean deltaDeploy,
                                                                 UploadProgress progress)
                                                          throws Exception
Throws:
Exception

applicationDeployArchive

public ApplicationDeployArchiveResponse applicationDeployArchive(String appId,
                                                                 String environment,
                                                                 String description,
                                                                 String earFile,
                                                                 String srcFile,
                                                                 String archiveType,
                                                                 boolean deltaDeploy,
                                                                 Map<String,String> parameters,
                                                                 UploadProgress progress)
                                                          throws Exception
Throws:
Exception

applicationCheckSums

public ApplicationCheckSumsResponse applicationCheckSums(String appId)
                                                  throws Exception
Throws:
Exception

applicationCheckSums

public ApplicationCheckSumsResponse applicationCheckSums(String appId,
                                                         boolean traceResponse)
                                                  throws Exception
Throws:
Exception

applicationScale

public ApplicationScaleResponse applicationScale(String appId,
                                                 int unit)
                                          throws Exception
Throws:
Exception

databaseCreate

public DatabaseCreateResponse databaseCreate(String domain,
                                             String dbId,
                                             String username,
                                             String password)
                                      throws Exception
Throws:
Exception

databaseDelete

public DatabaseDeleteResponse databaseDelete(String dbId)
                                      throws Exception
Throws:
Exception

databaseInfo

public DatabaseInfo databaseInfo(String dbId,
                                 boolean fetchPassword)
                          throws Exception
Throws:
Exception

databaseList

public DatabaseListResponse databaseList()
                                  throws Exception
Returns all the databases in all the account sthat you belong to. Short-hand for databaseList(null).

Throws:
Exception

databaseList

public DatabaseListResponse databaseList(String account)
                                  throws Exception
Returns all the databases in the specified account.

Parameters:
account - if null, returns all the databases from all the accounts that you belong to.
Throws:
Exception
Since:
1.1.3

databaseSetPassword

public DatabaseSetPasswordResponse databaseSetPassword(String dbId,
                                                       String password)
                                                throws Exception
Throws:
Exception

accountKeys

public AccountKeysResponse accountKeys(String domain,
                                       String user,
                                       String password)
                                throws Exception
Throws:
Exception

accountList

public AccountListResponse accountList()
                                throws Exception
Throws:
Exception

getApplicationConfiguration

public ApplicationConfiguration getApplicationConfiguration(String warFilePath,
                                                            String account,
                                                            String[] environments)
                                                     throws Exception
Throws:
Exception

getAppConfig

protected static ApplicationConfiguration getAppConfig(File deployZip,
                                                       String[] environments,
                                                       String[] implicitEnvironments)
                                                throws IOException
Throws:
IOException

createParameter

protected String createParameter(Map<String,String> parameters)

tailLog

public void tailLog(String appId,
                    String logName,
                    OutputStream out)
             throws Exception
Throws:
Exception

call

public String call(String action,
                   Map<String,String> params)
            throws Exception
Throws:
Exception

getXStream

protected com.thoughtworks.xstream.XStream getXStream()
                                               throws Exception
Throws:
Exception

readResponse

protected Object readResponse(String response)
                       throws Exception
Throws:
Exception

encodePassword

public static String encodePassword(String password,
                                    String version)

mainCall

public void mainCall(String[] args)
              throws Exception
Throws:
Exception

main

public void main(String[] args)
          throws Exception
Throws:
Exception


Copyright © 2011-2012. All Rights Reserved.