use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class UpdateResourceLimitCmd method execute.
@Override
public void execute() {
ResourceLimit result = _resourceLimitService.updateResourceLimit(finalyzeAccountId(accountName, domainId, projectId, true), getDomainId(), resourceType, max);
if (result != null || (result == null && max != null && max.longValue() == -1L)) {
ResourceLimitResponse response = _responseGenerator.createResourceLimitResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update resource limit");
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class UpdateStorageNetworkIpRangeCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
StorageNetworkIpRange result = _storageNetworkService.updateIpRange(this);
StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} catch (Exception e) {
s_logger.warn("Update storage network IP range failed", e);
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class UpdateStoragePoolCmd method execute.
@Override
public void execute() {
StoragePool result = _storageService.updateStoragePool(this);
if (result != null) {
StoragePoolResponse response = _responseGenerator.createStoragePoolResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update storage pool");
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class UpdateTemplateCmd method execute.
@Override
public void execute() {
VirtualMachineTemplate result = _mgr.updateTemplate(this);
if (result != null) {
TemplateResponse response = _responseGenerator.createIsoResponse(result);
response.setObjectName("template");
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update template");
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class UpdateTrafficTypeCmd method execute.
@Override
public void execute() {
PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel());
if (result != null) {
TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update traffic type");
}
}
Aggregations