mirror of https://github.com/apache/cloudstack.git
bug 8439: changes in service/disk offerings
status 8439: resolved fixed
This commit is contained in:
parent
882de01461
commit
cb5b1e60f3
|
|
@ -24,7 +24,6 @@ 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;
|
||||
|
||||
|
|
@ -46,12 +45,6 @@ public class UpdateDiskOfferingCmd extends BaseCmd{
|
|||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates name of the disk offering with this value")
|
||||
private String diskOfferingName;
|
||||
|
||||
// @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="update tags of the disk offering with this value")
|
||||
// private String tags;
|
||||
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
|
||||
private Long domainId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -68,13 +61,6 @@ public class UpdateDiskOfferingCmd extends BaseCmd{
|
|||
return diskOfferingName;
|
||||
}
|
||||
|
||||
// public String getTags() {
|
||||
// return tags;
|
||||
// }
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
|
|
|
|||
|
|
@ -45,15 +45,6 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the service offering to be updated")
|
||||
private String serviceOfferingName;
|
||||
|
||||
@Parameter(name=ApiConstants.OFFER_HA, type=CommandType.BOOLEAN, description="the HA of the service offering to be updated")
|
||||
private Boolean offerHa;
|
||||
|
||||
// @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for this service offering.")
|
||||
// private String tags;
|
||||
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
|
||||
private Long domainId;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
@ -70,17 +61,7 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
|
|||
return serviceOfferingName;
|
||||
}
|
||||
|
||||
public Boolean getOfferHa() {
|
||||
return offerHa;
|
||||
}
|
||||
|
||||
// public String getTags() {
|
||||
// return tags;
|
||||
// }
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
|
|
|
|||
|
|
@ -1303,10 +1303,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
String displayText = cmd.getDisplayText();
|
||||
Long id = cmd.getId();
|
||||
String name = cmd.getServiceOfferingName();
|
||||
Boolean ha = cmd.getOfferHa();
|
||||
// String tags = cmd.getTags();
|
||||
Long userId = UserContext.current().getCallerUserId();
|
||||
Long domainId = cmd.getDomainId();
|
||||
|
||||
if (userId == null) {
|
||||
userId = Long.valueOf(User.UID_SYSTEM);
|
||||
|
|
@ -1318,7 +1315,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
throw new ServerApiException(BaseCmd.PARAM_ERROR, "unable to find service offering " + id);
|
||||
}
|
||||
|
||||
boolean updateNeeded = (name != null || displayText != null || ha != null || domainId != null);
|
||||
boolean updateNeeded = (name != null || displayText != null);
|
||||
if (!updateNeeded) {
|
||||
return _serviceOfferingDao.findById(id);
|
||||
}
|
||||
|
|
@ -1332,15 +1329,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
if (displayText != null) {
|
||||
offering.setDisplayText(displayText);
|
||||
}
|
||||
|
||||
if (ha != null) {
|
||||
offering.setOfferHA(ha);
|
||||
}
|
||||
|
||||
if (domainId != null){
|
||||
offering.setDomainId(domainId);
|
||||
}
|
||||
|
||||
|
||||
//Note: tag editing commented out for now; keeping the code intact, might need to re-enable in next releases
|
||||
// if (tags != null)
|
||||
// {
|
||||
|
|
@ -1415,8 +1404,6 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
Long diskOfferingId = cmd.getId();
|
||||
String name = cmd.getDiskOfferingName();
|
||||
String displayText = cmd.getDisplayText();
|
||||
// String tags = cmd.getTags();
|
||||
Long domainId = cmd.getDomainId();
|
||||
|
||||
//Check if diskOffering exists
|
||||
DiskOfferingVO diskOfferingHandle = _diskOfferingDao.findById(diskOfferingId);
|
||||
|
|
@ -1440,9 +1427,6 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
diskOffering.setDisplayText(displayText);
|
||||
}
|
||||
|
||||
if (domainId != null){
|
||||
diskOffering.setDomainId(domainId);
|
||||
}
|
||||
|
||||
//Note: tag editing commented out for now;keeping the code intact, might need to re-enable in next releases
|
||||
// if (tags != null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue