use of com.vmware.photon.controller.model.tasks.ProvisionComputeTaskService.ProvisionComputeTaskState in project photon-model by vmware.
the class AzurePowerServiceTest method kickOffProvisionTask.
private void kickOffProvisionTask() throws Throwable {
ProvisionComputeTaskState provisionTask = new ProvisionComputeTaskState();
provisionTask.computeLink = this.vmState.documentSelfLink;
provisionTask.isMockRequest = this.isMock;
provisionTask.taskSubStage = ProvisionComputeTaskState.SubStage.CREATING_HOST;
provisionTask = TestUtils.doPost(this.host, provisionTask, ProvisionComputeTaskState.class, UriUtils.buildUri(this.host, ProvisionComputeTaskService.FACTORY_LINK));
this.host.waitForFinishedTask(ProvisionComputeTaskState.class, provisionTask.documentSelfLink);
}
use of com.vmware.photon.controller.model.tasks.ProvisionComputeTaskService.ProvisionComputeTaskState in project photon-model by vmware.
the class TestAWSSetupUtils method provisionMachine.
/**
* Provisions a machine for which the state was created.Expects the peerURI for the location of
* the service.
*/
public static ComputeState provisionMachine(VerificationHost host, URI peerURI, ComputeState vmState, boolean isMock, List<String> instancesToCleanUp) throws Throwable, InterruptedException, TimeoutException {
host.log("Provisioning a single virtual machine on AWS.");
// kick off a provision task to do the actual VM creation
ProvisionComputeTaskState provisionTask = new ProvisionComputeTaskService.ProvisionComputeTaskState();
provisionTask.computeLink = vmState.documentSelfLink;
provisionTask.endpointLink = vmState.endpointLink;
provisionTask.isMockRequest = isMock;
provisionTask.taskSubStage = ProvisionComputeTaskState.SubStage.CREATING_HOST;
ProvisionComputeTaskService.ProvisionComputeTaskState outTask = TestUtils.doPost(host, provisionTask, ProvisionComputeTaskState.class, createServiceURI(host, peerURI, ProvisionComputeTaskService.FACTORY_LINK));
host.waitForFinishedTask(ProvisionComputeTaskState.class, outTask.documentSelfLink);
ComputeState provisionCompute = getCompute(host, vmState.documentSelfLink);
assertNotNull(provisionCompute);
host.log("Sucessfully provisioned a machine %s ", provisionCompute.id);
instancesToCleanUp.add(provisionCompute.id);
return provisionCompute;
}
Aggregations