mirror of https://github.com/apache/cloudstack.git
bug 6947: removed network type from service offering APIs
status 6947: resolved fixed
This commit is contained in:
parent
ce3c794bd3
commit
fb6310e993
|
|
@ -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.ServiceOfferingResponse;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
|
||||
|
|
@ -52,9 +51,6 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
|
|||
// @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for this service offering.")
|
||||
// private String tags;
|
||||
|
||||
@Parameter(name=ApiConstants.USE_VIRTUAL_NETWORK, type=CommandType.BOOLEAN, description="if true, the VM created from the offering will use default virtual networking. If false, the VM created will use a direct attached networking model. The default value is true.")
|
||||
private Boolean useVirtualNetwork;
|
||||
|
||||
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
|
||||
private Long domainId;
|
||||
|
||||
|
|
@ -82,11 +78,6 @@ public class UpdateServiceOfferingCmd extends BaseCmd {
|
|||
// return tags;
|
||||
// }
|
||||
|
||||
public Boolean getUseVirtualNetwork() {
|
||||
return useVirtualNetwork;
|
||||
}
|
||||
|
||||
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,9 +51,6 @@ public class ServiceOfferingResponse extends BaseResponse {
|
|||
@SerializedName("offerha") @Param(description="the ha support in the service offering")
|
||||
private Boolean offerHa;
|
||||
|
||||
@SerializedName("usevirtualnetwork") @Param(description="the virtual network for the service offering")
|
||||
private Boolean useVirtualNetwork;
|
||||
|
||||
@SerializedName("tags") @Param(description="the tags for the service offering")
|
||||
private String tags;
|
||||
|
||||
|
|
@ -135,14 +132,6 @@ public class ServiceOfferingResponse extends BaseResponse {
|
|||
this.offerHa = offerHa;
|
||||
}
|
||||
|
||||
public Boolean getUseVirtualNetwork() {
|
||||
return useVirtualNetwork;
|
||||
}
|
||||
|
||||
public void setUseVirtualNetwork(Boolean useVirtualNetwork) {
|
||||
this.useVirtualNetwork = useVirtualNetwork;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -383,7 +383,6 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
offeringResponse.setCreated(offering.getCreated());
|
||||
offeringResponse.setStorageType(offering.getUseLocalStorage() ? "local" : "shared");
|
||||
offeringResponse.setOfferHa(offering.getOfferHA());
|
||||
offeringResponse.setUseVirtualNetwork(offering.getGuestIpType().equals(GuestIpType.Virtual));
|
||||
offeringResponse.setTags(offering.getTags());
|
||||
if(offering.getDomainId() != null){
|
||||
offeringResponse.setDomain(ApiDBUtils.findDomainById(offering.getDomainId()).getName());
|
||||
|
|
|
|||
|
|
@ -1336,7 +1336,6 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
String name = cmd.getServiceOfferingName();
|
||||
Boolean ha = cmd.getOfferHa();
|
||||
// String tags = cmd.getTags();
|
||||
Boolean useVirtualNetwork = cmd.getUseVirtualNetwork();
|
||||
Long userId = UserContext.current().getCallerUserId();
|
||||
Long domainId = cmd.getDomainId();
|
||||
|
||||
|
|
@ -1350,7 +1349,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 || useVirtualNetwork != null || domainId != null);
|
||||
boolean updateNeeded = (name != null || displayText != null || ha != null || domainId != null);
|
||||
if (!updateNeeded) {
|
||||
return _serviceOfferingDao.findById(id);
|
||||
}
|
||||
|
|
@ -1369,11 +1368,6 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
offering.setOfferHA(ha);
|
||||
}
|
||||
|
||||
if (useVirtualNetwork != null) {
|
||||
NetworkOffering.GuestIpType guestIpType = useVirtualNetwork ? NetworkOffering.GuestIpType.Virtual : NetworkOffering.GuestIpType.Direct;
|
||||
offering.setGuestIpType(guestIpType);
|
||||
}
|
||||
|
||||
if (domainId != null){
|
||||
offering.setDomainId(domainId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue