diff --git a/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java b/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java index 1fa54340879..d7cb6279b04 100755 --- a/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java +++ b/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java @@ -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/////////////////// ///////////////////////////////////////////////////// diff --git a/api/src/com/cloud/api/response/ServiceOfferingResponse.java b/api/src/com/cloud/api/response/ServiceOfferingResponse.java index 5eb505f6708..cb3e9da7c10 100644 --- a/api/src/com/cloud/api/response/ServiceOfferingResponse.java +++ b/api/src/com/cloud/api/response/ServiceOfferingResponse.java @@ -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") diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 22547a2b5a5..3ae68fee580 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -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");