use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteVpnGatewayCmd method execute.
@Override
public void execute() {
boolean result = false;
result = _s2sVpnService.deleteVpnGateway(this);
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete customer VPN gateway");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class ReleaseDedicatedClusterCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final boolean result = dedicatedService.releaseDedicatedResource(null, null, getClusterId(), null);
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release dedicated cluster");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class ReleaseDedicatedHostCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final boolean result = dedicatedService.releaseDedicatedResource(null, null, null, getHostId());
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release dedicated Host");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class ReleaseDedicatedZoneCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final boolean result = dedicatedService.releaseDedicatedResource(getZoneId(), null, null, null);
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release dedicated zone");
}
}
use of com.cloud.api.response.SuccessResponse in project cosmic by MissionCriticalCloud.
the class DeleteNiciraNvpDeviceCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
final boolean result = niciraNvpElementService.deleteNiciraNvpDevice(this);
if (result) {
final SuccessResponse response = new SuccessResponse(getCommandName());
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete Nicira device.");
}
} catch (final InvalidParameterValueException invalidParamExcp) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
} catch (final CloudRuntimeException runtimeExcp) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
}
}
Aggregations