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");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class ResetApiLimitCmd method execute.
@Override
public void execute() {
boolean apiLimitEnabled = Boolean.parseBoolean(_configDao.getValue(Config.ApiLimitEnabled.key()));
if (!apiLimitEnabled) {
throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "This api is only available when api.throttling.enabled = true.");
}
boolean result = _apiLimitService.resetApiLimit(this.accountId);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reset api limit counter");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class DeleteLoadBalancerRuleCmd method execute.
@Override
public void execute() {
CallContext.current().setEventDetails("Load balancer ID: " + getId());
boolean result = _firewallService.revokeRelatedFirewallRule(id, true);
result = result && _lbService.deleteLoadBalancerRule(id, true);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete load balancer");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class AssignCertToLoadBalancerCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
//To change body of implemented methods use File | Settings | File Templates.
if (_lbService.assignCertToLoadBalancer(getLbRuleId(), getCertId())) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign certificate to load balancer");
}
}
Aggregations