Interface HostProvisionProvider.ResizeV2Facet

Enclosing interface:
HostProvisionProvider

public static interface HostProvisionProvider.ResizeV2Facet
Allows the server to be resized with assistance in core for common concerns like adding/removing models, IPAM, storage and network provider hooks.
Since:
1.2.13
  • Method Details

    • validateResizeServer

      default ServiceResponse<ValidateResizeV2WorkloadResponse> validateResizeServer(ComputeServer server, ResizeV2Request resizeRequest, Map opts)
      Validates the provided resize options of for a server. A return of success = false will halt the resize and display errors.

      Note: this functionality in the UI is called 'Reconfigure'.

      Parameters:
      server - to resize
      resizeRequest - the resize requested parameters
      opts - raw + additional 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. The possible field names are: "networkInterface", "plan", "volume". Each will result in an error for the entire section.

      For example, an invalid configuration in the volumes section could be specified like this:

      
              return ServiceResponse.error('Failed to resize', [volume:'Your error message here.'])
       
      Since:
      1.2.13
    • prepareResizeServer

      default ServiceResponse<PrepareResizeV2WorkloadResponse> prepareResizeServer(ComputeServer server, ResizeV2Request resizeRequest, Map opts)
      Prepares the resize operation.

      This gives the plugin a chance to modify anything about the request before core initiates IPAM, storage provider, and network provider calls.

      Parameters:
      server - to resize
      resizeRequest - The request containing what's to be done in the resize operation
      opts - raw + additional options. This will be passed to each call along in the resize flow and can be used to carry state between calls.
      Returns:
      Response indicating success of operation
    • resizeServer

      ServiceResponse<ResizeV2WorkloadResponse> resizeServer(ComputeServer server, ResizeV2Request resizeRequest, Map opts)
      Request to scale the size of a ComputeServer.

      This is a chance for the plugin to take care of anything host related when adding/updating/deleting the volumes/nics/controllers. Any updates can be persisted into the models. With the return of a successful response, the following will occur:

      • The ServicePlan, memory, cores, coresPerSocket, maxStorage values defined on ResizeRequest will be set on the Workload and ComputeServer
      • Any model deletions specified in the resize request will cleaned up with their respective providers/IPAM and deleted from the database. There is no need for the plugin to make calls to remove them.
      Parameters:
      server - to resize
      resizeRequest - The request containing what's to be done in the resize operation
      opts - raw + additional options.
      Returns:
      Response indicating success of operation