|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cloudfoundry.client.lib.CloudFoundryClient
public class CloudFoundryClient
A Java client to exercise the Cloud Foundry API.
Constructor Summary | |
---|---|
CloudFoundryClient(CloudCredentials credentials,
URL cloudControllerUrl)
|
|
CloudFoundryClient(CloudCredentials credentials,
URL cloudControllerUrl,
CloudSpace sessionSpace)
|
|
CloudFoundryClient(CloudCredentials credentials,
URL cloudControllerUrl,
CloudSpace sessionSpace,
HttpProxyConfiguration httpProxyConfiguration)
|
|
CloudFoundryClient(CloudCredentials credentials,
URL cloudControllerUrl,
HttpProxyConfiguration httpProxyConfiguration)
|
|
CloudFoundryClient(CloudCredentials credentials,
URL cloudControllerUrl,
String orgName,
String spaceName)
|
|
CloudFoundryClient(CloudCredentials credentials,
URL cloudControllerUrl,
String orgName,
String spaceName,
HttpProxyConfiguration httpProxyConfiguration)
|
|
CloudFoundryClient(URL cloudControllerUrl)
Construct client for anonymous user. |
|
CloudFoundryClient(URL cloudControllerUrl,
HttpProxyConfiguration httpProxyConfiguration)
Constructors to use with an http proxy configuration. |
Method Summary | |
---|---|
void |
addDomain(String domainName)
Add domain to the current space of this session. |
void |
addRoute(String host,
String domainName)
Register a new route to the space of the current session. |
void |
bindService(String appName,
String serviceName)
Associate (provision) a service with an application. |
void |
createApplication(String appName,
Staging staging,
int memory,
List<String> uris,
List<String> serviceNames)
Create application. |
void |
createService(CloudService service)
Create a service. |
void |
debugApplication(String appName,
CloudApplication.DebugMode mode)
Debug application. |
void |
deleteAllApplications()
Delete all applications. |
void |
deleteAllServices()
Delete all services. |
void |
deleteApplication(String appName)
Delete application. |
void |
deleteDomain(String domainName)
Delete a domain registered to the current organization of this session. |
void |
deleteRoute(String host,
String domainName)
Delete a registered route from the space of the current session. |
void |
deleteService(String service)
Delete cloud service. |
CloudApplication |
getApplication(String appName)
Get cloud application with the specified name. |
CloudApplication |
getApplication(UUID appGuid)
|
InstancesInfo |
getApplicationInstances(CloudApplication app)
Get application instances info for application. |
InstancesInfo |
getApplicationInstances(String appName)
Get application instances info for application. |
int[] |
getApplicationMemoryChoices()
Get choices for application memory quota. |
List<CloudApplication> |
getApplications()
Get all cloud applications. |
ApplicationStats |
getApplicationStats(String appName)
Get application stats for the app with the specified name. |
URL |
getCloudControllerUrl()
Get the URL used for the cloud controller. |
CloudInfo |
getCloudInfo()
Get CloudInfo for the current cloud. |
CrashesInfo |
getCrashes(String appName)
Get crashes info for application. |
Map<String,String> |
getCrashLogs(String appName)
Get logs from most recent crash of the deployed application. |
List<CloudDomain> |
getDomains()
Get list of all domain registered for the given space. |
List<CloudDomain> |
getDomainsForOrg()
Get list of all domain registered for the current organization of this session. |
String |
getFile(String appName,
int instanceIndex,
String filePath)
Get file from the deployed application. |
String |
getFile(String appName,
int instanceIndex,
String filePath,
int startPosition)
Get a the content, starting at a specific position, of a file from the deployed application. |
String |
getFile(String appName,
int instanceIndex,
String filePath,
int startPosition,
int endPosition)
Get a range of content of a file from the deployed application. |
String |
getFileTail(String appName,
int instanceIndex,
String filePath,
int length)
Get a the last bytes, with length as specified, of content of a file from the deployed application. |
Map<String,String> |
getLogs(String appName)
Get logs from the deployed application. |
List<CloudOrganization> |
getOrganizations()
Get list of CloudOrganizations for the current cloud. |
List<CloudRoute> |
getRoutes(String domainName)
Get the info for all routes for a domain belonging to the current space of this session. |
CloudService |
getService(String service)
Get cloud service. |
List<CloudServiceOffering> |
getServiceOfferings()
Get all service offerings. |
List<CloudService> |
getServices()
Get list of cloud services. |
List<CloudSpace> |
getSpaces()
Get list of CloudSpaces for the current cloud. |
String |
getStagingLogs(StartingInfo info,
int offset)
Get the staging log while an application is starting. |
org.springframework.security.oauth2.common.OAuth2AccessToken |
login()
Login using the credentials already set for the client. |
void |
logout()
Logout closing the current session. |
void |
register(String email,
String password)
Register new user account with the provided credentials. |
void |
registerRestLogListener(RestLogCallback callBack)
Register a new RestLogCallback |
void |
removeDomain(String domainName)
Remove a domain from the space of the current session. |
void |
rename(String appName,
String newName)
Rename an application. |
StartingInfo |
restartApplication(String appName)
Restart application. |
void |
setResponseErrorHandler(org.springframework.web.client.ResponseErrorHandler errorHandler)
Override the default REST response error handler with a custom error handler. |
StartingInfo |
startApplication(String appName)
Start application. |
void |
stopApplication(String appName)
Stop application. |
void |
unbindService(String appName,
String serviceName)
Un-associate (unprovision) a service from an application. |
void |
unregister()
Unregister and log out the currently logged in user |
void |
unRegisterRestLogListener(RestLogCallback callBack)
Un-register a RestLogCallback |
void |
updateApplicationEnv(String appName,
List<String> env)
Update application env using a list of strings each with one environment setting. |
void |
updateApplicationEnv(String appName,
Map<String,String> env)
Update application env using a map where the key specifies the name of the environment variable and the value the value of the environment variable.. |
void |
updateApplicationInstances(String appName,
int instances)
Update application instances. |
void |
updateApplicationMemory(String appName,
int memory)
Update application memory. |
void |
updateApplicationServices(String appName,
List<String> services)
Update application services. |
void |
updateApplicationStaging(String appName,
Staging staging)
Update application staging information. |
void |
updateApplicationUris(String appName,
List<String> uris)
Update application URIs. |
void |
updateHttpProxyConfiguration(HttpProxyConfiguration httpProxyConfiguration)
Update http proxy configuration settings. |
void |
updatePassword(CloudCredentials credentials,
String newPassword)
Update the password for the logged in user using the username/old_password provided in the credentials. |
void |
updatePassword(String newPassword)
Update the password for the logged in user. |
void |
uploadApplication(String appName,
ApplicationArchive archive)
Upload an application to cloud foundry. |
void |
uploadApplication(String appName,
ApplicationArchive archive,
UploadStatusCallback callback)
Upload an application to cloud foundry. |
void |
uploadApplication(String appName,
File file)
Upload an application to cloud foundry. |
void |
uploadApplication(String appName,
File file,
UploadStatusCallback callback)
Upload an application to cloud foundry. |
void |
uploadApplication(String appName,
String file)
Upload an application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CloudFoundryClient(URL cloudControllerUrl)
public CloudFoundryClient(CloudCredentials credentials, URL cloudControllerUrl)
public CloudFoundryClient(CloudCredentials credentials, URL cloudControllerUrl, CloudSpace sessionSpace)
public CloudFoundryClient(CloudCredentials credentials, URL cloudControllerUrl, String orgName, String spaceName)
public CloudFoundryClient(URL cloudControllerUrl, HttpProxyConfiguration httpProxyConfiguration)
public CloudFoundryClient(CloudCredentials credentials, URL cloudControllerUrl, HttpProxyConfiguration httpProxyConfiguration)
public CloudFoundryClient(CloudCredentials credentials, URL cloudControllerUrl, CloudSpace sessionSpace, HttpProxyConfiguration httpProxyConfiguration)
public CloudFoundryClient(CloudCredentials credentials, URL cloudControllerUrl, String orgName, String spaceName, HttpProxyConfiguration httpProxyConfiguration)
Method Detail |
---|
public void setResponseErrorHandler(org.springframework.web.client.ResponseErrorHandler errorHandler)
CloudFoundryOperations
setResponseErrorHandler
in interface CloudFoundryOperations
public URL getCloudControllerUrl()
CloudFoundryOperations
getCloudControllerUrl
in interface CloudFoundryOperations
public CloudInfo getCloudInfo()
CloudFoundryOperations
getCloudInfo
in interface CloudFoundryOperations
public List<CloudSpace> getSpaces()
CloudFoundryOperations
getSpaces
in interface CloudFoundryOperations
public List<CloudOrganization> getOrganizations()
CloudFoundryOperations
getOrganizations
in interface CloudFoundryOperations
public void register(String email, String password)
CloudFoundryOperations
register
in interface CloudFoundryOperations
email
- the email accountpassword
- the passwordpublic void updatePassword(String newPassword)
CloudFoundryOperations
updatePassword
in interface CloudFoundryOperations
newPassword
- the new passwordpublic void updatePassword(CloudCredentials credentials, String newPassword)
CloudFoundryOperations
updatePassword
in interface CloudFoundryOperations
credentials
- current credentialsnewPassword
- the new passwordpublic void unregister()
CloudFoundryOperations
unregister
in interface CloudFoundryOperations
public org.springframework.security.oauth2.common.OAuth2AccessToken login()
CloudFoundryOperations
login
in interface CloudFoundryOperations
public void logout()
CloudFoundryOperations
logout
in interface CloudFoundryOperations
public List<CloudApplication> getApplications()
CloudFoundryOperations
getApplications
in interface CloudFoundryOperations
public CloudApplication getApplication(String appName)
CloudFoundryOperations
getApplication
in interface CloudFoundryOperations
appName
- name of the app
public CloudApplication getApplication(UUID appGuid)
public ApplicationStats getApplicationStats(String appName)
CloudFoundryOperations
getApplicationStats
in interface CloudFoundryOperations
appName
- name of the app
public int[] getApplicationMemoryChoices()
CloudFoundryOperations
getApplicationMemoryChoices
in interface CloudFoundryOperations
public void createApplication(String appName, Staging staging, int memory, List<String> uris, List<String> serviceNames)
CloudFoundryOperations
createApplication
in interface CloudFoundryOperations
appName
- application namestaging
- staging infomemory
- memory to use in MBuris
- list of URIs for the appserviceNames
- list of service names to bind to apppublic void createService(CloudService service)
CloudFoundryOperations
createService
in interface CloudFoundryOperations
service
- cloud service infopublic void uploadApplication(String appName, String file) throws IOException
CloudFoundryOperations
uploadApplication
in interface CloudFoundryOperations
appName
- application namefile
- path to the application archive or folder
IOException
public void uploadApplication(String appName, File file) throws IOException
CloudFoundryOperations
uploadApplication
in interface CloudFoundryOperations
appName
- the application namefile
- the application archive or folder
IOException
public void uploadApplication(String appName, File file, UploadStatusCallback callback) throws IOException
CloudFoundryOperations
uploadApplication
in interface CloudFoundryOperations
appName
- the application namefile
- the application archivecallback
- a callback interface used to provide progress information or null
IOException
public void uploadApplication(String appName, ApplicationArchive archive) throws IOException
CloudFoundryOperations
uploadApplication
in interface CloudFoundryOperations
appName
- the application namearchive
- the application archive
IOException
public void uploadApplication(String appName, ApplicationArchive archive, UploadStatusCallback callback) throws IOException
CloudFoundryOperations
uploadApplication
in interface CloudFoundryOperations
appName
- the application namearchive
- the application archivecallback
- a callback interface used to provide progress information or null
IOException
public StartingInfo startApplication(String appName)
CloudFoundryOperations
startApplication
in interface CloudFoundryOperations
appName
- name of application
public void debugApplication(String appName, CloudApplication.DebugMode mode)
CloudFoundryOperations
debugApplication
in interface CloudFoundryOperations
appName
- name of applicationmode
- debug mode infopublic void stopApplication(String appName)
CloudFoundryOperations
stopApplication
in interface CloudFoundryOperations
appName
- name of applicationpublic StartingInfo restartApplication(String appName)
CloudFoundryOperations
restartApplication
in interface CloudFoundryOperations
appName
- name of applicationpublic void deleteApplication(String appName)
CloudFoundryOperations
deleteApplication
in interface CloudFoundryOperations
appName
- name of applicationpublic void deleteAllApplications()
CloudFoundryOperations
deleteAllApplications
in interface CloudFoundryOperations
public void deleteAllServices()
CloudFoundryOperations
deleteAllServices
in interface CloudFoundryOperations
public void updateApplicationMemory(String appName, int memory)
CloudFoundryOperations
updateApplicationMemory
in interface CloudFoundryOperations
appName
- name of applicationmemory
- new memory settingpublic void updateApplicationInstances(String appName, int instances)
CloudFoundryOperations
updateApplicationInstances
in interface CloudFoundryOperations
appName
- name of applicationinstances
- number of instances to usepublic void updateApplicationServices(String appName, List<String> services)
CloudFoundryOperations
updateApplicationServices
in interface CloudFoundryOperations
appName
- name of appplicationservices
- list of services that should be bound to apppublic void updateApplicationStaging(String appName, Staging staging)
CloudFoundryOperations
updateApplicationStaging
in interface CloudFoundryOperations
appName
- name of appplicationstaging
- staging information for the apppublic void updateApplicationUris(String appName, List<String> uris)
CloudFoundryOperations
updateApplicationUris
in interface CloudFoundryOperations
appName
- name of applicationuris
- list of URIs the app should usepublic void updateApplicationEnv(String appName, Map<String,String> env)
CloudFoundryOperations
updateApplicationEnv
in interface CloudFoundryOperations
appName
- name of applicationenv
- map of environment settingspublic void updateApplicationEnv(String appName, List<String> env)
CloudFoundryOperations
updateApplicationEnv
in interface CloudFoundryOperations
appName
- name of applicationenv
- list of environment settingspublic Map<String,String> getLogs(String appName)
CloudFoundryOperations
getLogs
in interface CloudFoundryOperations
appName
- name of the application
public Map<String,String> getCrashLogs(String appName)
CloudFoundryOperations
getCrashLogs
in interface CloudFoundryOperations
appName
- name of the application
public String getStagingLogs(StartingInfo info, int offset)
CloudFoundryOperations
getStagingLogs
in interface CloudFoundryOperations
info
- starting information containing staging log file URL. Obtained
after starting an application.offset
- starting position from where content should be retrieved.
public String getFile(String appName, int instanceIndex, String filePath)
CloudFoundryOperations
getFile
in interface CloudFoundryOperations
appName
- name of the applicationinstanceIndex
- instance indexfilePath
- path to the file
public String getFile(String appName, int instanceIndex, String filePath, int startPosition)
CloudFoundryOperations
getFile
in interface CloudFoundryOperations
appName
- name of the applicationinstanceIndex
- instance indexfilePath
- path to the filestartPosition
- the starting position of the file contents (inclusive)
public String getFile(String appName, int instanceIndex, String filePath, int startPosition, int endPosition)
CloudFoundryOperations
getFile
in interface CloudFoundryOperations
appName
- name of the applicationinstanceIndex
- instance indexfilePath
- path to the filestartPosition
- the starting position of the file contents (inclusive)endPosition
- the ending position of the file contents (exclusive)
public String getFileTail(String appName, int instanceIndex, String filePath, int length)
CloudFoundryOperations
getFileTail
in interface CloudFoundryOperations
appName
- name of the applicationinstanceIndex
- instance indexfilePath
- path to the filelength
- the length of the file contents to retrieve
public List<CloudService> getServices()
CloudFoundryOperations
getServices
in interface CloudFoundryOperations
public CloudService getService(String service)
CloudFoundryOperations
getService
in interface CloudFoundryOperations
service
- name of service
public void deleteService(String service)
CloudFoundryOperations
deleteService
in interface CloudFoundryOperations
service
- name of servicepublic List<CloudServiceOffering> getServiceOfferings()
CloudFoundryOperations
getServiceOfferings
in interface CloudFoundryOperations
public void bindService(String appName, String serviceName)
CloudFoundryOperations
bindService
in interface CloudFoundryOperations
appName
- the application nameserviceName
- the service namepublic void unbindService(String appName, String serviceName)
CloudFoundryOperations
unbindService
in interface CloudFoundryOperations
appName
- the application nameserviceName
- the service namepublic InstancesInfo getApplicationInstances(String appName)
CloudFoundryOperations
getApplicationInstances
in interface CloudFoundryOperations
appName
- name of application.
public InstancesInfo getApplicationInstances(CloudApplication app)
CloudFoundryOperations
getApplicationInstances
in interface CloudFoundryOperations
app
- the application.
public CrashesInfo getCrashes(String appName)
CloudFoundryOperations
getCrashes
in interface CloudFoundryOperations
appName
- name of application
public void rename(String appName, String newName)
CloudFoundryOperations
rename
in interface CloudFoundryOperations
appName
- the current namenewName
- the new namepublic List<CloudDomain> getDomainsForOrg()
CloudFoundryOperations
getDomainsForOrg
in interface CloudFoundryOperations
public List<CloudDomain> getDomains()
CloudFoundryOperations
getDomains
in interface CloudFoundryOperations
public void addDomain(String domainName)
CloudFoundryOperations
addDomain
in interface CloudFoundryOperations
domainName
- the domain to addpublic void deleteDomain(String domainName)
CloudFoundryOperations
deleteDomain
in interface CloudFoundryOperations
domainName
- the domain to deletepublic void removeDomain(String domainName)
CloudFoundryOperations
removeDomain
in interface CloudFoundryOperations
domainName
- the domain to deletepublic List<CloudRoute> getRoutes(String domainName)
CloudFoundryOperations
getRoutes
in interface CloudFoundryOperations
domainName
- the domain the routes belong to
public void addRoute(String host, String domainName)
CloudFoundryOperations
addRoute
in interface CloudFoundryOperations
host
- the host of the route to registerdomainName
- the domain of the route to registerpublic void deleteRoute(String host, String domainName)
CloudFoundryOperations
deleteRoute
in interface CloudFoundryOperations
host
- the host of the route to deletedomainName
- the domain of the route to deletepublic void updateHttpProxyConfiguration(HttpProxyConfiguration httpProxyConfiguration)
CloudFoundryOperations
updateHttpProxyConfiguration
in interface CloudFoundryOperations
httpProxyConfiguration
- the new configuration settingspublic void registerRestLogListener(RestLogCallback callBack)
CloudFoundryOperations
registerRestLogListener
in interface CloudFoundryOperations
callBack
- the callback to be registeredpublic void unRegisterRestLogListener(RestLogCallback callBack)
CloudFoundryOperations
unRegisterRestLogListener
in interface CloudFoundryOperations
callBack
- the callback to be un-registered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |