use of com.vmware.photon.controller.model.adapterapi.ComputeBootRequest in project photon-model by vmware.
the class ProvisionComputeTaskService method doSubStageBootHost.
private void doSubStageBootHost(ProvisionComputeTaskState updatedState, BootDevice[] bootDevices, ProvisionComputeTaskState.SubStage nextStage) {
CompletionHandler c = (o, e) -> {
if (e != null) {
failTask(e);
return;
}
ComputeBootRequest br = new ComputeBootRequest();
br.resourceReference = UriUtils.extendUri(ClusterUtil.getClusterUri(getHost(), ServiceTypeCluster.INVENTORY_SERVICE), updatedState.computeLink);
for (BootDevice bootDevice : bootDevices) {
br.bootDeviceOrder.add(bootDevice);
}
ServiceDocument subTask = o.getBody(ServiceDocument.class);
br.taskReference = UriUtils.buildUri(this.getHost(), subTask.documentSelfLink);
br.isMockRequest = updatedState.isMockRequest;
sendHostServiceRequest(br, updatedState.bootAdapterReference);
};
// After setting boot order and rebooting, we want the sub-task
// to patch the main task to the "next" state.
createSubTask(c, nextStage, updatedState);
}
Aggregations