use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
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) {
final SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete load balancer");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteSslCertCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
try {
_certService.deleteSslCert(this);
final SuccessResponse rsp = new SuccessResponse();
rsp.setResponseName(getCommandName());
rsp.setObjectName("success");
this.setResponseObject(rsp);
} catch (final Exception e) {
throw new CloudRuntimeException(e);
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteNetworkACLCmd method execute.
@Override
public void execute() throws ResourceUnavailableException {
CallContext.current().setEventDetails("Network ACL item ID: " + id);
final boolean result = _networkACLService.revokeNetworkACLItem(id);
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete network ACL item");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteNetworkACLListCmd method execute.
@Override
public void execute() throws ResourceUnavailableException {
CallContext.current().setEventDetails("Network ACL ID: " + id);
final boolean result = _networkACLService.deleteNetworkACL(id);
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete network ACL");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class RestartNetworkCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException {
final boolean result = _networkService.restartNetwork(this, getCleanup());
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to restart network");
}
}
Aggregations