use of com.vmware.photon.controller.model.tasks.NicSecurityGroupsTaskService.NicSecurityGroupsTaskState in project photon-model by vmware.
the class NicSecurityGroupsTaskService method handleStart.
@Override
public void handleStart(Operation start) {
if (!start.hasBody()) {
start.fail(new IllegalArgumentException("body is required"));
return;
}
NicSecurityGroupsTaskState state = start.getBody(NicSecurityGroupsTaskState.class);
try {
Utils.validateState(getStateDescription(), state);
} catch (Exception e) {
start.fail(e);
return;
}
validateSecurityGroupsEndpoint(state).whenComplete((ignore, e) -> {
if (e != null) {
start.fail(e);
return;
}
state.taskInfo = new TaskState();
state.taskInfo.stage = TaskState.TaskStage.CREATED;
state.taskSubStage = SubStage.CREATED;
start.complete();
// start the task
sendSelfPatch(TaskState.TaskStage.CREATED, null);
});
}
Aggregations