Search in sources :

Example 96 with SuccessResponse

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");
    }
}
Also used : SuccessResponse(org.apache.cloudstack.api.response.SuccessResponse) ServerApiException(org.apache.cloudstack.api.ServerApiException)

Example 97 with SuccessResponse

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");
    }
}
Also used : SuccessResponse(org.apache.cloudstack.api.response.SuccessResponse) ServerApiException(org.apache.cloudstack.api.ServerApiException)

Example 98 with SuccessResponse

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()));
}
Also used : SuccessResponse(org.apache.cloudstack.api.response.SuccessResponse)

Example 99 with SuccessResponse

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);
}
Also used : SuccessResponse(org.apache.cloudstack.api.response.SuccessResponse)

Example 100 with SuccessResponse

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);
}
Also used : SuccessResponse(org.apache.cloudstack.api.response.SuccessResponse)

Aggregations

SuccessResponse (org.apache.cloudstack.api.response.SuccessResponse)171 ServerApiException (org.apache.cloudstack.api.ServerApiException)154 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)29 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)28 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)20 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)19 InsufficientCapacityException (com.cloud.exception.InsufficientCapacityException)14 NetworkRuleConflictException (com.cloud.exception.NetworkRuleConflictException)13 ResourceAllocationException (com.cloud.exception.ResourceAllocationException)13 ResourceInUseException (com.cloud.exception.ResourceInUseException)4 Host (com.cloud.host.Host)3 Account (com.cloud.user.Account)3 ArrayList (java.util.ArrayList)3 List (java.util.List)2 EntityExistsException (javax.persistence.EntityExistsException)2 ProjectRole (org.apache.cloudstack.acl.ProjectRole)2 ProjectRolePermission (org.apache.cloudstack.acl.ProjectRolePermission)2 Role (org.apache.cloudstack.acl.Role)2 RolePermission (org.apache.cloudstack.acl.RolePermission)2 Domain (com.cloud.domain.Domain)1