Interface CloudControllerClient

  • All Known Implementing Classes:
    CloudControllerClientImpl

    public interface CloudControllerClient
    The interface defining operations making up the Cloud Foundry Java client's API.
    • Method Detail

      • addDomain

        void addDomain​(String domainName)
        Add a private domain in the current organization.
        Parameters:
        domainName - the domain to add
      • addRoute

        void addRoute​(String host,
                      String domainName,
                      String path)
        Register a new route to the a domain.
        Parameters:
        host - the host of the route to register
        domainName - the domain of the route to register
      • bindServiceInstance

        void bindServiceInstance​(String applicationName,
                                 String serviceInstanceName)
        Associate (provision) a service with an application.
        Parameters:
        applicationName - the application name
        serviceInstanceName - the service instance name
      • bindServiceInstance

        void bindServiceInstance​(String applicationName,
                                 String serviceInstanceName,
                                 Map<String,​Object> parameters,
                                 ApplicationServicesUpdateCallback updateServicesCallback)
        Associate (provision) a service with an application.
        Parameters:
        applicationName - the application name
        serviceInstanceName - the service instance name
        parameters - the binding parameters
        updateServicesCallback - callback used for error handling
      • createApplication

        void createApplication​(String applicationName,
                               Staging staging,
                               Integer memory,
                               List<String> uris)
        Create application.
        Parameters:
        applicationName - application name
        staging - staging info
        memory - memory to use in MB
        uris - list of URIs for the app
      • createApplication

        void createApplication​(String applicationName,
                               Staging staging,
                               Integer disk,
                               Integer memory,
                               List<String> uris,
                               DockerInfo dockerInfo)
        Create application.
        Parameters:
        applicationName - application name
        staging - staging info
        disk - disk quota to use in MB
        memory - memory to use in MB
        uris - list of URIs for the app
        dockerInfo - docker params(image, username, password)
      • createServiceInstance

        void createServiceInstance​(CloudServiceInstance serviceInstance)
        Create a service instance.
        Parameters:
        serviceInstance - cloud service instance info
      • createServiceBroker

        void createServiceBroker​(CloudServiceBroker serviceBroker)
        Create a service broker.
        Parameters:
        serviceBroker - cloud service broker info
      • createServiceKey

        CloudServiceKey createServiceKey​(String serviceInstanceName,
                                         String serviceKeyName,
                                         Map<String,​Object> parameters)
        Create a service key.
        Parameters:
        serviceInstanceName - name of service instance
        serviceKeyName - name of service-key
        parameters - parameters of service-key
        Returns:
      • createUserProvidedServiceInstance

        void createUserProvidedServiceInstance​(CloudServiceInstance serviceInstance,
                                               Map<String,​Object> credentials)
        Create a user-provided service instance.
        Parameters:
        serviceInstance - cloud service instance info
        credentials - the user-provided service instance credentials
      • createUserProvidedServiceInstance

        void createUserProvidedServiceInstance​(CloudServiceInstance serviceInstance,
                                               Map<String,​Object> credentials,
                                               String syslogDrainUrl)
        Create a user-provided service instance for logging.
        Parameters:
        serviceInstance - cloud service instance info
        credentials - the user-provided service instance credentials
        syslogDrainUrl - for a logging service instance
      • deleteAllApplications

        void deleteAllApplications()
        Delete all applications.
      • deleteAllServiceInstances

        void deleteAllServiceInstances()
        Delete all service instances.
      • deleteApplication

        void deleteApplication​(String applicationName)
        Delete application.
        Parameters:
        applicationName - name of application
      • deleteDomain

        void deleteDomain​(String domainName)
        Delete a private domain in the current organization.
        Parameters:
        domainName - the domain to delete
      • deleteOrphanedRoutes

        List<CloudRoute> deleteOrphanedRoutes()
        Delete routes that do not have any application which is assigned to them.
      • deleteRoute

        void deleteRoute​(String host,
                         String domainName,
                         String path)
        Delete a registered route from the space of the current session.
        Parameters:
        host - the host of the route to delete
        domainName - the domain of the route to delete
      • deleteServiceInstance

        void deleteServiceInstance​(String serviceInstance)
        Delete cloud service instance.
        Parameters:
        serviceInstance - name of service instance
      • deleteServiceBroker

        void deleteServiceBroker​(String name)
        Delete a service broker.
        Parameters:
        name - the service broker name
      • deleteServiceKey

        void deleteServiceKey​(String serviceInstanceName,
                              String serviceKeyName)
        Delete a service key.
        Parameters:
        serviceInstanceName - name of service instance
        serviceKeyName - name of service key
      • getApplication

        CloudApplication getApplication​(String applicationName)
        Get cloud application with the specified name.
        Parameters:
        applicationName - name of the app
        Returns:
        the cloud application
      • getApplication

        CloudApplication getApplication​(String applicationName,
                                        boolean required)
        Get cloud application with the specified name.
        Parameters:
        applicationName - name of the app
        required - if true, and organization is not found, throw an exception
        Returns:
        the cloud application
      • getApplication

        CloudApplication getApplication​(UUID guid)
        Get cloud application with the specified GUID.
        Parameters:
        guid - GUID of the app
        Returns:
        the cloud application
      • getApplicationEnvironment

        Map<String,​String> getApplicationEnvironment​(String applicationName)
        Get application environment variables for the app with the specified name.
        Parameters:
        applicationName - name of the app
        Returns:
        the cloud application environment variables
      • getApplicationEnvironment

        Map<String,​String> getApplicationEnvironment​(UUID applicationGuid)
        Get application environment variables for the app with the specified GUID.
        Parameters:
        applicationGuid - GUID of the app
        Returns:
        the cloud application environment variables
      • getApplicationEvents

        List<CloudEvent> getApplicationEvents​(String applicationName)
        Get application events.
        Parameters:
        applicationName - name of application
        Returns:
        application events
      • getApplicationInstances

        InstancesInfo getApplicationInstances​(String applicationName)
        Get application instances info for application.
        Parameters:
        applicationName - name of application.
        Returns:
        instances info
      • getApplicationInstances

        InstancesInfo getApplicationInstances​(CloudApplication app)
        Get application instances info for application.
        Parameters:
        app - the application.
        Returns:
        instances info
      • getApplications

        List<CloudApplication> getApplications()
        Get all applications in the currently targeted space. This method has EXTREMELY poor performance for spaces with a lot of applications.
        Returns:
        list of applications
      • getCloudControllerUrl

        URL getCloudControllerUrl()
        Get the URL used for the cloud controller.
        Returns:
        the cloud controller URL
      • getCloudInfo

        CloudInfo getCloudInfo()
        Get CloudInfo for the current cloud.
        Returns:
        CloudInfo object containing the cloud info
      • getDefaultDomain

        CloudDomain getDefaultDomain()
        Gets the default domain for the current org, which is the first shared domain.
        Returns:
        the default domain
      • getDomains

        List<CloudDomain> getDomains()
        Get list of all domain shared and private domains.
        Returns:
        list of domains
      • getDomainsForOrganization

        List<CloudDomain> getDomainsForOrganization()
        Get list of all domain registered for the current organization.
        Returns:
        list of domains
      • getEvents

        List<CloudEvent> getEvents()
        Get system events.
        Returns:
        all system events
      • getOrganization

        CloudOrganization getOrganization​(String organizationName)
        Get the organization with the specified name.
        Parameters:
        organizationName - name of organization
        Returns:
      • getOrganization

        CloudOrganization getOrganization​(String organizationName,
                                          boolean required)
        Get the organization with the specified name.
        Parameters:
        organizationName - name of organization
        required - if true, and organization is not found, throw an exception
        Returns:
      • getOrganizations

        List<CloudOrganization> getOrganizations()
        Get all organizations for the current cloud. This method has poor performance when there are a lot of organizations.
        Returns:
        list of organizations
      • getPrivateDomains

        List<CloudDomain> getPrivateDomains()
        Get list of all private domains.
        Returns:
        list of private domains
      • getRecentLogs

        List<ApplicationLog> getRecentLogs​(String applicationName)
        Stream recent log entries. Stream logs that were recently produced for an app.
        Parameters:
        applicationName - the name of the application
        Returns:
        the list of recent log entries
      • getRecentLogs

        List<ApplicationLog> getRecentLogs​(UUID applicationGuid)
        Get recent log entries. Get logs that were recently produced for an app.
        Parameters:
        applicationGuid - the guid of the application
        Returns:
        the list of recent log entries
      • getRoutes

        List<CloudRoute> getRoutes​(String domainName)
        Get the info for all routes for a domain.
        Parameters:
        domainName - the domain the routes belong to
        Returns:
        list of routes
      • getServiceBroker

        CloudServiceBroker getServiceBroker​(String name)
        Get a service broker.
        Parameters:
        name - the service broker name
        Returns:
        the service broker
      • getServiceBroker

        CloudServiceBroker getServiceBroker​(String name,
                                            boolean required)
        Get a service broker.
        Parameters:
        name - the service broker name
        required - if true, and organization is not found, throw an exception
        Returns:
        the service broker
      • getServiceInstance

        CloudServiceInstance getServiceInstance​(String serviceInstanceName)
        Get a service instance.
        Parameters:
        serviceInstanceName - name of the service instance
        Returns:
        the service instance info
      • getServiceInstance

        CloudServiceInstance getServiceInstance​(String serviceInstanceName,
                                                boolean required)
        Get a service instance.
        Parameters:
        serviceInstanceName - name of the service instance
        required - if true, and organization is not found, throw an exception
        Returns:
        the service instance info
      • getServiceBindings

        List<CloudServiceBinding> getServiceBindings​(UUID serviceInstanceGuid)
        Get the bindings for a particular service instance.
        Parameters:
        serviceInstanceGuid - the GUID of the service instance
        Returns:
        the bindings
      • getServiceInstanceParameters

        Map<String,​Object> getServiceInstanceParameters​(UUID guid)
        Get all service instance parameters.
        Parameters:
        guid - The service instance guid
        Returns:
        service instance parameters in key-value pairs
      • getServiceBindingParameters

        Map<String,​Object> getServiceBindingParameters​(UUID guid)
        Get all service binding parameters.
        Parameters:
        guid - The service binding guid
        Returns:
        service binding parameters in key-value pairs
      • getServiceKeys

        List<CloudServiceKey> getServiceKeys​(String serviceInstanceName)
        Get service keys for a service instance.
        Parameters:
        serviceInstanceName - name containing service keys
        Returns:
        the service keys info
      • getServiceKeys

        List<CloudServiceKey> getServiceKeys​(CloudServiceInstance serviceInstance)
        Get service keys for a service instance.
        Parameters:
        serviceInstance - instance containing service keys
        Returns:
        the service keys info
      • getServiceOfferings

        List<CloudServiceOffering> getServiceOfferings()
        Get all service offerings.
        Returns:
        list of service offerings
      • getServiceInstances

        List<CloudServiceInstance> getServiceInstances()
        Get all service instances in the currently targeted space. This method has EXTREMELY poor performance for spaces with a lot of service instances.
        Returns:
        list of service instances
      • getSharedDomains

        List<CloudDomain> getSharedDomains()
        Get list of all shared domains.
        Returns:
        list of shared domains
      • getSpace

        CloudSpace getSpace​(UUID spaceGuid)
        Get space name with the specified GUID.
      • getSpace

        CloudSpace getSpace​(String organizationName,
                            String spaceName)
        Get space name with the specified name.
      • getSpace

        CloudSpace getSpace​(String organizationName,
                            String spaceName,
                            boolean required)
        Get space name with the specified name.
      • getSpace

        CloudSpace getSpace​(String spaceName)
        Get space name with the specified name.
      • getSpace

        CloudSpace getSpace​(String spaceName,
                            boolean required)
        Get space name with the specified name.
      • getSpaceAuditors

        List<UUID> getSpaceAuditors()
      • getSpaceAuditors

        List<UUID> getSpaceAuditors​(String spaceName)
        Get list of space auditor UUID for the space.
        Parameters:
        spaceName - name of the space
        Returns:
        List of space auditor UUID
      • getSpaceAuditors

        List<UUID> getSpaceAuditors​(String organizationName,
                                    String spaceName)
        Get list of space auditor UUID for the space.
        Parameters:
        organizationName - name of the organization containing the space
        spaceName - name of the space
        Returns:
        List of space auditor UUID
      • getSpaceAuditors

        List<UUID> getSpaceAuditors​(UUID spaceGuid)
      • getSpaceDevelopers

        List<UUID> getSpaceDevelopers()
      • getSpaceDevelopers

        List<UUID> getSpaceDevelopers​(String spaceName)
        Get list of space developer UUID for the space.
        Parameters:
        spaceName - name of the space
        Returns:
        List of space developer UUID
      • getSpaceDevelopers

        List<UUID> getSpaceDevelopers​(String organizationName,
                                      String spaceName)
        Get list of space developer UUID for the space.
        Parameters:
        organizationName - name of the organization containing the space
        spaceName - name of the space
        Returns:
        List of space developer UUID
      • getSpaceDevelopers

        List<UUID> getSpaceDevelopers​(UUID spaceGuid)
      • getSpaceManagers

        List<UUID> getSpaceManagers()
      • getSpaceManagers

        List<UUID> getSpaceManagers​(String spaceName)
        Get list of space manager UUID for the space.
        Parameters:
        spaceName - name of the space
        Returns:
        List of space manager UUID
      • getSpaceManagers

        List<UUID> getSpaceManagers​(String organizationName,
                                    String spaceName)
        Get list of space manager UUID for the space.
        Parameters:
        organizationName - name of the organization containing the space
        spaceName - name of the space
        Returns:
        List of space manager UUID
      • getSpaceManagers

        List<UUID> getSpaceManagers​(UUID spaceGuid)
      • getSpaces

        List<CloudSpace> getSpaces()
        Get all spaces for the current cloud. This method has EXTREMELY poor performance when there are a lot of spaces.
        Returns:
        list of spaces
      • getSpaces

        List<CloudSpace> getSpaces​(String organizationName)
        Get list of CloudSpaces for organization.
        Returns:
        List of CloudSpace objects containing the space info
      • getStack

        CloudStack getStack​(String name)
        Get a stack by name.
        Parameters:
        name - the name of the stack to get
        Returns:
        the stack
      • getStack

        CloudStack getStack​(String name,
                            boolean required)
        Get a stack by name.
        Parameters:
        name - the name of the stack to get
        required - if true, and organization is not found, throw an exception
        Returns:
        the stack, or null if not found
      • getStacks

        List<CloudStack> getStacks()
        Get the list of stacks available for staging applications.
        Returns:
        the list of available stacks
      • login

        org.springframework.security.oauth2.common.OAuth2AccessToken login()
        Login using the credentials already set for the client.
        Returns:
        authentication token
      • logout

        void logout()
        Logout closing the current session.
      • rename

        void rename​(String applicationName,
                    String newName)
        Rename an application.
        Parameters:
        applicationName - the current name
        newName - the new name
      • restartApplication

        StartingInfo restartApplication​(String applicationName)
        Restart application.
        Parameters:
        applicationName - name of application
      • startApplication

        StartingInfo startApplication​(String applicationName)
        Start 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.
        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

        void stopApplication​(String applicationName)
        Stop application.
        Parameters:
        applicationName - name of application
      • unbindServiceInstance

        void unbindServiceInstance​(String applicationName,
                                   String serviceInstanceName,
                                   ApplicationServicesUpdateCallback applicationServicesUpdateCallback)
        Un-associate (unprovision) a service from an application.
        Parameters:
        applicationName - the application name
        serviceInstanceName - the service instance name
        applicationServicesUpdateCallback - callback used for error handling
      • unbindServiceInstance

        void unbindServiceInstance​(String applicationName,
                                   String serviceInstanceName)
        Un-associate (unprovision) a service from an application.
        Parameters:
        applicationName - the application name
        serviceInstanceName - the service instance name
      • unbindServiceInstance

        void unbindServiceInstance​(CloudApplication application,
                                   CloudServiceInstance serviceInstance)
        Un-associate (unprovision) a service from an application.
        Parameters:
        application - the application instance
        serviceInstance - the service instance
      • updateApplicationDiskQuota

        void updateApplicationDiskQuota​(String applicationName,
                                        int disk)
        Update application disk quota.
        Parameters:
        applicationName - name of application
        disk - new disk setting in MB
      • updateApplicationEnv

        void updateApplicationEnv​(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..
        Parameters:
        applicationName - name of application
        env - map of environment settings
      • updateApplicationInstances

        void updateApplicationInstances​(String applicationName,
                                        int instances)
        Update application instances.
        Parameters:
        applicationName - name of application
        instances - number of instances to use
      • updateApplicationMemory

        void updateApplicationMemory​(String applicationName,
                                     int memory)
        Update application memory.
        Parameters:
        applicationName - name of application
        memory - new memory setting in MB
      • updateApplicationStaging

        void updateApplicationStaging​(String applicationName,
                                      Staging staging)
        Update application staging information.
        Parameters:
        applicationName - name of appplication
        staging - staging information for the app
      • updateApplicationUris

        void updateApplicationUris​(String applicationName,
                                   List<String> uris)
        Update application URIs.
        Parameters:
        applicationName - name of application
        uris - list of URIs the app should use
      • updateServiceBroker

        void updateServiceBroker​(CloudServiceBroker serviceBroker)
        Update a service broker (unchanged forces catalog refresh).
        Parameters:
        serviceBroker - cloud service broker info
      • updateServicePlanVisibilityForBroker

        void updateServicePlanVisibilityForBroker​(String name,
                                                  boolean visibility)
        Service 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.
        Parameters:
        name - the service broker name
        visibility - true for public, false for private
      • updateServicePlan

        void updateServicePlan​(String serviceName,
                               String planName)
      • updateServiceParameters

        void updateServiceParameters​(String serviceName,
                                     Map<String,​Object> parameters)
      • updateServiceTags

        void updateServiceTags​(String serviceName,
                               List<String> tags)
      • uploadApplication

        void uploadApplication​(String applicationName,
                               String file)
        Upload an application to Cloud Foundry.
        Parameters:
        applicationName - application name
        file - path to the application archive or folder
      • uploadApplication

        void uploadApplication​(String applicationName,
                               Path file)
        Upload an application to Cloud Foundry.
        Parameters:
        applicationName - the application name
        file - the application archive or folder
      • uploadApplication

        void uploadApplication​(String applicationName,
                               Path file,
                               UploadStatusCallback callback)
        Upload an application to Cloud Foundry.
        Parameters:
        applicationName - the application name
        file - the application archive
        callback - a callback interface used to provide progress information or null
      • uploadApplication

        void uploadApplication​(String applicationName,
                               InputStream inputStream)
                        throws IOException
        Upload an application to Cloud Foundry. This form of uploadApplication will read the passed InputStream and copy the contents to a temporary file for upload.
        Parameters:
        applicationName - the application name
        inputStream - the InputStream to read from
        Throws:
        IOException
      • uploadApplication

        void uploadApplication​(String applicationName,
                               InputStream inputStream,
                               UploadStatusCallback callback)
                        throws IOException
        Upload an application to Cloud Foundry. This form of uploadApplication will read the passed InputStream and copy the contents to a temporary file for upload.
        Parameters:
        applicationName - the application name
        inputStream - the InputStream to read from
        callback - a callback interface used to provide progress information or null
        Throws:
        IOException
      • getUploadStatus

        Upload getUploadStatus​(UUID packageGuid)
      • getTasks

        List<CloudTask> getTasks​(String applicationName)
        Get the list of one-off tasks currently known for the given application.
        Parameters:
        applicationName - the application to look for tasks
        Returns:
        the list of known tasks
        Throws:
        UnsupportedOperationException - if the targeted controller does not support tasks
      • runTask

        CloudTask runTask​(String applicationName,
                          CloudTask task)
        Run a one-off task on an application.
        Parameters:
        applicationName - the application to run the task on
        task - the task to run
        Returns:
        the ran task
        Throws:
        UnsupportedOperationException - if the targeted controller does not support tasks
      • cancelTask

        CloudTask cancelTask​(UUID taskGuid)
        Cancel the given task.
        Parameters:
        taskGuid - the GUID of the task to cancel
        Returns:
        the cancelled task
      • bindDropletToApp

        void bindDropletToApp​(UUID dropletGuid,
                              UUID applicationGuid)
      • getBuildsForApplication

        List<CloudBuild> getBuildsForApplication​(UUID applicationGuid)
      • updateApplicationMetadata

        void updateApplicationMetadata​(UUID guid,
                                       org.cloudfoundry.client.v3.Metadata metadata)
      • updateServiceInstanceMetadata

        void updateServiceInstanceMetadata​(UUID guid,
                                           org.cloudfoundry.client.v3.Metadata metadata)
      • getCurrentDropletForApplication

        DropletInfo getCurrentDropletForApplication​(UUID applicationGuid)