use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class RemoveFromLoadBalancerRuleCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("Load balancer Id: " + getId() + " VmIds: " + StringUtils.join(getVirtualMachineIds(), ","));
boolean result = _lbService.removeFromLoadBalancer(id, virtualMachineIds);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to remove instance from load balancer rule");
}
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class RemoveVpnUserCmd method execute.
@Override
public void execute() {
Account owner = _accountService.getAccount(getEntityOwnerId());
boolean result = _ravService.removeVpnUser(owner.getId(), userName);
if (!result) {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to remove vpn user");
}
if (!_ravService.applyVpnUsers(owner.getId())) {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to apply vpn user removal");
}
SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class ConfigureSimulator method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
SimulatorManager _simMgr = locator.getManager(SimulatorManager.class);
boolean result = _simMgr.configureSimulator(zoneId, podId, clusterId, hostId, command, values);
if (!result) {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to configure simulator");
}
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
}
Aggregations