Package com.morpheusdata.core.providers
Interface WorkloadProvisionProvider.ResizeFacet
- Enclosing interface:
- WorkloadProvisionProvider
public static interface WorkloadProvisionProvider.ResizeFacet
Allows the workload to be resized
- Since:
- 0.15.3
-
Method Summary
Modifier and TypeMethodDescriptionresizeWorkload(Instance instance, Workload workload, ResizeRequest resizeRequest, Map opts) Request to scale the size of the Workload.validateResizeWorkload(Instance instance, Workload workload, ResizeRequest resizeRequest, Map opts) Validates the provided resize options of an instance's workload.
-
Method Details
-
resizeWorkload
ServiceResponse resizeWorkload(Instance instance, Workload workload, ResizeRequest resizeRequest, 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 resizeworkload- to resizeresizeRequest- the resize requested parametersopts- additional options- Returns:
- Response from API
-
validateResizeWorkload
default ServiceResponse<ValidateResizeWorkloadResponse> validateResizeWorkload(Instance instance, Workload workload, ResizeRequest 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.12
-