use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class DeleteHostCmd method execute.
@Override
public void execute() {
boolean result = _resourceService.deleteHost(getId(), isForced(), isForceDestoryLocalStorage());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete host");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class ReleaseHostReservationCmd method execute.
@Override
public void execute() {
boolean result = _resourceService.releaseHostReservation(getId());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release host reservation");
}
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class UpdateHostPasswordCmd method execute.
@Override
public void execute() {
if (getClusterId() == null) {
_mgr.updateHostPassword(this);
_resourceService.updateHostPassword(this);
} else {
_mgr.updateClusterPassword(this);
_resourceService.updateClusterPassword(this);
}
setResponseObject(new SuccessResponse(getCommandName()));
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class DisableHAForZoneCmd method setupResponse.
private void setupResponse(final boolean result) {
final SuccessResponse response = new SuccessResponse();
response.setSuccess(result);
response.setResponseName(getCommandName());
response.setObjectName("ha");
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.SuccessResponse in project cloudstack by apache.
the class EnableHAForClusterCmd method setupResponse.
private void setupResponse(final boolean result) {
final SuccessResponse response = new SuccessResponse();
response.setSuccess(result);
response.setResponseName(getCommandName());
response.setObjectName("ha");
setResponseObject(response);
}
Aggregations