Interface CloudProvider

All Superinterfaces:
PluginProvider
All Known Subinterfaces:
CloudProvider

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 ProvisionProvider is also available.

There are a few concepts to be aware of when making a cloud plugin. Firstly, there are 2 main required providers when developing one. The CloudProvider and the ProvisionProvider. A cloud provider is responsible for defining all the cloud connectivity information, metadata, and for syncing all the relevant objects needed to facilitate both discovery and provisioning of a compute workload.

A ProvisionProvider registers various provision types within the cloud. For example, with AWS there is one for EC2 Virtual Machines, another for RDS Database Service deployment, and even a CloudFormation provider for deploying arbitrary cloud-native services.

More advanced clouds may need additional providers to provide full functionality or service offerings. AWS is probably the most feature rich of all the plugins. You may need a HostProvider for custom Cluster Types, or a NetworkProvider for creating/managing Software-defined Networks/Subnets.

Since:
0.15.2
  • Method Details

    • getDescription

      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
    • getCircularIcon

      Icon getCircularIcon()
      Returns the circular Cloud logo for display when a user needs to view or add this cloud. SVGs are preferred.
      Returns:
      Icon
      Since:
      0.13.6
    • getOptionTypes

      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

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

      @Deprecated default Collection<ProvisionProvider> getAvailableProvisioningProviders()
      Deprecated.
      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 ProvisionProvider
    • getAvailableProvisionProviders

      Collection<ProvisionProvider> getAvailableProvisionProviders()
      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 ProvisionProvider
    • getAvailableBackupProviders

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

      @Deprecated default ProvisionProvider getProvisioningProvider(String providerCode)
      Deprecated.
      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 ProvisionProvider requested
    • getProvisionProvider

      ProvisionProvider getProvisionProvider(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 ProvisionProvider requested
    • getNetworkTypes

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

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

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

      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
    • refreshDailyCloudType

      default void refreshDailyCloudType()
      Zones/Clouds sometimes need to have a daily sync for all instances of the same type on a daily basis. An example may be to refresh common pricing data that is standard regardless of the cloud account. Rather than doing this once per cloud, it may be better to perform it for all the clouds at once.
    • 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

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

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

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

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

      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

      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

      Boolean supportsDistributedWorker()
      Indicates if the cloud supports the distributed worker functionality
      Returns:
      Boolean
    • canCreateCloudPools

      default Boolean canCreateCloudPools()
      Specifies whether the current cloud allows the user to create custom pools such as VPCs in AWS or Clusters in Vmware
      Returns:
      Boolean
    • canDeleteCloudPools

      default Boolean canDeleteCloudPools()
      Specifies whether the current cloud allows the user to delete custom pools such as VPCs in AWS or Clusters in Vmware
      Returns:
      Boolean
    • getDefaultProvisionTypeCode

      default String getDefaultProvisionTypeCode()
      Returns the default provision code for fetching a ProvisionProvider for this cloud. This is only really necessary if the provision type code is the exact same as the cloud code.
      Returns:
      the provision provider code
    • getDefaultNetworkServerTypeCode

      default String getDefaultNetworkServerTypeCode()
      Returns the default network code for fetching a NetworkProvider for this cloud. This is only really necessary if the network type code is the exact same as the cloud code.
      Returns:
      the network provider code
    • createCloudPool

      default ServiceResponse<CloudPool> createCloudPool(Cloud cloud, CloudPool cloudPool)
    • updateCloudPool

      default ServiceResponse<CloudPool> updateCloudPool(Cloud cloud, CloudPool cloudPool)
    • removeCloudPool

      default ServiceResponse<CloudPool> removeCloudPool(Cloud cloud, CloudPool cloudPool)
    • getCloudCostingProvider

      default CloudCostingProvider getCloudCostingProvider()
      Returns the Costing Provider to be used for costing services. If this is not specified a StandardCostingService is utilized based on pricing and Morpheus metering data. This is often used for public clouds such as Amazon or Azure.
      Returns:
      an instance of a cloud specific CostingProvider.