cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muralire...@apache.org
Subject [46/50] [abbrv] git commit: updated refs/heads/regionvpc to edf12eb
Date Tue, 11 Mar 2014 14:27:08 GMT
keep zoneid as required param for createVpc


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/df1d86b5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/df1d86b5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/df1d86b5

Branch: refs/heads/regionvpc
Commit: df1d86b57d96f4935f973e447a2436e3ad99632e
Parents: 4192e16
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Tue Jan 28 16:42:53 2014 +0530
Committer: Murali Reddy <muralimmreddy@gmail.com>
Committed: Tue Mar 11 19:52:19 2014 +0530

----------------------------------------------------------------------
 .../org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java | 2 +-
 engine/schema/src/com/cloud/network/vpc/VpcVO.java               | 4 ++--
 server/src/com/cloud/network/vpc/VpcManagerImpl.java             | 4 ----
 server/test/com/cloud/vpc/VpcApiUnitTest.java                    | 2 +-
 server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java                | 4 ++--
 5 files changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df1d86b5/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
index 1eca1d3..4a6606b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
@@ -62,7 +62,7 @@ public class CreateVPCCmd extends BaseAsyncCreateCmd {
     private Long projectId;
 
     @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class,
-               description = "the ID of the availability zone")
+            required = true, description = "the ID of the availability zone")
     private Long zoneId;
 
     @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description
= "the name of the VPC")

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df1d86b5/engine/schema/src/com/cloud/network/vpc/VpcVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/vpc/VpcVO.java b/engine/schema/src/com/cloud/network/vpc/VpcVO.java
index b7da6f1..8d5df36 100644
--- a/engine/schema/src/com/cloud/network/vpc/VpcVO.java
+++ b/engine/schema/src/com/cloud/network/vpc/VpcVO.java
@@ -48,7 +48,7 @@ public class VpcVO implements Vpc {
     String displayText;
 
     @Column(name = "zone_id")
-    Long zoneId;
+    long zoneId;
 
     @Column(name = "cidr")
     private String cidr = null;
@@ -88,7 +88,7 @@ public class VpcVO implements Vpc {
         uuid = UUID.randomUUID().toString();
     }
 
-    public VpcVO(Long zoneId, String name, String displayText, long accountId, long domainId,
long vpcOffId,
+    public VpcVO(long zoneId, String name, String displayText, long accountId, long domainId,
long vpcOffId,
                  String cidr, String networkDomain, boolean regionLevelVpc) {
         this.zoneId = zoneId;
         this.name = name;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df1d86b5/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 28dc03c..1d6fcdb 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -706,10 +706,6 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         }
 
         boolean isRegionLevelVpcOff = vpcOff.offersRegionLevelVPC();
-        if (zoneId == null && !isRegionLevelVpcOff) {
-            throw new InvalidParameterValueException("VPC Offering does not support region
level VPC. So specify zone id in which VPC is to be created");
-        }
-
         if (isRegionLevelVpcOff && networkDomain == null) {
             throw new InvalidParameterValueException("Network domain must be specified for
region level VPC");
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df1d86b5/server/test/com/cloud/vpc/VpcApiUnitTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/VpcApiUnitTest.java b/server/test/com/cloud/vpc/VpcApiUnitTest.java
index 0e927df..5e28374 100644
--- a/server/test/com/cloud/vpc/VpcApiUnitTest.java
+++ b/server/test/com/cloud/vpc/VpcApiUnitTest.java
@@ -85,7 +85,7 @@ public class VpcApiUnitTest extends TestCase {
     public void validateNtwkOffForVpc() {
         //validate network offering
         //1) correct network offering
-        VpcVO vo = new VpcVO(new Long(1), "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc
domain", false);
+        VpcVO vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain",
false);
         boolean result = false;
         try {
             _vpcService.validateNtwkOffForNtwkInVpc(2L, 1, "0.0.0.0", "111-", vo, "10.1.1.1",
new AccountVO(), null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/df1d86b5/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java b/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java
index 4563343..e1a6ac2 100644
--- a/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java
+++ b/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java
@@ -98,9 +98,9 @@ public class MockVpcDaoImpl extends GenericDaoBase<VpcVO, Long> implements
VpcDa
     public VpcVO findById(Long id) {
         VpcVO vo = null;
         if (id.longValue() == 1) {
-            vo = new VpcVO(new Long(1), "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc
domain", false);
+            vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false);
         } else if (id.longValue() == 2) {
-            vo = new VpcVO(new Long(1), "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc
domain", false);
+            vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false);
             vo.setState(State.Inactive);
         }
 


Mime
View raw message