Interface CloudProvider

  • All Superinterfaces:
    PluginProvider

    public interface CloudProvider
    extends PluginProvider
    Provides a standard set of methods for interacting with cloud integrations or on-prem service providers. This includes syncing assets related to things like VirtualMachines or Containers for various cloud types. For integrating with actual provisioning a ProvisioningProvider is also available. TODO : Still a Work In Progress and not yet supported
    Since:
    0.8.0
    • Method Detail

      • getDescription

        java.lang.String getDescription()
        Grabs the description for the CloudProvider
        Returns:
        String
      • getIcon

        Icon getIcon()
        Returns the Cloud logo for display when a user needs to view or add this cloud. SVGs are preferred.
        Returns:
        Icon representation of assets stored in the src/assets of the project.
        Since:
        0.13.0
      • getOptionTypes

        java.util.Collection<OptionType> getOptionTypes()
        Provides a Collection of OptionType inputs that define the required input fields for defining a cloud integration
        Returns:
        Collection of OptionType
      • getComputeServerTypes

        java.util.Collection<ComputeServerType> getComputeServerTypes()
        Grabs all ComputeServerType objects that this CloudProvider can represent during a sync or during a provision.
        Returns:
        collection of ComputeServerType
      • getAvailableProvisioningProviders

        java.util.Collection<ProvisioningProvider> getAvailableProvisioningProviders()
        Grabs available provisioning providers related to the target Cloud Plugin. Some clouds have multiple provisioning providers or some clouds allow for service based providers on top like (Docker or Kubernetes).
        Returns:
        Collection of ProvisioningProvider
      • getAvailableBackupProviders

        java.util.Collection<BackupProvider> getAvailableBackupProviders()
        Grabs available backup providers related to the target Cloud Plugin.
        Returns:
        Collection of BackupProvider
      • getProvisioningProvider

        ProvisioningProvider getProvisioningProvider​(java.lang.String providerCode)
        Grabs the singleton instance of the provisioning provider based on the code defined in its implementation. Typically Providers are singleton and instanced in the Plugin class
        Parameters:
        providerCode - String representation of the provider short code
        Returns:
        the ProvisioningProvider requested
      • getNetworkTypes

        java.util.Collection<NetworkType> getNetworkTypes()
        Provides a Collection of NetworkType related to this CloudProvider
        Returns:
        Collection of NetworkType
      • getSubnetTypes

        java.util.Collection<NetworkSubnetType> getSubnetTypes()
        Provides a Collection of NetworkSubnetType related to this CloudProvider
        Returns:
        Collection of NetworkSubnetType
      • getStorageVolumeTypes

        java.util.Collection<StorageVolumeType> getStorageVolumeTypes()
        Provides a Collection of StorageVolumeType related to this CloudProvider
        Returns:
        Collection of StorageVolumeType
      • getStorageControllerTypes

        java.util.Collection<StorageControllerType> getStorageControllerTypes()
        Provides a Collection of StorageControllerType related to this CloudProvider
        Returns:
        Collection of StorageControllerType
      • validate

        ServiceResponse validate​(Cloud cloudInfo,
                                 ValidateCloudRequest validateCloudRequest)
        Validates the submitted cloud information to make sure it is functioning correctly. If a ServiceResponse is not marked as successful then the validation results will be bubbled up to the user.
        Parameters:
        cloudInfo - cloud
        validateCloudRequest - Additional validation information
        Returns:
        ServiceResponse
      • initializeCloud

        ServiceResponse initializeCloud​(Cloud cloudInfo)
        Called when a Cloud From Morpheus is first saved. This is a hook provided to take care of initial state assignment that may need to take place.
        Parameters:
        cloudInfo - instance of the cloud object that is being initialized.
        Returns:
        ServiceResponse
      • refresh

        ServiceResponse refresh​(Cloud cloudInfo)
        Zones/Clouds are refreshed periodically by the Morpheus Environment. This includes things like caching of brownfield environments and resources such as Networks, Datastores, Resource Pools, etc.
        Parameters:
        cloudInfo - cloud
        Returns:
        ServiceResponse. If ServiceResponse.success == true, then Cloud status will be set to Cloud.Status.ok. If ServiceResponse.success == false, the Cloud status will be set to ServiceResponse.data['status'] or Cloud.Status.error if not specified. So, to indicate that the Cloud is offline, return `ServiceResponse.error('cloud is not reachable', null, [status: Cloud.Status.offline])`
      • refreshDaily

        void refreshDaily​(Cloud cloudInfo)
        Zones/Clouds are refreshed periodically by the Morpheus Environment. This includes things like caching of brownfield environments and resources such as Networks, Datastores, Resource Pools, etc. This represents the long term sync method that happens daily instead of every 5-10 minute cycle
        Parameters:
        cloudInfo - cloud
      • deleteCloud

        ServiceResponse deleteCloud​(Cloud cloudInfo)
        Called when a Cloud From Morpheus is removed. This is a hook provided to take care of cleaning up any state.
        Parameters:
        cloudInfo - instance of the cloud object that is being removed.
        Returns:
        ServiceResponse
      • hasComputeZonePools

        java.lang.Boolean hasComputeZonePools()
        Returns whether the cloud supports ComputeZonePool
        Returns:
        Boolean
      • hasNetworks

        java.lang.Boolean hasNetworks()
        Returns whether a cloud supports Network
        Returns:
        Boolean
      • hasFolders

        java.lang.Boolean hasFolders()
        Returns whether a cloud supports ComputeZoneFolder
        Returns:
        Boolean
      • hasDatastores

        java.lang.Boolean hasDatastores()
        Returns whether a cloud supports Datastore
        Returns:
        Boolean
      • hasBareMetal

        java.lang.Boolean hasBareMetal()
        Returns whether a cloud supports bare metal VMs
        Returns:
        Boolean
      • startServer

        ServiceResponse startServer​(ComputeServer computeServer)
        Called when a server should be started. Returning a response of success will cause corresponding updates to usage records, result in the powerState of the computeServer to be set to 'on', and related instances set to 'running'
        Parameters:
        computeServer - server to start
        Returns:
        ServiceResponse
      • stopServer

        ServiceResponse stopServer​(ComputeServer computeServer)
        Called when a server should be stopped. Returning a response of success will cause corresponding updates to usage records, result in the powerState of the computeServer to be set to 'off', and related instances set to 'stopped'
        Parameters:
        computeServer - server to stop
        Returns:
        ServiceResponse
      • deleteServer

        ServiceResponse deleteServer​(ComputeServer computeServer)
        Called when a server should be deleted from the Cloud.
        Parameters:
        computeServer - server to delete
        Returns:
        ServiceResponse
      • hasCloudInit

        java.lang.Boolean hasCloudInit()
        Indicates if the cloud supports cloud-init. Returning true will allow configuration of the Cloud to allow installing the agent remotely via SSH /WinRM or via Cloud Init
        Returns:
        Boolean
      • supportsDistributedWorker

        java.lang.Boolean supportsDistributedWorker()
        Indicates if the cloud supports the distributed worker functionality
        Returns:
        Boolean