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

        Optional<String> bindServiceInstance​(String applicationName,
                                             String serviceInstanceName)
        Associate (provision) a service with an application.
        Parameters:
        applicationName - the application name
        serviceInstanceName - the service instance name
        Returns:
        job id for async polling if present
      • bindServiceInstance

        Optional<String> 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
        Returns:
        job id for async polling if present
      • createApplication

        void createApplication​(ApplicationToCreateDto applicationToCreateDto)
        Create application
        Parameters:
        applicationToCreateDto - the application's parameters used for its creation
      • createServiceInstance

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

        String createServiceBroker​(CloudServiceBroker serviceBroker)
        Create a service broker.
        Parameters:
        serviceBroker - cloud service broker info
        Returns:
        job id for async poll
      • createAndFetchServiceKey

        CloudServiceKey createAndFetchServiceKey​(CloudServiceKey keyModel,
                                                 String serviceInstanceName)
        Parameters:
        keyModel - service-key cloud object
        serviceInstanceName - name of related service instance
        Returns:
        the service-key object populated with new guid
      • createServiceKey

        Optional<String> createServiceKey​(CloudServiceKey keyModel,
                                          String serviceInstanceName)
        Parameters:
        keyModel - service-key cloud object
        serviceInstanceName - name of related service instance
        Returns:
        job id for async polling if present
      • createServiceKey

        Optional<String> 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:
        job id for async polling if present
      • createUserProvidedServiceInstance

        void createUserProvidedServiceInstance​(CloudServiceInstance serviceInstance)
        Create a user-provided service instance.
        Parameters:
        serviceInstance - cloud service instance info
      • 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

        void 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

        String deleteServiceBroker​(String name)
        Delete a service broker.
        Parameters:
        name - the service broker name
        Returns:
        async job id
      • getServiceBinding

        CloudServiceBinding getServiceBinding​(UUID serviceBindingId)
        Get a service binding
        Parameters:
        serviceBindingId - the id of the service binding
        Returns:
        the service binding
      • deleteServiceBinding

        Optional<String> deleteServiceBinding​(String serviceInstanceName,
                                              String serviceKeyName)
        Delete a service binding.
        Parameters:
        serviceInstanceName - name of service instance
        serviceKeyName - name of service key
        Returns:
        job id for async polling if present
      • deleteServiceBinding

        Optional<String> deleteServiceBinding​(UUID bindingGuid,
                                              ServiceBindingOperationCallback serviceBindingOperationCallback)
        Delete a service binding.
        Parameters:
        bindingGuid - The GUID of the binding
        serviceBindingOperationCallback - callback used for error handling
        Returns:
        job id for async polling if present
      • deleteServiceBinding

        Optional<String> deleteServiceBinding​(UUID bindingGuid)
        Delete a service binding.
        Parameters:
        bindingGuid - The GUID of the binding
        Returns:
        job id for async polling if present
      • 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
      • getApplicationGuid

        UUID getApplicationGuid​(String applicationName)
        Get the GUID of the cloud application with the specified name.
        Parameters:
        applicationName - name of the app
        Returns:
        the cloud application's guid
      • getApplicationName

        String getApplicationName​(UUID applicationGuid)
      • 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​(CloudApplication app)
        Get application instances info for application.
        Parameters:
        app - the application.
        Returns:
        instances info
      • getApplicationInstances

        InstancesInfo getApplicationInstances​(UUID applicationGuid)
      • getApplicationProcess

        CloudProcess getApplicationProcess​(UUID applicationGuid)
      • getApplicationSshEnabled

        boolean getApplicationSshEnabled​(UUID applicationGuid)
      • 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
      • 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
      • getPrivateDomains

        List<CloudDomain> getPrivateDomains()
        Get list of all private domains.
        Returns:
        list of private domains
      • 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
      • getServiceBrokers

        List<CloudServiceBroker> getServiceBrokers()
        Get all service brokers.
        Returns:
        the service brokers
      • getRequiredServiceInstanceGuid

        UUID getRequiredServiceInstanceGuid​(String serviceInstanceName)
        Get the GUID of a service instance.
        Parameters:
        serviceInstanceName - the name of the service instance
        Returns:
        the service instance GUID
      • 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 service instance is not found, throw an exception
        Returns:
        the service instance info
      • getServiceInstanceName

        String getServiceInstanceName​(UUID serviceInstanceGuid)
        Get a service instance name.
        Parameters:
        serviceInstanceGuid - GUID of the service instance
        Returns:
        the service instance name
      • getServiceInstanceWithoutAuxiliaryContent

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

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

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

        List<CloudServiceBinding> getAppBindings​(UUID applicationGuid)
        Get the bindings for a particular application.
        Parameters:
        applicationGuid - the GUID of the application
        Returns:
        the bindings
      • getServiceBindingForApplication

        CloudServiceBinding getServiceBindingForApplication​(UUID applicationId,
                                                            UUID serviceInstanceGuid)
        Get the binding between an application and a service instance.
        Parameters:
        applicationId - the GUID of the application
        serviceInstanceGuid - the GUID of the service instance
        Returns:
        the binding
      • 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
      • getUserProvidedServiceInstanceParameters

        Map<String,​Object> getUserProvidedServiceInstanceParameters​(UUID guid)
        Get all user-provided service instance parameters
        Parameters:
        guid - The service instance guid
        Returns:
        user-provided 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
      • getServiceKey

        CloudServiceKey getServiceKey​(String serviceInstanceName,
                                      String serviceKeyName)
        Get a service key.
        Parameters:
        serviceInstanceName - The service instance name
        serviceKeyName - The service key name
        Returns:
        the service key info
      • 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
      • getSharedDomains

        List<CloudDomain> getSharedDomains()
        Get list of all shared domains.
        Returns:
        list of shared domains
      • 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
      • rename

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

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

        void 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
      • stopApplication

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

        Optional<String> 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
        Returns:
        job id for async polling if present
      • unbindServiceInstance

        Optional<String> unbindServiceInstance​(String applicationName,
                                               String serviceInstanceName)
        Un-associate (unprovision) a service from an application.
        Parameters:
        applicationName - the application name
        serviceInstanceName - the service instance name
        Returns:
        job id for async polling if present
      • unbindServiceInstance

        Optional<String> unbindServiceInstance​(UUID applicationGuid,
                                               UUID serviceInstanceGuid)
        Un-associate (unprovision) a service from an application.
        Parameters:
        applicationGuid - the application guid
        serviceInstanceGuid - the service instance guid
        Returns:
        job id for async polling if present
      • 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
      • updateApplicationRoutes

        void updateApplicationRoutes​(String applicationName,
                                     Set<CloudRoute> routes)
        Update application Routes.
        Parameters:
        applicationName - name of application
        routes - list of route summary info for the routes the app should use
      • updateServiceBroker

        String updateServiceBroker​(CloudServiceBroker serviceBroker)
        Update a service broker (unchanged forces catalog refresh).
        Parameters:
        serviceBroker - cloud service broker info
        Returns:
        async job id
      • updateServicePlanVisibilityForBroker

        void updateServicePlanVisibilityForBroker​(String name,
                                                  ServicePlanVisibility 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)
      • updateServiceSyslogDrainUrl

        void updateServiceSyslogDrainUrl​(String serviceName,
                                         String syslogDrainUrl)
      • 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)
      • updateServiceBindingMetadata

        void updateServiceBindingMetadata​(UUID guid,
                                          org.cloudfoundry.client.v3.Metadata metadata)
      • getServiceInstancesWithoutAuxiliaryContentByMetadataLabelSelector

        List<CloudServiceInstance> getServiceInstancesWithoutAuxiliaryContentByMetadataLabelSelector​(String labelSelector)
      • getCurrentDropletForApplication

        DropletInfo getCurrentDropletForApplication​(UUID applicationGuid)
      • getUserRolesBySpaceAndUser

        Set<UserRole> getUserRolesBySpaceAndUser​(UUID spaceGuid,
                                                 UUID userGuid)