Interface CloudProvider
- All Superinterfaces:
PluginProvider
- All Known Subinterfaces:
CloudProvider
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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAdds support to aCloudProviderfor managing Affinity and anti-affinity groups.static enumClassification for a cloud (e.g., public, private).Nested classes/interfaces inherited from interface com.morpheusdata.core.providers.PluginProvider
PluginProvider.ConfigurationDriftCheckFacet<T>, PluginProvider.EventSubscriberFacet<E extends Event>, PluginProvider.UpdateFacet<T> -
Method Summary
Modifier and TypeMethodDescriptiondefault BooleanSpecifies whether the current cloud allows the user to create custom pools such as VPCs in AWS or Clusters in Vmwaredefault BooleanSpecifies whether the current cloud allows the user to create new datastoresdefault BooleanSpecifies whether the current cloud allows the user to create new networksdefault BooleanSpecifies whether the current cloud allows the user to delete custom pools such as VPCs in AWS or Clusters in Vmwaredefault BooleanIndicates whether the cloud provider can synchronize hypervisor statistics.default ServiceResponse<CloudPool>createCloudPool(Cloud cloud, CloudPool cloudPool) deleteCloud(Cloud cloudInfo) Called when a Cloud From Morpheus is removed.deleteServer(ComputeServer computeServer) Called when a server should be deleted from the Cloud.default Collection<Datastore>filterDatastores(Cloud cloud, Collection<Datastore> datastores, Collection<CloudPool> resourcePools) Support for additional datastore filtering during provisioningdefault Collection<Network>filterNetworks(Cloud cloud, Collection<Network> networks, CloudPool cloudPool) Deprecated.default Collection<ServicePlan>filterServicePlans(Cloud cloud, Collection<ServicePlan> servicePlans, FilterServicePlansCriteria criteria) Support for additional service plan filtering during provisioningdefault Collection<NetworkSubnet>filterSubnets(Cloud cloud, Collection<NetworkSubnet> subnets, CloudPool cloudPool) Support for additional subnet filtering during provisioningGrabs available backup providers related to the target Cloud Plugin.default Collection<ProvisionProvider>Deprecated.replaced by {getAvailableProvisionProviders()}Grabs available provisioning providers related to the target Cloud Plugin.Returns the circular Cloud logo for display when a user needs to view or add this cloud.Gets the cloud classification for this provider (e.g., public, private).default CloudCostingProviderReturns the Costing Provider to be used for costing services.default CloudCostingSummaryProviderGets the costing summary provider for rendering custom costing summary content.default StringReturns the default cloud instance type layout code when syncing the plugin provider.default CloudSummarygetCloudSummary(Cloud cloud, User user) Gets the cloud summary information to be displayed in the Cloud -> Summary tab.default CloudSummaryProviderGets the cloud summary provider for rendering custom zone summary content.default Collection<ComputeDeviceType>Grabs allComputeDeviceTypeobjects that this CloudProvider can represent during a sync or during a provision.Grabs allComputeServerTypeobjects that this CloudProvider can represent during a sync or during a provision.default StringReturns the default load balancer type code for fetching aLoadBalancerProviderfor this cloud.default StringReturns the default network code for fetching aNetworkProviderfor this cloud.default StringReturns the default provision code for fetching aProvisionProviderfor this cloud.Grabs the description for the CloudProviderdefault IacResourceMappingProviderIf the cloud supports IaC based provisioning, return the mapping provider here and implement theProvisionProvider.IacResourceFacetin your ProvisionProvidergetIcon()Returns the Cloud logo for display when a user needs to view or add this cloud.Provides a Collection ofNetworkTyperelated to this CloudProviderProvides a Collection of OptionType inputs that define the required input fields for defining a cloud integrationdefault ProvisionProvidergetProvisioningProvider(String providerCode) Deprecated.replaced by {getProvisionProvider(String)}getProvisionProvider(String providerCode) Grabs the singleton instance of the provisioning provider based on the code defined in its implementation.default List<ServerStatsData>getServerStats(ComputeServer computeServer, Map<String, Object> opts) Called to retrieve server statistics for a compute server.default Collection<StorageAggregateType>Provides a Collection ofStorageAggregateTyperelated to this CloudProviderProvides a Collection ofStorageControllerTyperelated to this CloudProviderProvides a Collection ofStorageVolumeTyperelated to this CloudProviderProvides a Collection ofNetworkSubnetTyperelated to this CloudProviderdefault Collection<String>A list of supported NetworkProviders that can be used for networking services on this cloudReturns whether a cloud supports bare metal VMsIndicates if the cloud supports cloud-init.Returns whether the cloud supportsComputeZonePooldefault BooleanIndicates whether the cloud provider supports costing functionality.Returns whether a cloud supportsDatastoreReturns whether a cloud supportsComputeZoneFolderdefault BooleanIndicates whether the cloud provider supports native plans.Returns whether a cloud supportsNetworkdefault BooleanIndicates whether the cloud provider supports reservations.default BooleanReturns whether a cloud supportsSecurityGroupinitializeCloud(Cloud cloudInfo) Called when a Cloud From Morpheus is first saved.default BooleanReturns whether the cloud requires a resource pool to be selected for provisioningZones/Clouds are refreshed periodically by the Morpheus Environment.voidrefreshDaily(Cloud cloudInfo) Zones/Clouds are refreshed periodically by the Morpheus Environment.default voidZones/Clouds sometimes need to have a daily sync for all instances of the same type on a daily basis.default ServiceResponse<CloudPool>removeCloudPool(Cloud cloud, CloudPool cloudPool) startServer(ComputeServer computeServer) Called when a server should be started.stopServer(ComputeServer computeServer) Called when a server should be stopped.default BooleanIndicates whether the cloud provider supports agentless metrics collection.Indicates if the cloud supports the distributed worker functionalitydefault BooleanIndicates whether the cloud provider supports orphaned guidance.default ServiceResponse<CloudPool>updateCloudPool(Cloud cloud, CloudPool cloudPool) validate(Cloud cloudInfo, ValidateCloudRequest validateCloudRequest) Validates the submitted cloud information to make sure it is functioning correctly.Methods inherited from interface com.morpheusdata.core.providers.PluginProvider
getCode, getMorpheus, getName, getPlugin
-
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 allComputeServerTypeobjects that this CloudProvider can represent during a sync or during a provision.- Returns:
- collection of ComputeServerType
-
getComputeDeviceTypes
Grabs allComputeDeviceTypeobjects that this CloudProvider can represent during a sync or during a provision.- Returns:
- collection of ComputeDeviceType
- Since:
- 1.2.11
-
getAvailableProvisioningProviders
Deprecated.replaced by {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
-
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.replaced by {getProvisionProvider(String)}Grabs the singleton instance of the provisioning provider based on the code defined in its implementation. Typically Providers are singleton and instanced in thePluginclass- Parameters:
providerCode- String representation of the provider short code- Returns:
- the ProvisionProvider requested
-
getProvisionProvider
Grabs the singleton instance of the provisioning provider based on the code defined in its implementation. Typically Providers are singleton and instanced in thePluginclass- Parameters:
providerCode- String representation of the provider short code- Returns:
- the ProvisionProvider requested
-
getNetworkTypes
Collection<NetworkType> getNetworkTypes()Provides a Collection ofNetworkTyperelated to this CloudProvider- Returns:
- Collection of NetworkType
-
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 ofNetworkSubnetTyperelated to this CloudProvider- Returns:
- Collection of NetworkSubnetType
-
getStorageVolumeTypes
Collection<StorageVolumeType> getStorageVolumeTypes()Provides a Collection ofStorageVolumeTyperelated to this CloudProvider- Returns:
- Collection of StorageVolumeType
-
getStorageControllerTypes
Collection<StorageControllerType> getStorageControllerTypes()Provides a Collection ofStorageControllerTyperelated to this CloudProvider- Returns:
- Collection of StorageControllerType
-
getStorageAggregateTypes
Provides a Collection ofStorageAggregateTyperelated to this CloudProvider- Returns:
- Collection of StorageAggregateType
-
validate
Validates the submitted cloud information to make sure it is functioning correctly. If aServiceResponseis not marked as successful then the validation results will be bubbled up to the user.- Parameters:
cloudInfo- cloudvalidateCloudRequest- Additional validation information- Returns:
- ServiceResponse
-
initializeCloud
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
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
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
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 supportsComputeZonePool- Returns:
- Boolean
-
provisionRequiresResourcePool
Returns whether the cloud requires a resource pool to be selected for provisioning- Returns:
- Boolean
-
hasNetworks
Boolean hasNetworks()Returns whether a cloud supportsNetwork- Returns:
- Boolean
-
hasFolders
Boolean hasFolders()Returns whether a cloud supportsComputeZoneFolder- Returns:
- Boolean
-
hasDatastores
Boolean hasDatastores()Returns whether a cloud supportsDatastore- Returns:
- Boolean
-
hasBareMetal
Boolean hasBareMetal()Returns whether a cloud supports bare metal VMs- Returns:
- Boolean
-
hasSecurityGroups
Returns whether a cloud supportsSecurityGroup- Returns:
- Boolean
-
startServer
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
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
Called when a server should be deleted from the Cloud.- Parameters:
computeServer- server to delete- Returns:
- ServiceResponse
-
getServerStats
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
ServerStatsDataobjects 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 foropts- 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
Specifies whether the current cloud allows the user to create custom pools such as VPCs in AWS or Clusters in Vmware- Returns:
- 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
Specifies whether the current cloud allows the user to create new networks- Returns:
- Boolean
- Since:
- 0.15.12
-
canCreateDatastores
Specifies whether the current cloud allows the user to create new datastores- Returns:
- Boolean
- Since:
- 1.2.6
-
getDefaultProvisionTypeCode
Returns the default provision code for fetching aProvisionProviderfor 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
Returns the default network code for fetching aNetworkProviderfor 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
Returns the default load balancer type code for fetching aLoadBalancerProviderfor 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
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
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
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
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
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
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
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
-
updateCloudPool
-
removeCloudPool
-
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
If the cloud supports IaC based provisioning, return the mapping provider here and implement theProvisionProvider.IacResourceFacetin 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.UsefilterSubnets(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 onservicePlans- The set of available service planscriteria- The criteria for filtering the service plans- Returns:
- the filtered service plans
- Since:
- 1.2.6
-
getCloudClassification
Gets the cloud classification for this provider (e.g., public, private).- Returns:
- cloud classification
- Since:
- 1.2.8
-
getCloudSummary
Gets the cloud summary information to be displayed in the Cloud -> Summary tab. This allows plugins to provide custom summary information including:- Standard info items (label-value pairs) via
CloudSummaryInfoItem - Custom zone summary renderer via
CloudSummaryProvider - Custom costing summary renderer via
CloudCostingSummaryProvider
- Parameters:
cloud- the cloud for which to get the summaryuser- the current user requesting the summary- Returns:
- CloudSummary containing the summary information, or null if not implemented
- Since:
- 1.2.15
- Standard info items (label-value pairs) via
-
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
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
-
filterSubnets(Cloud, Collection, CloudPool)instead.