Interface ProvisioningProvider

  • All Superinterfaces:
    PluginProvider
    All Known Implementing Classes:
    AbstractProvisionProvider

    public interface ProvisioningProvider
    extends PluginProvider
    Provides methods for interacting with the provisioning engine of Morpheus. This is akin to dealing with requests made from "Add Instance" or from Application Blueprints
    Since:
    0.8.0
    • Method Detail

      • getOptionTypes

        java.util.Collection<OptionType> getOptionTypes()
        Provides a Collection of OptionType inputs that need to be made available to various provisioning Wizards
        Returns:
        Collection of OptionTypes
      • getNodeOptionTypes

        java.util.Collection<OptionType> getNodeOptionTypes()
        Provides a Collection of OptionType inputs for configuring node types
        Returns:
        Collection of OptionTypes
        Since:
        0.9.0
      • getRootVolumeStorageTypes

        java.util.Collection<StorageVolumeType> getRootVolumeStorageTypes()
        Provides a Collection of StorageVolumeTypes that are available for root StorageVolumes
        Returns:
        Collection of StorageVolumeTypes
      • getDataVolumeStorageTypes

        java.util.Collection<StorageVolumeType> getDataVolumeStorageTypes()
        Provides a Collection of StorageVolumeTypes that are available for data StorageVolumes
        Returns:
        Collection of StorageVolumeTypes
      • getServicePlans

        java.util.Collection<ServicePlan> getServicePlans()
        Provides a Collection of $ServicePlan related to this ProvisioningProvider
        Returns:
        Collection of ServicePlan
      • hasDatastores

        java.lang.Boolean hasDatastores()
        Determines if this provision type has datastores that can be selected or not.
        Returns:
        Boolean representation of whether or not this provision type has datastores
      • hasNetworks

        java.lang.Boolean hasNetworks()
        Determines if this provision type has networks that can be selected or not.
        Returns:
        Boolean representation of whether or not this provision type has datastores
      • hasPlanTagMatch

        java.lang.Boolean hasPlanTagMatch()
        Determines if this provision type supports service plans that expose the tag match property.
        Returns:
        Boolean representation of whether or not service plans expose the tag match property.
      • hasComputeZonePools

        java.lang.Boolean hasComputeZonePools()
        Determines if this provision type has ComputeZonePools that can be selected or not.
        Returns:
        Boolean representation of whether or not this provision type has ComputeZonePools
      • computeZonePoolRequired

        java.lang.Boolean computeZonePoolRequired()
        Indicates if a ComputeZonePool is required during provisioning
        Returns:
        Boolean
      • canAddVolumes

        java.lang.Boolean canAddVolumes()
        Indicates if volumes may be added during provisioning
        Returns:
        Boolean
      • canCustomizeRootVolume

        java.lang.Boolean canCustomizeRootVolume()
        Indicates if the root volume may be customized during provisioning. For example, the size changed
        Returns:
        Boolean
      • disableRootDatastore

        java.lang.Boolean disableRootDatastore()
        Indicates if a Datastore on a root volume on a ComputeServer is configurable
        Returns:
        Boolean
      • hasConfigurableSockets

        java.lang.Boolean hasConfigurableSockets()
        Indicates if the sockets are configurable when deploying a ComputeServer via a custom plan
        Returns:
        Boolean
      • canCustomizeDataVolumes

        java.lang.Boolean canCustomizeDataVolumes()
        Indicates if data volumes may be customized during provisioning. For example, the size changed
        Returns:
        Boolean
      • canResizeRootVolume

        java.lang.Boolean canResizeRootVolume()
        Indicates if the root volume may be resized
        Returns:
        Boolean
      • canReconfigureNetwork

        java.lang.Boolean canReconfigureNetwork()
        Indicates if the network can be changed
        Returns:
        Boolean
      • hasStorageControllers

        java.lang.Boolean hasStorageControllers()
        Indicates if StorageControllers are utilized
        Returns:
        Boolean
      • supportsAutoDatastore

        java.lang.Boolean supportsAutoDatastore()
        Indicates if automatic Datastore selection is supported
        Returns:
        Boolean
      • networksScopedToPools

        java.lang.Boolean networksScopedToPools()
        Indicates if Network selection should be scoped to the ComputeZonePool selected during provisioning
        Returns:
        Boolean
      • getMaxNetworks

        java.lang.Integer getMaxNetworks()
        Returns the maximum number of network interfaces that can be chosen when provisioning with this type
        Returns:
        maximum number of networks or 0,null if unlimited.
      • validateWorkload

        ServiceResponse validateWorkload​(java.util.Map opts)
        Validates the provided provisioning options of a workload. A return of success = false will halt the creation and display errors
        Parameters:
        opts - options
        Returns:
        Response from API. Errors should be returned in the errors Map with the key being the field name and the error message as the value.
      • validateInstance

        ServiceResponse validateInstance​(Instance instance,
                                         java.util.Map opts)
        Validate the provided provisioning options for an Instance. A return of success = false will halt the creation and display errors
        Parameters:
        instance - the Instance to validate
        opts - options
        Returns:
        Response from API
      • validateDockerHost

        ServiceResponse validateDockerHost​(ComputeServer server,
                                           java.util.Map opts)
        Validate the provided provisioning options for a Docker host server. A return of success = false will halt the creation and display errors
        Parameters:
        server - the ComputeServer to validate
        opts - options
        Returns:
        Response from API
      • prepareWorkload

        ServiceResponse prepareWorkload​(Workload workload,
                                        WorkloadRequest workloadRequest,
                                        java.util.Map opts)
        This method is called before runWorkload and provides an opportunity to perform action or obtain configuration that will be needed in runWorkload. At the end of this method, if deploying a ComputeServer with a VirtualImage, the sourceImage on ComputeServer should be determined and saved.
        Parameters:
        workload - the Workload object we intend to provision along with some of the associated data needed to determine how best to provision the workload
        workloadRequest - the RunWorkloadRequest object containing the various configurations that may be needed in running the Workload. This will be passed along into runWorkload
        opts - additional configuration options that may have been passed during provisioning
        Returns:
        Response from API
      • runWorkload

        ServiceResponse<WorkloadResponse> runWorkload​(Workload workload,
                                                      WorkloadRequest workloadRequest,
                                                      java.util.Map opts)
        This method is a key entry point in provisioning a workload. This could be a vm, a container, or something else. Information associated with the passed Workload object is used to kick off the workload provision request
        Parameters:
        workload - the Workload object we intend to provision along with some of the associated data needed to determine how best to provision the workload
        workloadRequest - the RunWorkloadRequest object containing the various configurations that may be needed in running the Workload
        opts - additional configuration options that may have been passed during provisioning
        Returns:
        Response from API
      • finalizeWorkload

        ServiceResponse finalizeWorkload​(Workload workload)
        This method is called after successful completion of runWorkload and provides an opportunity to perform some final actions during the provisioning process. For example, ejected CDs, cleanup actions, etc
        Parameters:
        workload - the Workload object that has been provisioned
        Returns:
        Response from the API
      • stopWorkload

        ServiceResponse stopWorkload​(Workload workload)
        Issues the remote calls necessary top stop a workload element from running.
        Parameters:
        workload - the Workload we want to shut down
        Returns:
        Response from API
      • startWorkload

        ServiceResponse startWorkload​(Workload workload)
        Issues the remote calls necessary to start a workload element for running.
        Parameters:
        workload - the Workload we want to start up.
        Returns:
        Response from API
      • prepareHost

        ServiceResponse prepareHost​(ComputeServer server,
                                    HostRequest hostRequest,
                                    java.util.Map opts)
        This method is called before runHost and provides an opportunity to perform action or obtain configuration that will be needed in runHost. At the end of this method, if deploying a ComputeServer with a VirtualImage, the sourceImage on ComputeServer should be determined and saved.
        Parameters:
        server - the ComputeServer object we intend to provision along with some of the associated data needed to determine how best to provision the server
        hostRequest - the HostRequest object containing the various configurations that may be needed in running the server. This will be passed along into runHost
        opts - additional configuration options that may have been passed during provisioning
        Returns:
        Response from API
      • runHost

        ServiceResponse<HostResponse> runHost​(ComputeServer server,
                                              HostRequest hostRequest,
                                              java.util.Map opts)
        This method is called to provision a Host (i.e. Docker host). Information associated with the passed ComputeServer object is used to kick off the provision request. Implementations of this method should populate HostResponse as complete as possible and as quickly as possible. Implementations may choose to save the externalId on the ComputeServer or pass it back in HostResponse.
        Parameters:
        server - the ComputeServer object we intend to provision along with some of the associated data needed to determine how best to provision the server
        hostRequest - the HostRequest object containing the various configurations that may be needed in running the server.
        opts - additional configuration options that may have been passed during provisioning
        Returns:
        Response from API
      • waitForHost

        ServiceResponse<HostResponse> waitForHost​(ComputeServer server)
        This method is called after runHost returns successfully and provides implementations a mechanism to wait for the ComputeServer to finish the creation process in the underlying Cloud. HostResponse should be filled out as complete as possible.
        Parameters:
        server - the ComputeServer object to wait for
        Returns:
      • finalizeHost

        ServiceResponse finalizeHost​(ComputeServer server)
        This method is called after successful completion of runHost and successful completion of waitForHost and provides an opportunity to perform some final actions during the provisioning process. For example, ejected CDs, cleanup actions, etc
        Parameters:
        server - the ComputeServer object that has been provisioned
        Returns:
        Response from the API
      • stopServer

        ServiceResponse stopServer​(ComputeServer computeServer)
        Stop the server
        Parameters:
        computeServer - to stop
        Returns:
        Response from API
      • startServer

        ServiceResponse startServer​(ComputeServer computeServer)
        Start the server
        Parameters:
        computeServer - to start
        Returns:
        Response from API
      • restartWorkload

        ServiceResponse restartWorkload​(Workload workload)
        Issues the remote calls to restart a workload element. In some cases this is just a simple alias call to do a stop/start, however, in some cases cloud providers provide a direct restart call which may be preferred for speed.
        Parameters:
        workload - the Workload we want to restart.
        Returns:
        Response from API
      • removeWorkload

        ServiceResponse removeWorkload​(Workload workload,
                                       java.util.Map opts)
        This is the key method called to destroy / remove a workload. This should make the remote calls necessary to remove any assets associated with the workload.
        Parameters:
        workload - to remove
        opts - map of options
        Returns:
        Response from API
      • getServerDetails

        ServiceResponse<WorkloadResponse> getServerDetails​(ComputeServer server)
        Method called after a successful call to runWorkload to obtain the details of the ComputeServer. Implementations should not return until the server is successfully created in the underlying cloud or the server fails to create.
        Parameters:
        server - to check status
        Returns:
        Response from API. The publicIp and privateIp set on the WorkloadResponse will be utilized to update the ComputeServer
      • resizeWorkload

        ServiceResponse resizeWorkload​(Instance instance,
                                       Workload workload,
                                       ResizeRequest resizeRequest,
                                       java.util.Map opts)
        Request to scale the size of the Workload. Most likely, the implementation will follow that of resizeServer as the Workload usually references a ComputeServer. It is up to implementations to create the volumes, set the memory, etc on the underlying ComputeServer in the cloud environment. In addition, implementations of this method should add, remove, and update the StorageVolumes, StorageControllers, ComputeServerInterface in the cloud environment with the requested attributes and then save these attributes on the models in Morpheus. This requires adding, removing, and saving the various models to the ComputeServer using the appropriate contexts. The ServicePlan, memory, cores, coresPerSocket, maxStorage values defined on ResizeRequest will be set on the Workload and ComputeServer upon return of a successful ServiceResponse
        Parameters:
        instance - to resize
        workload - to resize
        resizeRequest - the resize requested parameters
        opts - additional options
        Returns:
        Response from API
      • resizeServer

        ServiceResponse resizeServer​(ComputeServer server,
                                     ResizeRequest resizeRequest,
                                     java.util.Map opts)
        Request to scale the size of the ComputeServer. It is up to implementations to create the volumes, set the memory, etc on the underlying ComputeServer in the cloud environment. In addition, implementations of this method should add, remove, and update the StorageVolumes, StorageControllers, ComputeServerInterface in the cloud environment with the requested attributes and then save these attributes on the models in Morpheus. This requires adding, removing, and saving the various models to the ComputeServer using the appropriate contexts. The ServicePlan, memory, cores, coresPerSocket, maxStorage values defined on ResizeRequest will be set on the ComputeServer upon return of a successful ServiceResponse
        Parameters:
        server - to resize
        resizeRequest - the resize requested parameters
        opts - additional options
        Returns:
        Response from the API
      • createWorkloadResources

        ServiceResponse createWorkloadResources​(Workload workload,
                                                java.util.Map opts)
        Method called before runWorkload to allow implementers to create resources required before runWorkload is called
        Parameters:
        workload - that will be provisioned
        opts - additional options
        Returns:
        Response from API
      • getHostType

        HostType getHostType()
        Returns the host type that is to be provisioned
        Returns:
        HostType
      • getVirtualImages

        java.util.Collection<VirtualImage> getVirtualImages()
        Provides a Collection of VirtualImage related to this ProvisioningProvider. This provides a way to specify known VirtualImages in the Cloud environment prior to a typical 'refresh' on a Cloud. These are often used in predefined layouts. For example, when building up ComputeTypeLayouts via the MorpheusComputeTypeLayoutFactoryService
        Returns:
        Collection of VirtualImage
      • getComputeTypeLayouts

        java.util.Collection<ComputeTypeLayout> getComputeTypeLayouts()
        Provides a Collection of ComputeTypeLayout related to this ProvisioningProvider. These define the types of clusters that are exposed for this ProvisioningProvider. ComputeTypeLayouts have a collection of ComputeTypeSets, which reference a ContainerType. When returning this structure from implementations, it is often helpful to start with the ComputeTypeLayoutFactory to construct the default structure and modify fields as needed.
        Returns:
        Collection of ComputeTypeLayout