Search in sources :

Example 6 with ServiceOfferingResponse

use of com.cloud.api.response.ServiceOfferingResponse in project cosmic by MissionCriticalCloud.

the class UpdateServiceOfferingCmd method execute.

// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
    // Note
    // Once an offering is created, we cannot update the domainId field (keeping consistent with zones logic)
    final ServiceOffering result = _configService.updateServiceOffering(this);
    if (result != null) {
        final ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } else {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update service offering");
    }
}
Also used : ServiceOfferingResponse(com.cloud.api.response.ServiceOfferingResponse) ServerApiException(com.cloud.api.ServerApiException) ServiceOffering(com.cloud.offering.ServiceOffering)

Aggregations

ServiceOfferingResponse (com.cloud.api.response.ServiceOfferingResponse)6 ServiceOffering (com.cloud.offering.ServiceOffering)5 ServerApiException (com.cloud.api.ServerApiException)4 ListResponse (com.cloud.api.response.ListResponse)1 ArrayList (java.util.ArrayList)1