From fb6310e99388f2a9428c956e965c83a3171a3f33 Mon Sep 17 00:00:00 2001 From: kishan Date: Tue, 4 Jan 2011 13:22:41 +0530 Subject: [PATCH] bug 6947: removed network type from service offering APIs status 6947: resolved fixed --- .../cloud/api/commands/UpdateServiceOfferingCmd.java | 9 --------- .../cloud/api/response/ServiceOfferingResponse.java | 11 ----------- server/src/com/cloud/api/ApiResponseHelper.java | 1 - .../cloud/configuration/ConfigurationManagerImpl.java | 8 +------- 4 files changed, 1 insertion(+), 28 deletions(-) diff --git a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java index 9719cda1028..8f4d80543c2 100644 --- a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java +++ b/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java @@ -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; } diff --git a/api/src/com/cloud/api/response/ServiceOfferingResponse.java b/api/src/com/cloud/api/response/ServiceOfferingResponse.java index cb3e9da7c10..33bf6b70a61 100644 --- a/api/src/com/cloud/api/response/ServiceOfferingResponse.java +++ b/api/src/com/cloud/api/response/ServiceOfferingResponse.java @@ -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; } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index e0f725e7f91..fda5f104447 100644 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -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()); diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 8e2cb91de74..9ee3df281b2 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -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); }