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

      default Collection<ComputeDeviceType> getComputeDeviceTypes()
      Grabs all ComputeDeviceType objects that this CloudProvider can represent during a sync or during a provision.
      Returns:
      collection of ComputeDeviceType
      Since:
      1.2.11
    • 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
    • getSupportedNetworkProviderCodes

      default Collection<String> getSupportedNetworkProviderCodes()
      A list of supported NetworkProviders that can be used for networking services on this cloud
      Returns:
      a list of codes for network providers from either this plugin or other plugins.
    • 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
    • getStorageAggregateTypes

      default Collection<StorageAggregateType> getStorageAggregateTypes()
      Provides a Collection of StorageAggregateType related to this CloudProvider
      Returns:
      Collection of StorageAggregateType
    • 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
    • provisionRequiresResourcePool

      default Boolean provisionRequiresResourcePool()
      Returns whether the cloud requires a resource pool to be selected for provisioning
      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
    • hasSecurityGroups

      default Boolean hasSecurityGroups()
      Returns whether a cloud supports SecurityGroup
      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
    • getServerStats

      default List<ServerStatsData> getServerStats(ComputeServer computeServer, Map<String,Object> opts)
      Called to retrieve server statistics for a compute server. This method allows cloud providers to return historical metrics data for CPU, memory, and storage usage. Cloud providers that support server statistics should override this method to fetch and return the metrics data.

      The returned list should contain ServerStatsData objects representing metrics at different points in time. Each data point should include timestamp, CPU usage, memory usage, and storage usage information.

      Parameters:
      computeServer - the server to retrieve statistics for
      opts - additional options that may be passed to customize the statistics retrieval (e.g., time range, date filters)
      Returns:
      List of ServerStatsData containing historical metrics, or null if not supported by this cloud provider
    • 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
    • canCreateNetworks

      default Boolean canCreateNetworks()
      Specifies whether the current cloud allows the user to create new networks
      Returns:
      Boolean
      Since:
      0.15.12
    • canCreateDatastores

      default Boolean canCreateDatastores()
      Specifies whether the current cloud allows the user to create new datastores
      Returns:
      Boolean
      Since:
      1.2.6
    • 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
    • getDefaultLoadBalancerTypeCode

      default String getDefaultLoadBalancerTypeCode()
      Returns the default load balancer type code for fetching a LoadBalancerProvider for this cloud. This is only really necessary if the load balancer type code is the exact same as the cloud code.
      Returns:
      the load balancer provider code
    • getCloudInstanceTypeLayoutCode

      default String getCloudInstanceTypeLayoutCode()
      Returns the default cloud instance type layout code when syncing the plugin provider. This can be used to overwrite the default layout code to one different from the provision type code.
      Returns:
      the cloud instance type layout code
    • hasCosting

      default Boolean hasCosting()
      Indicates whether the cloud provider supports costing functionality. Costing functionality typically involves tracking and managing costs associated with cloud resources.
      Returns:
      Boolean - `true` if costing is supported, `false` otherwise.
    • hasReservations

      default Boolean hasReservations()
      Indicates whether the cloud provider supports reservations. Reservations allow users to reserve specific resources or capacities in the cloud.
      Returns:
      Boolean - `true` if reservations are supported, `false` otherwise.
    • supportsAgentlessMetrics

      default Boolean supportsAgentlessMetrics()
      Indicates whether the cloud provider supports agentless metrics collection. Agentless metrics collection involves gathering performance data without requiring an agent on the resource.
      Returns:
      Boolean - `true` if agentless metrics are supported, `false` otherwise.
    • supportsOrphanedGuidance

      default Boolean supportsOrphanedGuidance()
      Indicates whether the cloud provider supports orphaned guidance. Orphaned guidance helps identify and manage unused or orphaned resources in the cloud.
      Returns:
      Boolean - `true` if orphaned guidance is supported, `false` otherwise.
    • canSyncHypervisorStats

      default Boolean canSyncHypervisorStats()
      Indicates whether the cloud provider can synchronize hypervisor statistics. Synchronizing hypervisor stats involves collecting and updating data about the hypervisor's performance and usage.
      Returns:
      Boolean - `true` if hypervisor stats synchronization is supported, `false` otherwise.
    • hasNativePlans

      default Boolean hasNativePlans()
      Indicates whether the cloud provider supports native plans. Native plans refer to predefined service plans specific to the cloud provider.
      Returns:
      Boolean - `true` if native plans are supported, `false` otherwise.
    • 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.
    • getIacResourceMappingProvider

      default IacResourceMappingProvider getIacResourceMappingProvider()
      If the cloud supports IaC based provisioning, return the mapping provider here and implement the ProvisionProvider.IacResourceFacet in your ProvisionProvider
      Returns:
      an instance of a cloud specific IacResourceMappingProvider.
      Since:
      0.15.10
    • filterNetworks

      default Collection<Network> filterNetworks(Cloud cloud, Collection<Network> networks, CloudPool cloudPool)
      Deprecated.
      Use filterSubnets(Cloud, Collection, CloudPool) instead. Support for additional network filtering during provisioning
      Returns:
      Collection of Network
      Since:
      0.15.13
    • filterSubnets

      default Collection<NetworkSubnet> filterSubnets(Cloud cloud, Collection<NetworkSubnet> subnets, CloudPool cloudPool)
      Support for additional subnet filtering during provisioning
      Returns:
      Collection of NetworkSubnet.
      Since:
      1.2.11
    • filterDatastores

      default Collection<Datastore> filterDatastores(Cloud cloud, Collection<Datastore> datastores, Collection<CloudPool> resourcePools)
      Support for additional datastore filtering during provisioning
      Returns:
      Collection of Datastore.
      Since:
      0.15.13
    • filterServicePlans

      default Collection<ServicePlan> filterServicePlans(Cloud cloud, Collection<ServicePlan> servicePlans, FilterServicePlansCriteria criteria)
      Support for additional service plan filtering during provisioning
      Parameters:
      cloud - The cloud that we're provisioning an instance on
      servicePlans - The set of available service plans
      criteria - The criteria for filtering the service plans
      Returns:
      the filtered service plans
      Since:
      1.2.6
    • getCloudClassification

      default CloudProvider.CloudClassification getCloudClassification()
      Gets the cloud classification for this provider (e.g., public, private).
      Returns:
      cloud classification
      Since:
      1.2.8
    • getCloudSummary

      default CloudSummary getCloudSummary(Cloud cloud, User user)
      Gets the cloud summary information to be displayed in the Cloud -> Summary tab. This allows plugins to provide custom summary information including:
      Parameters:
      cloud - the cloud for which to get the summary
      user - the current user requesting the summary
      Returns:
      CloudSummary containing the summary information, or null if not implemented
      Since:
      1.2.15
    • getCloudSummaryProvider

      default CloudSummaryProvider getCloudSummaryProvider()
      Gets the cloud summary provider for rendering custom zone summary content. This provider will be used to render custom HTML in the zone summary section.
      Returns:
      CloudSummaryProvider instance, or null if custom rendering is not needed
      Since:
      1.2.15
    • getCloudCostingSummaryProvider

      default CloudCostingSummaryProvider getCloudCostingSummaryProvider()
      Gets the costing summary provider for rendering custom costing summary content. This provider will be used to render custom HTML in the costing summary section.
      Returns:
      CloudCostingSummaryProvider instance, or null if custom rendering is not needed
      Since:
      1.2.15