use of com.cloud.api.response.DiskOfferingResponse in project CloudStack-archive by CloudStack-extras.
the class UpdateDiskOfferingCmd method execute.
@Override
public void execute() {
DiskOffering result = _configService.updateDiskOffering(this);
if (result != null) {
DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update disk offering");
}
}
use of com.cloud.api.response.DiskOfferingResponse in project CloudStack-archive by CloudStack-extras.
the class CreateDiskOfferingCmd method execute.
@Override
public void execute() {
DiskOffering offering = _configService.createDiskOffering(this);
if (offering != null) {
DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(offering);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create disk offering");
}
}
use of com.cloud.api.response.DiskOfferingResponse in project CloudStack-archive by CloudStack-extras.
the class ListDiskOfferingsCmd method execute.
@Override
public void execute() {
List<? extends DiskOffering> result = _mgr.searchForDiskOfferings(this);
ListResponse<DiskOfferingResponse> response = new ListResponse<DiskOfferingResponse>();
List<DiskOfferingResponse> diskOfferingResponses = new ArrayList<DiskOfferingResponse>();
for (DiskOffering offering : result) {
DiskOfferingResponse diskOffResp = _responseGenerator.createDiskOfferingResponse(offering);
diskOffResp.setObjectName("diskoffering");
diskOfferingResponses.add(diskOffResp);
}
response.setResponses(diskOfferingResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
Aggregations