Package com.morpheusdata.core.providers
Interface WorkloadProvisionProvider.ResizeV2Facet
- Enclosing interface:
- WorkloadProvisionProvider
public static interface WorkloadProvisionProvider.ResizeV2Facet
Allows the workload 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 Summary
Modifier and TypeMethodDescriptionprepareResizeWorkload(Instance instance, Workload workload, ResizeV2Request resizeRequest, Map opts) Prepares the resize operation.resizeWorkload(Instance instance, Workload workload, ResizeV2Request resizeRequest, Map opts) Request to scale the size of the Workload.validateResizeWorkload(Instance instance, Workload workload, ResizeV2Request resizeRequest, Map opts) Validates the provided resize options of an instance's workload.
-
Method Details
-
validateResizeWorkload
default ServiceResponse<ValidateResizeV2WorkloadResponse> validateResizeWorkload(Instance instance, Workload workload, ResizeV2Request resizeRequest, Map opts) Validates the provided resize options of an instance's workload. A return of success = false will halt the resize and display errors.Note: this functionality in the UI is called 'Reconfigure'.
- Parameters:
instance- to resizeworkload- to resizeresizeRequest- the resize requested parametersopts- 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
-
prepareResizeWorkload
default ServiceResponse<PrepareResizeV2WorkloadResponse> prepareResizeWorkload(Instance instance, Workload workload, 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:
instance- The parent instance for the workloadworkload- The workload to resizeresizeRequest- The request containing what's to be done in the resize operationopts- 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
-
resizeWorkload
ServiceResponse<ResizeV2WorkloadResponse> resizeWorkload(Instance instance, Workload workload, ResizeV2Request resizeRequest, Map opts) Request to scale the size of the Workload.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:
instance- The parent instance for the workloadworkload- The workload to resizeresizeRequest- The request containing what's to be done in the resize operationopts- raw + additional options.- Returns:
- Response indicating success of operation
-