Class CloudControllerClientImpl
- java.lang.Object
-
- com.sap.cloudfoundry.client.facade.CloudControllerClientImpl
-
- All Implemented Interfaces:
CloudControllerClient
public class CloudControllerClientImpl extends Object implements CloudControllerClient
A Java client to exercise the Cloud Foundry API.
-
-
Constructor Summary
Constructors Constructor Description CloudControllerClientImpl(CloudControllerRestClient delegate)Construct a client with a pre-configured CloudControllerClientCloudControllerClientImpl(URL controllerUrl, CloudCredentials credentials)Construct client without a default organization and space.CloudControllerClientImpl(URL controllerUrl, CloudCredentials credentials, boolean trustSelfSignedCerts)CloudControllerClientImpl(URL controllerUrl, CloudCredentials credentials, CloudSpace target, boolean trustSelfSignedCerts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDomain(String domainName)Add a private domain in the current organization.voidaddRoute(String host, String domainName, String path)Register a new route to the a domain.CloudPackageasyncUploadApplication(String applicationName, Path file)CloudPackageasyncUploadApplication(String applicationName, Path file, UploadStatusCallback callback)voidbindDropletToApp(UUID dropletGuid, UUID applicationGuid)voidbindServiceInstance(String applicationName, String serviceInstanceName)Associate (provision) a service with an application.voidbindServiceInstance(String applicationName, String serviceInstanceName, Map<String,Object> parameters, ApplicationServicesUpdateCallback updateServicesCallback)Associate (provision) a service with an application.CloudTaskcancelTask(UUID taskGuid)Cancel the given task.voidcreateApplication(String applicationName, Staging staging, Integer disk, Integer memory, List<String> uris, DockerInfo dockerInfo)Create application.voidcreateApplication(String applicationName, Staging staging, Integer memory, List<String> uris)Create application.CloudBuildcreateBuild(UUID packageGuid)voidcreateServiceBroker(CloudServiceBroker serviceBroker)Create a service broker.voidcreateServiceInstance(CloudServiceInstance serviceInstance)Create a service instance.CloudServiceKeycreateServiceKey(String serviceInstanceName, String serviceKeyName, Map<String,Object> parameters)Create a service key.voidcreateUserProvidedServiceInstance(CloudServiceInstance serviceInstance, Map<String,Object> credentials)Create a user-provided service instance.voidcreateUserProvidedServiceInstance(CloudServiceInstance serviceInstance, Map<String,Object> credentials, String syslogDrainUrl)Create a user-provided service instance for logging.voiddeleteAllApplications()Delete all applications.voiddeleteAllServiceInstances()Delete all service instances.voiddeleteApplication(String applicationName)Delete application.voiddeleteDomain(String domainName)Delete a private domain in the current organization.List<CloudRoute>deleteOrphanedRoutes()Delete routes that do not have any application which is assigned to them.voiddeleteRoute(String host, String domainName, String path)Delete a registered route from the space of the current session.voiddeleteServiceBroker(String name)Delete a service broker.voiddeleteServiceInstance(CloudServiceInstance serviceInstance)voiddeleteServiceInstance(String serviceInstanceName)Delete cloud service instance.voiddeleteServiceKey(CloudServiceKey serviceKey)Delete a service key.voiddeleteServiceKey(String serviceInstanceName, String serviceKeyName)Delete a service key.CloudApplicationgetApplication(String applicationName)Get cloud application with the specified name.CloudApplicationgetApplication(String applicationName, boolean required)Get cloud application with the specified name.CloudApplicationgetApplication(UUID applicationGuid)Get cloud application with the specified GUID.Map<String,String>getApplicationEnvironment(String applicationName)Get application environment variables for the app with the specified name.Map<String,String>getApplicationEnvironment(UUID applicationGuid)Get application environment variables for the app with the specified GUID.List<CloudEvent>getApplicationEvents(String applicationName)Get application events.InstancesInfogetApplicationInstances(CloudApplication app)Get application instances info for application.InstancesInfogetApplicationInstances(String applicationName)Get application instances info for application.List<CloudApplication>getApplications()Get all applications in the currently targeted space.List<CloudApplication>getApplicationsByMetadataLabelSelector(String labelSelector)CloudBuildgetBuild(UUID buildGuid)List<CloudBuild>getBuildsForApplication(UUID applicationGuid)List<CloudBuild>getBuildsForPackage(UUID packageGuid)URLgetCloudControllerUrl()Get the URL used for the cloud controller.CloudInfogetCloudInfo()Get CloudInfo for the current cloud.DropletInfogetCurrentDropletForApplication(UUID applicationGuid)CloudDomaingetDefaultDomain()Gets the default domain for the current org, which is the first shared domain.List<CloudDomain>getDomains()Get list of all domain shared and private domains.List<CloudDomain>getDomainsForOrganization()Get list of all domain registered for the current organization.List<CloudEvent>getEvents()Get system events.List<CloudEvent>getEventsByActee(UUID uuid)CloudOrganizationgetOrganization(String organizationName)Get the organization with the specified name.CloudOrganizationgetOrganization(String organizationName, boolean required)Get the organization with the specified name.List<CloudOrganization>getOrganizations()Get all organizations for the current cloud.CloudPackagegetPackage(UUID packageGuid)List<CloudPackage>getPackagesForApplication(UUID applicationGuid)List<CloudDomain>getPrivateDomains()Get list of all private domains.List<ApplicationLog>getRecentLogs(String applicationName)Stream recent log entries.List<ApplicationLog>getRecentLogs(UUID applicationGuid)Get recent log entries.List<CloudRoute>getRoutes(String domainName)Get the info for all routes for a domain.Map<String,Object>getServiceBindingParameters(UUID guid)Get all service binding parameters.List<CloudServiceBinding>getServiceBindings(UUID serviceInstanceGuid)Get the bindings for a particular service instance.CloudServiceBrokergetServiceBroker(String name)Get a service broker.CloudServiceBrokergetServiceBroker(String name, boolean required)Get a service broker.List<CloudServiceBroker>getServiceBrokers()Get all service brokers.CloudServiceInstancegetServiceInstance(String serviceInstanceName)Get a service instance.CloudServiceInstancegetServiceInstance(String serviceInstanceName, boolean required)Get a service instance.Map<String,Object>getServiceInstanceParameters(UUID guid)Get all service instance parameters.List<CloudServiceInstance>getServiceInstances()Get all service instances in the currently targeted space.List<CloudServiceInstance>getServiceInstancesByMetadataLabelSelector(String labelSelector)List<CloudServiceKey>getServiceKeys(CloudServiceInstance serviceInstance)Get service keys for a service instance.List<CloudServiceKey>getServiceKeys(String serviceInstanceName)Get service keys for a service instance.List<CloudServiceOffering>getServiceOfferings()Get all service offerings.List<CloudDomain>getSharedDomains()Get list of all shared domains.CloudSpacegetSpace(String spaceName)Get space name with the specified name.CloudSpacegetSpace(String spaceName, boolean required)Get space name with the specified name.CloudSpacegetSpace(String organizationName, String spaceName)Get space name with the specified name.CloudSpacegetSpace(String organizationName, String spaceName, boolean required)Get space name with the specified name.CloudSpacegetSpace(UUID spaceGuid)Get space name with the specified GUID.List<UUID>getSpaceAuditors()List<UUID>getSpaceAuditors(String spaceName)Get list of space auditor UUID for the space.List<UUID>getSpaceAuditors(String organizationName, String spaceName)Get list of space auditor UUID for the space.List<UUID>getSpaceAuditors(UUID spaceGuid)List<UUID>getSpaceDevelopers()List<UUID>getSpaceDevelopers(String spaceName)Get list of space developer UUID for the space.List<UUID>getSpaceDevelopers(String organizationName, String spaceName)Get list of space developer UUID for the space.List<UUID>getSpaceDevelopers(UUID spaceGuid)List<UUID>getSpaceManagers()List<UUID>getSpaceManagers(String spaceName)Get list of space manager UUID for the space.List<UUID>getSpaceManagers(String organizationName, String spaceName)Get list of space manager UUID for the space.List<UUID>getSpaceManagers(UUID spaceGuid)List<CloudSpace>getSpaces()Get all spaces for the current cloud.List<CloudSpace>getSpaces(String organizationName)Get list of CloudSpaces for organization.CloudStackgetStack(String name)Get a stack by name.CloudStackgetStack(String name, boolean required)Get a stack by name.List<CloudStack>getStacks()Get the list of stacks available for staging applications.CloudTaskgetTask(UUID taskGuid)List<CloudTask>getTasks(String applicationName)Get the list of one-off tasks currently known for the given application.UploadgetUploadStatus(UUID packageGuid)org.springframework.security.oauth2.common.OAuth2AccessTokenlogin()Login using the credentials already set for the client.voidlogout()Logout closing the current session.voidrename(String applicationName, String newName)Rename an application.StartingInforestartApplication(String applicationName)Restart application.CloudTaskrunTask(String applicationName, CloudTask task)Run a one-off task on an application.StartingInfostartApplication(String applicationName)Start application.voidstopApplication(String applicationName)Stop application.voidunbindServiceInstance(CloudApplication application, CloudServiceInstance serviceInstance)Un-associate (unprovision) a service from an application.voidunbindServiceInstance(String applicationName, String serviceInstanceName)Un-associate (unprovision) a service from an application.voidunbindServiceInstance(String applicationName, String serviceInstanceName, ApplicationServicesUpdateCallback applicationServicesUpdateCallback)Un-associate (unprovision) a service from an application.voidupdateApplicationDiskQuota(String applicationName, int disk)Update application disk quota.voidupdateApplicationEnv(String applicationName, 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..voidupdateApplicationInstances(String applicationName, int instances)Update application instances.voidupdateApplicationMemory(String applicationName, int memory)Update application memory.voidupdateApplicationMetadata(UUID guid, org.cloudfoundry.client.v3.Metadata metadata)voidupdateApplicationStaging(String applicationName, Staging staging)Update application staging information.voidupdateApplicationUris(String applicationName, List<String> uris)Update application URIs.voidupdateServiceBroker(CloudServiceBroker serviceBroker)Update a service broker (unchanged forces catalog refresh).voidupdateServiceInstanceMetadata(UUID guid, org.cloudfoundry.client.v3.Metadata metadata)voidupdateServiceParameters(String serviceName, Map<String,Object> parameters)voidupdateServicePlan(String serviceName, String planName)voidupdateServicePlanVisibilityForBroker(String name, boolean visibility)Service plans are private by default when a service broker's catalog is fetched/updated.voidupdateServiceTags(String serviceName, List<String> tags)voiduploadApplication(String applicationName, InputStream inputStream)Upload an application to Cloud Foundry.voiduploadApplication(String applicationName, InputStream inputStream, UploadStatusCallback callback)Upload an application to Cloud Foundry.voiduploadApplication(String applicationName, String file)Upload an application to Cloud Foundry.voiduploadApplication(String applicationName, Path file)Upload an application to Cloud Foundry.voiduploadApplication(String applicationName, Path file, UploadStatusCallback callback)Upload an application to Cloud Foundry.
-
-
-
Constructor Detail
-
CloudControllerClientImpl
public CloudControllerClientImpl(URL controllerUrl, CloudCredentials credentials)
Construct client without a default organization and space.
-
CloudControllerClientImpl
public CloudControllerClientImpl(URL controllerUrl, CloudCredentials credentials, boolean trustSelfSignedCerts)
-
CloudControllerClientImpl
public CloudControllerClientImpl(URL controllerUrl, CloudCredentials credentials, CloudSpace target, boolean trustSelfSignedCerts)
-
CloudControllerClientImpl
public CloudControllerClientImpl(CloudControllerRestClient delegate)
Construct a client with a pre-configured CloudControllerClient
-
-
Method Detail
-
addDomain
public void addDomain(String domainName)
Description copied from interface:CloudControllerClientAdd a private domain in the current organization.- Specified by:
addDomainin interfaceCloudControllerClient- Parameters:
domainName- the domain to add
-
addRoute
public void addRoute(String host, String domainName, String path)
Description copied from interface:CloudControllerClientRegister a new route to the a domain.- Specified by:
addRoutein interfaceCloudControllerClient- Parameters:
host- the host of the route to registerdomainName- the domain of the route to register
-
bindServiceInstance
public void bindServiceInstance(String applicationName, String serviceInstanceName)
Description copied from interface:CloudControllerClientAssociate (provision) a service with an application.- Specified by:
bindServiceInstancein interfaceCloudControllerClient- Parameters:
applicationName- the application nameserviceInstanceName- the service instance name
-
bindServiceInstance
public void bindServiceInstance(String applicationName, String serviceInstanceName, Map<String,Object> parameters, ApplicationServicesUpdateCallback updateServicesCallback)
Description copied from interface:CloudControllerClientAssociate (provision) a service with an application.- Specified by:
bindServiceInstancein interfaceCloudControllerClient- Parameters:
applicationName- the application nameserviceInstanceName- the service instance nameparameters- the binding parametersupdateServicesCallback- callback used for error handling
-
createApplication
public void createApplication(String applicationName, Staging staging, Integer memory, List<String> uris)
Description copied from interface:CloudControllerClientCreate application.- Specified by:
createApplicationin interfaceCloudControllerClient- Parameters:
applicationName- application namestaging- staging infomemory- memory to use in MBuris- list of URIs for the app
-
createApplication
public void createApplication(String applicationName, Staging staging, Integer disk, Integer memory, List<String> uris, DockerInfo dockerInfo)
Description copied from interface:CloudControllerClientCreate application.- Specified by:
createApplicationin interfaceCloudControllerClient- Parameters:
applicationName- application namestaging- staging infodisk- disk quota to use in MBmemory- memory to use in MBuris- list of URIs for the appdockerInfo- docker params(image, username, password)
-
createServiceInstance
public void createServiceInstance(CloudServiceInstance serviceInstance)
Description copied from interface:CloudControllerClientCreate a service instance.- Specified by:
createServiceInstancein interfaceCloudControllerClient- Parameters:
serviceInstance- cloud service instance info
-
createServiceBroker
public void createServiceBroker(CloudServiceBroker serviceBroker)
Description copied from interface:CloudControllerClientCreate a service broker.- Specified by:
createServiceBrokerin interfaceCloudControllerClient- Parameters:
serviceBroker- cloud service broker info
-
createServiceKey
public CloudServiceKey createServiceKey(String serviceInstanceName, String serviceKeyName, Map<String,Object> parameters)
Description copied from interface:CloudControllerClientCreate a service key.- Specified by:
createServiceKeyin interfaceCloudControllerClient- Parameters:
serviceInstanceName- name of service instanceserviceKeyName- name of service-keyparameters- parameters of service-key- Returns:
-
createUserProvidedServiceInstance
public void createUserProvidedServiceInstance(CloudServiceInstance serviceInstance, Map<String,Object> credentials)
Description copied from interface:CloudControllerClientCreate a user-provided service instance.- Specified by:
createUserProvidedServiceInstancein interfaceCloudControllerClient- Parameters:
serviceInstance- cloud service instance infocredentials- the user-provided service instance credentials
-
createUserProvidedServiceInstance
public void createUserProvidedServiceInstance(CloudServiceInstance serviceInstance, Map<String,Object> credentials, String syslogDrainUrl)
Description copied from interface:CloudControllerClientCreate a user-provided service instance for logging.- Specified by:
createUserProvidedServiceInstancein interfaceCloudControllerClient- Parameters:
serviceInstance- cloud service instance infocredentials- the user-provided service instance credentialssyslogDrainUrl- for a logging service instance
-
deleteAllApplications
public void deleteAllApplications()
Description copied from interface:CloudControllerClientDelete all applications.- Specified by:
deleteAllApplicationsin interfaceCloudControllerClient
-
deleteAllServiceInstances
public void deleteAllServiceInstances()
Description copied from interface:CloudControllerClientDelete all service instances.- Specified by:
deleteAllServiceInstancesin interfaceCloudControllerClient
-
deleteApplication
public void deleteApplication(String applicationName)
Description copied from interface:CloudControllerClientDelete application.- Specified by:
deleteApplicationin interfaceCloudControllerClient- Parameters:
applicationName- name of application
-
deleteDomain
public void deleteDomain(String domainName)
Description copied from interface:CloudControllerClientDelete a private domain in the current organization.- Specified by:
deleteDomainin interfaceCloudControllerClient- Parameters:
domainName- the domain to delete
-
deleteOrphanedRoutes
public List<CloudRoute> deleteOrphanedRoutes()
Description copied from interface:CloudControllerClientDelete routes that do not have any application which is assigned to them.- Specified by:
deleteOrphanedRoutesin interfaceCloudControllerClient
-
deleteRoute
public void deleteRoute(String host, String domainName, String path)
Description copied from interface:CloudControllerClientDelete a registered route from the space of the current session.- Specified by:
deleteRoutein interfaceCloudControllerClient- Parameters:
host- the host of the route to deletedomainName- the domain of the route to delete
-
deleteServiceInstance
public void deleteServiceInstance(String serviceInstanceName)
Description copied from interface:CloudControllerClientDelete cloud service instance.- Specified by:
deleteServiceInstancein interfaceCloudControllerClient- Parameters:
serviceInstanceName- name of service instance
-
deleteServiceInstance
public void deleteServiceInstance(CloudServiceInstance serviceInstance)
- Specified by:
deleteServiceInstancein interfaceCloudControllerClient- Parameters:
serviceInstance-CloudServiceInstance
-
deleteServiceBroker
public void deleteServiceBroker(String name)
Description copied from interface:CloudControllerClientDelete a service broker.- Specified by:
deleteServiceBrokerin interfaceCloudControllerClient- Parameters:
name- the service broker name
-
deleteServiceKey
public void deleteServiceKey(String serviceInstanceName, String serviceKeyName)
Description copied from interface:CloudControllerClientDelete a service key.- Specified by:
deleteServiceKeyin interfaceCloudControllerClient- Parameters:
serviceInstanceName- name of service instanceserviceKeyName- name of service key
-
deleteServiceKey
public void deleteServiceKey(CloudServiceKey serviceKey)
Description copied from interface:CloudControllerClientDelete a service key.- Specified by:
deleteServiceKeyin interfaceCloudControllerClient- Parameters:
serviceKey-CloudServiceKeyobject
-
getApplication
public CloudApplication getApplication(String applicationName)
Description copied from interface:CloudControllerClientGet cloud application with the specified name.- Specified by:
getApplicationin interfaceCloudControllerClient- Parameters:
applicationName- name of the app- Returns:
- the cloud application
-
getApplication
public CloudApplication getApplication(String applicationName, boolean required)
Description copied from interface:CloudControllerClientGet cloud application with the specified name.- Specified by:
getApplicationin interfaceCloudControllerClient- Parameters:
applicationName- name of the apprequired- if true, and organization is not found, throw an exception- Returns:
- the cloud application
-
getApplication
public CloudApplication getApplication(UUID applicationGuid)
Description copied from interface:CloudControllerClientGet cloud application with the specified GUID.- Specified by:
getApplicationin interfaceCloudControllerClient- Parameters:
applicationGuid- GUID of the app- Returns:
- the cloud application
-
getApplicationEnvironment
public Map<String,String> getApplicationEnvironment(UUID applicationGuid)
Description copied from interface:CloudControllerClientGet application environment variables for the app with the specified GUID.- Specified by:
getApplicationEnvironmentin interfaceCloudControllerClient- Parameters:
applicationGuid- GUID of the app- Returns:
- the cloud application environment variables
-
getApplicationEnvironment
public Map<String,String> getApplicationEnvironment(String applicationName)
Description copied from interface:CloudControllerClientGet application environment variables for the app with the specified name.- Specified by:
getApplicationEnvironmentin interfaceCloudControllerClient- Parameters:
applicationName- name of the app- Returns:
- the cloud application environment variables
-
getApplicationEvents
public List<CloudEvent> getApplicationEvents(String applicationName)
Description copied from interface:CloudControllerClientGet application events.- Specified by:
getApplicationEventsin interfaceCloudControllerClient- Parameters:
applicationName- name of application- Returns:
- application events
-
getEventsByActee
public List<CloudEvent> getEventsByActee(UUID uuid)
- Specified by:
getEventsByActeein interfaceCloudControllerClient
-
getApplicationInstances
public InstancesInfo getApplicationInstances(String applicationName)
Description copied from interface:CloudControllerClientGet application instances info for application.- Specified by:
getApplicationInstancesin interfaceCloudControllerClient- Parameters:
applicationName- name of application.- Returns:
- instances info
-
getApplicationInstances
public InstancesInfo getApplicationInstances(CloudApplication app)
Description copied from interface:CloudControllerClientGet application instances info for application.- Specified by:
getApplicationInstancesin interfaceCloudControllerClient- Parameters:
app- the application.- Returns:
- instances info
-
getApplications
public List<CloudApplication> getApplications()
Description copied from interface:CloudControllerClientGet all applications in the currently targeted space. This method has EXTREMELY poor performance for spaces with a lot of applications.- Specified by:
getApplicationsin interfaceCloudControllerClient- Returns:
- list of applications
-
getApplicationsByMetadataLabelSelector
public List<CloudApplication> getApplicationsByMetadataLabelSelector(String labelSelector)
- Specified by:
getApplicationsByMetadataLabelSelectorin interfaceCloudControllerClient
-
getCloudControllerUrl
public URL getCloudControllerUrl()
Description copied from interface:CloudControllerClientGet the URL used for the cloud controller.- Specified by:
getCloudControllerUrlin interfaceCloudControllerClient- Returns:
- the cloud controller URL
-
getCloudInfo
public CloudInfo getCloudInfo()
Description copied from interface:CloudControllerClientGet CloudInfo for the current cloud.- Specified by:
getCloudInfoin interfaceCloudControllerClient- Returns:
- CloudInfo object containing the cloud info
-
getDefaultDomain
public CloudDomain getDefaultDomain()
Description copied from interface:CloudControllerClientGets the default domain for the current org, which is the first shared domain.- Specified by:
getDefaultDomainin interfaceCloudControllerClient- Returns:
- the default domain
-
getDomains
public List<CloudDomain> getDomains()
Description copied from interface:CloudControllerClientGet list of all domain shared and private domains.- Specified by:
getDomainsin interfaceCloudControllerClient- Returns:
- list of domains
-
getDomainsForOrganization
public List<CloudDomain> getDomainsForOrganization()
Description copied from interface:CloudControllerClientGet list of all domain registered for the current organization.- Specified by:
getDomainsForOrganizationin interfaceCloudControllerClient- Returns:
- list of domains
-
getEvents
public List<CloudEvent> getEvents()
Description copied from interface:CloudControllerClientGet system events.- Specified by:
getEventsin interfaceCloudControllerClient- Returns:
- all system events
-
getOrganization
public CloudOrganization getOrganization(String organizationName)
Description copied from interface:CloudControllerClientGet the organization with the specified name.- Specified by:
getOrganizationin interfaceCloudControllerClient- Parameters:
organizationName- name of organization- Returns:
-
getOrganization
public CloudOrganization getOrganization(String organizationName, boolean required)
Description copied from interface:CloudControllerClientGet the organization with the specified name.- Specified by:
getOrganizationin interfaceCloudControllerClient- Parameters:
organizationName- name of organizationrequired- if true, and organization is not found, throw an exception- Returns:
-
getOrganizations
public List<CloudOrganization> getOrganizations()
Description copied from interface:CloudControllerClientGet all organizations for the current cloud. This method has poor performance when there are a lot of organizations.- Specified by:
getOrganizationsin interfaceCloudControllerClient- Returns:
- list of organizations
-
getPrivateDomains
public List<CloudDomain> getPrivateDomains()
Description copied from interface:CloudControllerClientGet list of all private domains.- Specified by:
getPrivateDomainsin interfaceCloudControllerClient- Returns:
- list of private domains
-
getRecentLogs
public List<ApplicationLog> getRecentLogs(String applicationName)
Description copied from interface:CloudControllerClientStream recent log entries. Stream logs that were recently produced for an app.- Specified by:
getRecentLogsin interfaceCloudControllerClient- Parameters:
applicationName- the name of the application- Returns:
- the list of recent log entries
-
getRecentLogs
public List<ApplicationLog> getRecentLogs(UUID applicationGuid)
Description copied from interface:CloudControllerClientGet recent log entries. Get logs that were recently produced for an app.- Specified by:
getRecentLogsin interfaceCloudControllerClient- Parameters:
applicationGuid- the guid of the application- Returns:
- the list of recent log entries
-
getRoutes
public List<CloudRoute> getRoutes(String domainName)
Description copied from interface:CloudControllerClientGet the info for all routes for a domain.- Specified by:
getRoutesin interfaceCloudControllerClient- Parameters:
domainName- the domain the routes belong to- Returns:
- list of routes
-
getServiceBroker
public CloudServiceBroker getServiceBroker(String name)
Description copied from interface:CloudControllerClientGet a service broker.- Specified by:
getServiceBrokerin interfaceCloudControllerClient- Parameters:
name- the service broker name- Returns:
- the service broker
-
getServiceBroker
public CloudServiceBroker getServiceBroker(String name, boolean required)
Description copied from interface:CloudControllerClientGet a service broker.- Specified by:
getServiceBrokerin interfaceCloudControllerClient- Parameters:
name- the service broker namerequired- if true, and organization is not found, throw an exception- Returns:
- the service broker
-
getServiceBrokers
public List<CloudServiceBroker> getServiceBrokers()
Description copied from interface:CloudControllerClientGet all service brokers.- Specified by:
getServiceBrokersin interfaceCloudControllerClient- Returns:
-
getServiceInstance
public CloudServiceInstance getServiceInstance(String serviceInstanceName)
Description copied from interface:CloudControllerClientGet a service instance.- Specified by:
getServiceInstancein interfaceCloudControllerClient- Parameters:
serviceInstanceName- name of the service instance- Returns:
- the service instance info
-
getServiceInstance
public CloudServiceInstance getServiceInstance(String serviceInstanceName, boolean required)
Description copied from interface:CloudControllerClientGet a service instance.- Specified by:
getServiceInstancein interfaceCloudControllerClient- Parameters:
serviceInstanceName- name of the service instancerequired- if true, and organization is not found, throw an exception- Returns:
- the service instance info
-
getServiceBindings
public List<CloudServiceBinding> getServiceBindings(UUID serviceInstanceGuid)
Description copied from interface:CloudControllerClientGet the bindings for a particular service instance.- Specified by:
getServiceBindingsin interfaceCloudControllerClient- Parameters:
serviceInstanceGuid- the GUID of the service instance- Returns:
- the bindings
-
getServiceInstanceParameters
public Map<String,Object> getServiceInstanceParameters(UUID guid)
Description copied from interface:CloudControllerClientGet all service instance parameters.- Specified by:
getServiceInstanceParametersin interfaceCloudControllerClient- Parameters:
guid- The service instance guid- Returns:
- service instance parameters in key-value pairs
-
getServiceBindingParameters
public Map<String,Object> getServiceBindingParameters(UUID guid)
Description copied from interface:CloudControllerClientGet all service binding parameters.- Specified by:
getServiceBindingParametersin interfaceCloudControllerClient- Parameters:
guid- The service binding guid- Returns:
- service binding parameters in key-value pairs
-
getServiceKeys
public List<CloudServiceKey> getServiceKeys(String serviceInstanceName)
Description copied from interface:CloudControllerClientGet service keys for a service instance.- Specified by:
getServiceKeysin interfaceCloudControllerClient- Parameters:
serviceInstanceName- name containing service keys- Returns:
- the service keys info
-
getServiceKeys
public List<CloudServiceKey> getServiceKeys(CloudServiceInstance serviceInstance)
Description copied from interface:CloudControllerClientGet service keys for a service instance.- Specified by:
getServiceKeysin interfaceCloudControllerClient- Parameters:
serviceInstance- instance containing service keys- Returns:
- the service keys info
-
getServiceOfferings
public List<CloudServiceOffering> getServiceOfferings()
Description copied from interface:CloudControllerClientGet all service offerings.- Specified by:
getServiceOfferingsin interfaceCloudControllerClient- Returns:
- list of service offerings
-
getServiceInstances
public List<CloudServiceInstance> getServiceInstances()
Description copied from interface:CloudControllerClientGet all service instances in the currently targeted space. This method has EXTREMELY poor performance for spaces with a lot of service instances.- Specified by:
getServiceInstancesin interfaceCloudControllerClient- Returns:
- list of service instances
-
getServiceInstancesByMetadataLabelSelector
public List<CloudServiceInstance> getServiceInstancesByMetadataLabelSelector(String labelSelector)
- Specified by:
getServiceInstancesByMetadataLabelSelectorin interfaceCloudControllerClient
-
getSharedDomains
public List<CloudDomain> getSharedDomains()
Description copied from interface:CloudControllerClientGet list of all shared domains.- Specified by:
getSharedDomainsin interfaceCloudControllerClient- Returns:
- list of shared domains
-
getSpace
public CloudSpace getSpace(UUID spaceGuid)
Description copied from interface:CloudControllerClientGet space name with the specified GUID.- Specified by:
getSpacein interfaceCloudControllerClient
-
getSpace
public CloudSpace getSpace(String organizationName, String spaceName)
Description copied from interface:CloudControllerClientGet space name with the specified name.- Specified by:
getSpacein interfaceCloudControllerClient
-
getSpace
public CloudSpace getSpace(String organizationName, String spaceName, boolean required)
Description copied from interface:CloudControllerClientGet space name with the specified name.- Specified by:
getSpacein interfaceCloudControllerClient
-
getSpace
public CloudSpace getSpace(String spaceName)
Description copied from interface:CloudControllerClientGet space name with the specified name.- Specified by:
getSpacein interfaceCloudControllerClient
-
getSpace
public CloudSpace getSpace(String spaceName, boolean required)
Description copied from interface:CloudControllerClientGet space name with the specified name.- Specified by:
getSpacein interfaceCloudControllerClient
-
getSpaceAuditors
public List<UUID> getSpaceAuditors()
- Specified by:
getSpaceAuditorsin interfaceCloudControllerClient
-
getSpaceAuditors
public List<UUID> getSpaceAuditors(String spaceName)
Description copied from interface:CloudControllerClientGet list of space auditor UUID for the space.- Specified by:
getSpaceAuditorsin interfaceCloudControllerClient- Parameters:
spaceName- name of the space- Returns:
- List of space auditor UUID
-
getSpaceAuditors
public List<UUID> getSpaceAuditors(String organizationName, String spaceName)
Description copied from interface:CloudControllerClientGet list of space auditor UUID for the space.- Specified by:
getSpaceAuditorsin interfaceCloudControllerClient- Parameters:
organizationName- name of the organization containing the spacespaceName- name of the space- Returns:
- List of space auditor UUID
-
getSpaceAuditors
public List<UUID> getSpaceAuditors(UUID spaceGuid)
- Specified by:
getSpaceAuditorsin interfaceCloudControllerClient
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers()
- Specified by:
getSpaceDevelopersin interfaceCloudControllerClient
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers(String spaceName)
Description copied from interface:CloudControllerClientGet list of space developer UUID for the space.- Specified by:
getSpaceDevelopersin interfaceCloudControllerClient- Parameters:
spaceName- name of the space- Returns:
- List of space developer UUID
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers(String organizationName, String spaceName)
Description copied from interface:CloudControllerClientGet list of space developer UUID for the space.- Specified by:
getSpaceDevelopersin interfaceCloudControllerClient- Parameters:
organizationName- name of the organization containing the spacespaceName- name of the space- Returns:
- List of space developer UUID
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers(UUID spaceGuid)
- Specified by:
getSpaceDevelopersin interfaceCloudControllerClient
-
getSpaceManagers
public List<UUID> getSpaceManagers()
- Specified by:
getSpaceManagersin interfaceCloudControllerClient
-
getSpaceManagers
public List<UUID> getSpaceManagers(String spaceName)
Description copied from interface:CloudControllerClientGet list of space manager UUID for the space.- Specified by:
getSpaceManagersin interfaceCloudControllerClient- Parameters:
spaceName- name of the space- Returns:
- List of space manager UUID
-
getSpaceManagers
public List<UUID> getSpaceManagers(String organizationName, String spaceName)
Description copied from interface:CloudControllerClientGet list of space manager UUID for the space.- Specified by:
getSpaceManagersin interfaceCloudControllerClient- Parameters:
organizationName- name of the organization containing the spacespaceName- name of the space- Returns:
- List of space manager UUID
-
getSpaceManagers
public List<UUID> getSpaceManagers(UUID spaceGuid)
- Specified by:
getSpaceManagersin interfaceCloudControllerClient
-
getSpaces
public List<CloudSpace> getSpaces()
Description copied from interface:CloudControllerClientGet all spaces for the current cloud. This method has EXTREMELY poor performance when there are a lot of spaces.- Specified by:
getSpacesin interfaceCloudControllerClient- Returns:
- list of spaces
-
getSpaces
public List<CloudSpace> getSpaces(String organizationName)
Description copied from interface:CloudControllerClientGet list of CloudSpaces for organization.- Specified by:
getSpacesin interfaceCloudControllerClient- Returns:
- List of CloudSpace objects containing the space info
-
getStack
public CloudStack getStack(String name)
Description copied from interface:CloudControllerClientGet a stack by name.- Specified by:
getStackin interfaceCloudControllerClient- Parameters:
name- the name of the stack to get- Returns:
- the stack
-
getStack
public CloudStack getStack(String name, boolean required)
Description copied from interface:CloudControllerClientGet a stack by name.- Specified by:
getStackin interfaceCloudControllerClient- Parameters:
name- the name of the stack to getrequired- if true, and organization is not found, throw an exception- Returns:
- the stack, or null if not found
-
getStacks
public List<CloudStack> getStacks()
Description copied from interface:CloudControllerClientGet the list of stacks available for staging applications.- Specified by:
getStacksin interfaceCloudControllerClient- Returns:
- the list of available stacks
-
login
public org.springframework.security.oauth2.common.OAuth2AccessToken login()
Description copied from interface:CloudControllerClientLogin using the credentials already set for the client.- Specified by:
loginin interfaceCloudControllerClient- Returns:
- authentication token
-
logout
public void logout()
Description copied from interface:CloudControllerClientLogout closing the current session.- Specified by:
logoutin interfaceCloudControllerClient
-
rename
public void rename(String applicationName, String newName)
Description copied from interface:CloudControllerClientRename an application.- Specified by:
renamein interfaceCloudControllerClient- Parameters:
applicationName- the current namenewName- the new name
-
restartApplication
public StartingInfo restartApplication(String applicationName)
Description copied from interface:CloudControllerClientRestart application.- Specified by:
restartApplicationin interfaceCloudControllerClient- Parameters:
applicationName- name of application
-
startApplication
public StartingInfo startApplication(String applicationName)
Description copied from interface:CloudControllerClientStart application. May return starting info if the response obtained after the start request contains headers . If the response does not contain headers, null is returned instead.- Specified by:
startApplicationin interfaceCloudControllerClient- Parameters:
applicationName- name of application- Returns:
- Starting info containing response headers, if headers are present in the response. If there are no headers, return null.
-
stopApplication
public void stopApplication(String applicationName)
Description copied from interface:CloudControllerClientStop application.- Specified by:
stopApplicationin interfaceCloudControllerClient- Parameters:
applicationName- name of application
-
unbindServiceInstance
public void unbindServiceInstance(String applicationName, String serviceInstanceName, ApplicationServicesUpdateCallback applicationServicesUpdateCallback)
Description copied from interface:CloudControllerClientUn-associate (unprovision) a service from an application.- Specified by:
unbindServiceInstancein interfaceCloudControllerClient- Parameters:
applicationName- the application nameserviceInstanceName- the service instance nameapplicationServicesUpdateCallback- callback used for error handling
-
unbindServiceInstance
public void unbindServiceInstance(String applicationName, String serviceInstanceName)
Description copied from interface:CloudControllerClientUn-associate (unprovision) a service from an application.- Specified by:
unbindServiceInstancein interfaceCloudControllerClient- Parameters:
applicationName- the application nameserviceInstanceName- the service instance name
-
unbindServiceInstance
public void unbindServiceInstance(CloudApplication application, CloudServiceInstance serviceInstance)
Description copied from interface:CloudControllerClientUn-associate (unprovision) a service from an application.- Specified by:
unbindServiceInstancein interfaceCloudControllerClient- Parameters:
application- the application instanceserviceInstance- the service instance
-
updateApplicationDiskQuota
public void updateApplicationDiskQuota(String applicationName, int disk)
Description copied from interface:CloudControllerClientUpdate application disk quota.- Specified by:
updateApplicationDiskQuotain interfaceCloudControllerClient- Parameters:
applicationName- name of applicationdisk- new disk setting in MB
-
updateApplicationEnv
public void updateApplicationEnv(String applicationName, Map<String,String> env)
Description copied from interface:CloudControllerClientUpdate application env using a map where the key specifies the name of the environment variable and the value the value of the environment variable..- Specified by:
updateApplicationEnvin interfaceCloudControllerClient- Parameters:
applicationName- name of applicationenv- map of environment settings
-
updateApplicationInstances
public void updateApplicationInstances(String applicationName, int instances)
Description copied from interface:CloudControllerClientUpdate application instances.- Specified by:
updateApplicationInstancesin interfaceCloudControllerClient- Parameters:
applicationName- name of applicationinstances- number of instances to use
-
updateApplicationMetadata
public void updateApplicationMetadata(UUID guid, org.cloudfoundry.client.v3.Metadata metadata)
- Specified by:
updateApplicationMetadatain interfaceCloudControllerClient
-
updateApplicationMemory
public void updateApplicationMemory(String applicationName, int memory)
Description copied from interface:CloudControllerClientUpdate application memory.- Specified by:
updateApplicationMemoryin interfaceCloudControllerClient- Parameters:
applicationName- name of applicationmemory- new memory setting in MB
-
updateApplicationStaging
public void updateApplicationStaging(String applicationName, Staging staging)
Description copied from interface:CloudControllerClientUpdate application staging information.- Specified by:
updateApplicationStagingin interfaceCloudControllerClient- Parameters:
applicationName- name of appplicationstaging- staging information for the app
-
updateApplicationUris
public void updateApplicationUris(String applicationName, List<String> uris)
Description copied from interface:CloudControllerClientUpdate application URIs.- Specified by:
updateApplicationUrisin interfaceCloudControllerClient- Parameters:
applicationName- name of applicationuris- list of URIs the app should use
-
updateServiceInstanceMetadata
public void updateServiceInstanceMetadata(UUID guid, org.cloudfoundry.client.v3.Metadata metadata)
- Specified by:
updateServiceInstanceMetadatain interfaceCloudControllerClient
-
updateServiceBroker
public void updateServiceBroker(CloudServiceBroker serviceBroker)
Description copied from interface:CloudControllerClientUpdate a service broker (unchanged forces catalog refresh).- Specified by:
updateServiceBrokerin interfaceCloudControllerClient- Parameters:
serviceBroker- cloud service broker info
-
updateServicePlanVisibilityForBroker
public void updateServicePlanVisibilityForBroker(String name, boolean visibility)
Description copied from interface:CloudControllerClientService plans are private by default when a service broker's catalog is fetched/updated. This method will update the visibility of all plans for a broker to either public or private.- Specified by:
updateServicePlanVisibilityForBrokerin interfaceCloudControllerClient- Parameters:
name- the service broker namevisibility- true for public, false for private
-
updateServicePlan
public void updateServicePlan(String serviceName, String planName)
- Specified by:
updateServicePlanin interfaceCloudControllerClient
-
updateServiceParameters
public void updateServiceParameters(String serviceName, Map<String,Object> parameters)
- Specified by:
updateServiceParametersin interfaceCloudControllerClient
-
updateServiceTags
public void updateServiceTags(String serviceName, List<String> tags)
- Specified by:
updateServiceTagsin interfaceCloudControllerClient
-
uploadApplication
public void uploadApplication(String applicationName, String file)
Description copied from interface:CloudControllerClientUpload an application to Cloud Foundry.- Specified by:
uploadApplicationin interfaceCloudControllerClient- Parameters:
applicationName- application namefile- path to the application archive or folder
-
uploadApplication
public void uploadApplication(String applicationName, Path file)
Description copied from interface:CloudControllerClientUpload an application to Cloud Foundry.- Specified by:
uploadApplicationin interfaceCloudControllerClient- Parameters:
applicationName- the application namefile- the application archive or folder
-
uploadApplication
public void uploadApplication(String applicationName, Path file, UploadStatusCallback callback)
Description copied from interface:CloudControllerClientUpload an application to Cloud Foundry.- Specified by:
uploadApplicationin interfaceCloudControllerClient- Parameters:
applicationName- the application namefile- the application archivecallback- a callback interface used to provide progress information ornull
-
uploadApplication
public void uploadApplication(String applicationName, InputStream inputStream) throws IOException
Description copied from interface:CloudControllerClientUpload an application to Cloud Foundry. This form ofuploadApplicationwill read the passedInputStreamand copy the contents to a temporary file for upload.- Specified by:
uploadApplicationin interfaceCloudControllerClient- Parameters:
applicationName- the application nameinputStream- the InputStream to read from- Throws:
IOException
-
uploadApplication
public void uploadApplication(String applicationName, InputStream inputStream, UploadStatusCallback callback) throws IOException
Description copied from interface:CloudControllerClientUpload an application to Cloud Foundry. This form ofuploadApplicationwill read the passedInputStreamand copy the contents to a temporary file for upload.- Specified by:
uploadApplicationin interfaceCloudControllerClient- Parameters:
applicationName- the application nameinputStream- the InputStream to read fromcallback- a callback interface used to provide progress information ornull- Throws:
IOException
-
asyncUploadApplication
public CloudPackage asyncUploadApplication(String applicationName, Path file)
- Specified by:
asyncUploadApplicationin interfaceCloudControllerClient
-
asyncUploadApplication
public CloudPackage asyncUploadApplication(String applicationName, Path file, UploadStatusCallback callback)
- Specified by:
asyncUploadApplicationin interfaceCloudControllerClient
-
getUploadStatus
public Upload getUploadStatus(UUID packageGuid)
- Specified by:
getUploadStatusin interfaceCloudControllerClient
-
createBuild
public CloudBuild createBuild(UUID packageGuid)
- Specified by:
createBuildin interfaceCloudControllerClient
-
getBuild
public CloudBuild getBuild(UUID buildGuid)
- Specified by:
getBuildin interfaceCloudControllerClient
-
getTask
public CloudTask getTask(UUID taskGuid)
- Specified by:
getTaskin interfaceCloudControllerClient
-
getTasks
public List<CloudTask> getTasks(String applicationName)
Description copied from interface:CloudControllerClientGet the list of one-off tasks currently known for the given application.- Specified by:
getTasksin interfaceCloudControllerClient- Parameters:
applicationName- the application to look for tasks- Returns:
- the list of known tasks
-
runTask
public CloudTask runTask(String applicationName, CloudTask task)
Description copied from interface:CloudControllerClientRun a one-off task on an application.- Specified by:
runTaskin interfaceCloudControllerClient- Parameters:
applicationName- the application to run the task ontask- the task to run- Returns:
- the ran task
-
cancelTask
public CloudTask cancelTask(UUID taskGuid)
Description copied from interface:CloudControllerClientCancel the given task.- Specified by:
cancelTaskin interfaceCloudControllerClient- Parameters:
taskGuid- the GUID of the task to cancel- Returns:
- the cancelled task
-
bindDropletToApp
public void bindDropletToApp(UUID dropletGuid, UUID applicationGuid)
- Specified by:
bindDropletToAppin interfaceCloudControllerClient
-
getBuildsForApplication
public List<CloudBuild> getBuildsForApplication(UUID applicationGuid)
- Specified by:
getBuildsForApplicationin interfaceCloudControllerClient
-
getBuildsForPackage
public List<CloudBuild> getBuildsForPackage(UUID packageGuid)
- Specified by:
getBuildsForPackagein interfaceCloudControllerClient
-
getCurrentDropletForApplication
public DropletInfo getCurrentDropletForApplication(UUID applicationGuid)
- Specified by:
getCurrentDropletForApplicationin interfaceCloudControllerClient
-
getPackage
public CloudPackage getPackage(UUID packageGuid)
- Specified by:
getPackagein interfaceCloudControllerClient
-
getPackagesForApplication
public List<CloudPackage> getPackagesForApplication(UUID applicationGuid)
- Specified by:
getPackagesForApplicationin interfaceCloudControllerClient
-
-