use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class DeleteIpForwardingRuleCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("Rule Id: " + id);
boolean result = _firewallService.revokeRelatedFirewallRule(id, true);
result = result && _rulesService.revokeStaticNatRule(id, true);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete ip forwarding rule");
}
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class DeleteLBStickinessPolicyCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("Load balancer stickiness policy Id: " + getId());
boolean result = _lbService.deleteLBStickinessPolicy(getId(), true);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete load balancer stickiness policy");
}
}
use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.
the class UpdateTemplateOrIsoPermissionsCmd method execute.
@Override
public void execute() {
boolean result = _templateService.updateTemplateOrIsoPermissions(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update template/iso permissions");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class RemoveVpnUserCmd method execute.
@Override
public void execute() {
final Account owner = _accountService.getAccount(getEntityOwnerId());
final boolean result = _ravService.removeVpnUser(owner.getId(), userName, CallContext.current().getCallingAccount());
if (!result) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to remove vpn user");
}
if (!_ravService.applyVpnUsers(owner.getId(), userName)) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to apply vpn user removal");
}
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class ReleaseDedicatedPodCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final boolean result = dedicatedService.releaseDedicatedResource(null, getPodId(), null, null);
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release dedicated pod");
}
}
Aggregations