Search in sources :

Example 16 with SuccessResponse

use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.

the class UpdateHostPasswordCmd method execute.

@Override
public void execute() {
    _mgr.updateHostPassword(this);
    _resourceService.updateHostPassword(this);
    this.setResponseObject(new SuccessResponse(getCommandName()));
}
Also used : SuccessResponse(com.cloud.api.response.SuccessResponse)

Example 17 with SuccessResponse

use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.

the class RestartNetworkCmd method execute.

@Override
public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException {
    boolean result = _networkService.restartNetwork(this, getCleanup());
    if (result) {
        SuccessResponse response = new SuccessResponse(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to restart network");
    }
}
Also used : SuccessResponse(com.cloud.api.response.SuccessResponse) ServerApiException(com.cloud.api.ServerApiException)

Example 18 with SuccessResponse

use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.

the class RevokeSecurityGroupEgressCmd method execute.

@Override
public void execute() {
    boolean result = _securityGroupService.revokeSecurityGroupEgress(this);
    if (result) {
        SuccessResponse response = new SuccessResponse(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to revoke security group egress rule");
    }
}
Also used : SuccessResponse(com.cloud.api.response.SuccessResponse) ServerApiException(com.cloud.api.ServerApiException)

Example 19 with SuccessResponse

use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.

the class DestroyConsoleProxyCmd method execute.

@Override
public void execute() {
    boolean result = _consoleProxyService.destroyConsoleProxy(this);
    if (result) {
        SuccessResponse response = new SuccessResponse(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to destroy console proxy");
    }
}
Also used : SuccessResponse(com.cloud.api.response.SuccessResponse) ServerApiException(com.cloud.api.ServerApiException)

Example 20 with SuccessResponse

use of com.cloud.api.response.SuccessResponse in project CloudStack-archive by CloudStack-extras.

the class DisassociateIPAddrCmd method execute.

@Override
public void execute() throws InsufficientAddressCapacityException {
    UserContext.current().setEventDetails("Ip Id: " + getIpAddressId());
    boolean result = _networkService.disassociateIpAddress(id);
    if (result) {
        SuccessResponse response = new SuccessResponse(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to disassociate ip address");
    }
}
Also used : SuccessResponse(com.cloud.api.response.SuccessResponse) ServerApiException(com.cloud.api.ServerApiException)

Aggregations

SuccessResponse (com.cloud.api.response.SuccessResponse)48 ServerApiException (com.cloud.api.ServerApiException)46 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)2 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)2 SimulatorManager (com.cloud.agent.manager.SimulatorManager)1 InsufficientCapacityException (com.cloud.exception.InsufficientCapacityException)1 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 NetworkRuleConflictException (com.cloud.exception.NetworkRuleConflictException)1 ResourceAllocationException (com.cloud.exception.ResourceAllocationException)1 ResourceInUseException (com.cloud.exception.ResourceInUseException)1 StoragePool (com.cloud.storage.StoragePool)1 Account (com.cloud.user.Account)1 ComponentLocator (com.cloud.utils.component.ComponentLocator)1