Interface ProvisioningProvider

  • All Superinterfaces:
    PluginProvider

    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
      • 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.
      • 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
      • 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
      • runWorkload

        ServiceResponse<WorkloadResponse> runWorkload​(Workload workload,
                                                      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
        opts - additional configuration options that may have been passed during provisioning
        Returns:
        Response from 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
      • 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