some changes to domain specific offerings for the UI to consume

This commit is contained in:
abhishek 2010-12-03 09:37:02 -08:00
parent a8b617c596
commit b0abda3c49
3 changed files with 10 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import com.cloud.api.BaseCmd;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.ServerApiException;
import com.cloud.api.BaseCmd.CommandType;
import com.cloud.api.response.DiskOfferingResponse;
import com.cloud.offering.DiskOffering;
@ -51,6 +52,10 @@ public class CreateDiskOfferingCmd extends BaseCmd {
@Parameter(name=ApiConstants.CUSTOMIZED, type=CommandType.BOOLEAN, description="whether disk offering is custom or not")
private Boolean customized;
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
private Long domainId;
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@ -75,6 +80,9 @@ public class CreateDiskOfferingCmd extends BaseCmd {
return customized;
}
public Long getDomainId(){
return domainId;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////

View File

@ -57,7 +57,7 @@ public class ServiceOfferingResponse extends BaseResponse {
@SerializedName("tags") @Param(description="the tags for the service offering")
private String tags;
@SerializedName("domainId") @Param(description="the domain id of the service offering")
@SerializedName("domainid") @Param(description="the domain id of the service offering")
private Long domainId;
@SerializedName(ApiConstants.DOMAIN) @Param(description="Domain name for the offering")

View File

@ -1284,7 +1284,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
Long numGibibytes = cmd.getDiskSize();
Boolean isCustomized = cmd.isCustomized() != null ? cmd.isCustomized() : false; //false by default
String tags = cmd.getTags();
Long domainId = Long.valueOf(DomainVO.ROOT_DOMAIN); // disk offering always gets created under the root domain.Bug # 6055
Long domainId = cmd.getDomainId() != null ? cmd.getDomainId() : Long.valueOf(DomainVO.ROOT_DOMAIN); // disk offering always gets created under the root domain.Bug # 6055 if not passed in cmd
if(!isCustomized && numGibibytes == null){
throw new InvalidParameterValueException("Disksize is required for non-customized disk offering");