Updated Branches:
  refs/heads/vpc e47b6da60 -> 9e5934260

S2S VPN: Remove obelete guest_ip from updateCustomerGateway


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

Branch: refs/heads/vpc
Commit: 9e59342608657de1ee334677055b024c02cb21d4
Parents: e47b6da
Author: Sheng Yang <[email protected]>
Authored: Mon Jul 30 10:52:57 2012 -0700
Committer: Sheng Yang <[email protected]>
Committed: Mon Jul 30 11:11:11 2012 -0700

----------------------------------------------------------------------
 .../api/commands/UpdateVpnCustomerGatewayCmd.java  |   22 +++++++++-----
 1 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/9e593426/api/src/com/cloud/api/commands/UpdateVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateVpnCustomerGatewayCmd.java 
b/api/src/com/cloud/api/commands/UpdateVpnCustomerGatewayCmd.java
index 9c596b9..4af4c0d 100644
--- a/api/src/com/cloud/api/commands/UpdateVpnCustomerGatewayCmd.java
+++ b/api/src/com/cloud/api/commands/UpdateVpnCustomerGatewayCmd.java
@@ -29,6 +29,7 @@ import 
com.cloud.api.response.Site2SiteCustomerGatewayResponse;
 import com.cloud.event.EventTypes;
 import com.cloud.network.Site2SiteCustomerGateway;
 import com.cloud.user.Account;
+import com.cloud.user.UserContext;
 
 @Implementation(description="Update site to site vpn customer gateway", 
responseObject=Site2SiteCustomerGatewayResponse.class)
 public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd {
@@ -46,9 +47,6 @@ public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd 
{
     @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, 
required=true, description="public ip address id of the customer gateway")
     private String gatewayIp;
 
-    @Parameter(name=ApiConstants.GUEST_IP, type=CommandType.STRING, 
required=true, description="guest ip of the customer gateway")
-    private String guestIp;
-
     @Parameter(name=ApiConstants.CIDR_LIST, type=CommandType.STRING, 
required=true, description="guest cidr of the customer gateway")
     private String guestCidrList;
 
@@ -64,6 +62,14 @@ public class UpdateVpnCustomerGatewayCmd extends 
BaseAsyncCmd {
     @Parameter(name=ApiConstants.LIFETIME, type=CommandType.LONG, 
required=false, description="Lifetime of vpn connection to the customer 
gateway, in seconds")
     private Long lifetime;
 
+    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, 
description="the account associated with the gateway. Must be used with the 
domainId parameter.")
+    private String accountName;
+    
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, 
description="the domain ID associated with the gateway. " +
+               "If used with the account parameter returns the gateway 
associated with the account for the specified domain.")
+    private Long domainId;
+    
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -84,10 +90,6 @@ public class UpdateVpnCustomerGatewayCmd extends 
BaseAsyncCmd {
         return guestCidrList;
     }
 
-    public String getGuestIp() {
-        return guestIp;
-    }
-
     public String getGatewayIp() {
         return gatewayIp;
     }
@@ -116,7 +118,11 @@ public class UpdateVpnCustomerGatewayCmd extends 
BaseAsyncCmd {
 
        @Override
        public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
+        Long accountId = finalyzeAccountId(accountName, domainId, null, true);
+        if (accountId == null) {
+            accountId = UserContext.current().getCaller().getId();
+        }
+        return accountId;
     }
 
        @Override

Reply via email to