use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class EnableStaticNatCmd method execute.
@Override
public void execute() throws ResourceUnavailableException {
try {
boolean result = _rulesService.enableStaticNat(ipAddressId, virtualMachineId, false);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable static nat");
}
} catch (NetworkRuleConflictException ex) {
s_logger.info("Network rule conflict: " + ex.getMessage());
s_logger.trace("Network Rule Conflict: ", ex);
throw new ServerApiException(BaseCmd.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage());
}
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class DeleteStorageNetworkIpRangeCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
_storageNetworkService.deleteIpRange(this);
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} catch (Exception e) {
s_logger.warn("Failed to delete storage network ip range " + getId(), e);
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
}
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class DeleteTrafficTypeCmd method execute.
@Override
public void execute() {
boolean result = _networkService.deletePhysicalNetworkTrafficType(getId());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete traffic type");
}
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class DeleteVMGroupCmd method execute.
@Override
public void execute() {
boolean result = _userVmService.deleteVmGroup(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete vm group");
}
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class DeleteVlanIpRangeCmd method execute.
@Override
public void execute() {
boolean result = _configService.deleteVlanIpRange(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete vlan ip range");
}
}
Aggregations