use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class DeleteServiceOfferingCmd method execute.
@Override
public void execute() {
boolean result = _configService.deleteServiceOffering(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete service offering");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class DeletePortableIpRangeCmd method execute.
@Override
public void execute() {
boolean result = _configService.deletePortableIpRange(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete portable ip range");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class RemoveVpnUserCmd method execute.
@Override
public void execute() {
Account owner = _accountService.getAccount(getEntityOwnerId());
boolean result = _ravService.removeVpnUser(owner.getId(), userName, CallContext.current().getCallingAccount());
if (!result) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove vpn user");
}
try {
if (!_ravService.applyVpnUsers(owner.getId(), userName)) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to apply vpn user removal");
}
} catch (Exception ex) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove vpn user due to resource unavailable");
}
SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class DeleteVpnCustomerGatewayCmd method execute.
@Override
public void execute() {
boolean result = _s2sVpnService.deleteCustomerGateway(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete customer VPN gateway");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class DeleteVpnGatewayCmd method execute.
@Override
public void execute() {
boolean result = false;
result = _s2sVpnService.deleteVpnGateway(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete customer VPN gateway");
}
}
Aggregations