use of com.vmware.photon.controller.model.adapterapi.SubnetInstanceRequest in project photon-model by vmware.
the class ProvisionSubnetTaskService method toReq.
private SubnetInstanceRequest toReq(ProvisionSubnetTaskState taskState) {
SubnetInstanceRequest req = new SubnetInstanceRequest();
req.requestType = taskState.requestType;
req.resourceReference = createInventoryUri(this.getHost(), taskState.subnetLink);
req.taskReference = this.getUri();
req.isMockRequest = taskState.options.contains(TaskOption.IS_MOCK);
return req;
}
use of com.vmware.photon.controller.model.adapterapi.SubnetInstanceRequest in project photon-model by vmware.
the class DvsNetworkService method handlePatch.
@Override
public void handlePatch(Operation op) {
if (!op.hasBody()) {
op.fail(new IllegalArgumentException("body is required"));
return;
}
SubnetInstanceRequest req = op.getBody(SubnetInstanceRequest.class);
if (req.isMockRequest) {
new TaskManager(this, req.taskReference, req.resourceLink()).patchTask(TaskStage.FINISHED);
op.complete();
}
if (req.requestType == InstanceRequestType.CREATE) {
op.complete();
new CreatePortgroupFlow(this, op, req).provisionAsync();
return;
}
if (req.requestType == InstanceRequestType.DELETE) {
op.complete();
new DeletePortgroupFlow(this, op, req).provisionAsync();
return;
}
op.fail(new IllegalArgumentException("bad request type"));
}
Aggregations