You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2014/05/14 22:07:43 UTC

[1/2] git commit: updated refs/heads/master to 8d9bdb1

Repository: cloudstack
Updated Branches:
  refs/heads/master 2ebeec433 -> 8d9bdb19b


CLOUDSTACK-6659: fixed the name for the updateIpAddress API command


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

Branch: refs/heads/master
Commit: 961e2c43bc75cda2d6c46b1f1e581c4b158d3c57
Parents: 2ebeec4
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Tue May 13 14:08:16 2014 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed May 14 12:34:36 2014 -0700

----------------------------------------------------------------------
 .../cloudstack/api/command/user/address/UpdateIPAddrCmd.java       | 2 +-
 client/tomcatconf/commands.properties.in                           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/961e2c43/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java
index 99bb1af..c64b641 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java
@@ -38,7 +38,7 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.network.IpAddress;
 import com.cloud.user.Account;
 
-@APICommand(name = "updatePublicIpAddress", description = "Updates an ip address", responseObject = IPAddressResponse.class,
+@APICommand(name = "updateIpAddress", description = "Updates an ip address", responseObject = IPAddressResponse.class,
  requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class })
 public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd {
     public static final Logger s_logger = Logger.getLogger(UpdateIPAddrCmd.class.getName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/961e2c43/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index d151724..da3fbfc 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -146,7 +146,7 @@ listDedicatedGuestVlanRanges=1
 associateIpAddress=15
 disassociateIpAddress=15
 listPublicIpAddresses=15
-updatePublicIpAddress=15
+updateIpAddress=15
 
 #### firewall commands
 listPortForwardingRules=15


[2/2] git commit: updated refs/heads/master to 8d9bdb1

Posted by al...@apache.org.
CLOUDSTACK-6675: updatePFRule - retrieve network sync object based on the PF rule id that is passed in to the call; not the public ip address


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

Branch: refs/heads/master
Commit: 8d9bdb19b41de3c1f9759afe6c8843c47c0069f1
Parents: 961e2c4
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Wed May 14 12:26:25 2014 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed May 14 12:34:39 2014 -0700

----------------------------------------------------------------------
 .../firewall/UpdatePortForwardingRuleCmd.java   | 32 +++++++++-----------
 1 file changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8d9bdb19/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
index 78525ba..eb4d468 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
@@ -16,8 +16,6 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.firewall;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
@@ -27,10 +25,10 @@ import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.FirewallRuleResponse;
 import org.apache.cloudstack.api.response.IPAddressResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.network.IpAddress;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.PortForwardingRule;
 import com.cloud.user.Account;
@@ -94,10 +92,6 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
         return protocol;
     }
 
-    public Long getPublicIpId() {
-        return publicIpId;
-    }
-
     public String getPublicPort() {
         return publicPort;
     }
@@ -109,11 +103,16 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
     public Boolean getDisplay() {
         return display;
     }
+    public Long getId() {
+        return id;
+    }
 
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////
 
+
+
     @Override
     public String getCommandName() {
         return s_name;
@@ -121,9 +120,9 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
 
     @Override
     public long getEntityOwnerId() {
-        IpAddress addr = _entityMgr.findById(IpAddress.class, getPublicIpId());
-        if (addr != null) {
-            return addr.getAccountId();
+        PortForwardingRule rule = _entityMgr.findById(PortForwardingRule.class, getId());
+        if (rule != null) {
+            return rule.getAccountId();
         }
 
         // bad address given, parent this command to SYSTEM so ERROR events are tracked
@@ -173,14 +172,11 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
 
     @Override
     public Long getSyncObjId() {
-        return getIp().getAssociatedWithNetworkId();
-    }
-
-    private IpAddress getIp() {
-        IpAddress ip = _networkService.getIp(publicIpId);
-        if (ip == null) {
-            throw new InvalidParameterValueException("Unable to find ip address by id " + publicIpId);
+        PortForwardingRule rule = _entityMgr.findById(PortForwardingRule.class, getId());
+        if (rule != null) {
+            return rule.getNetworkId();
+        } else {
+            throw new InvalidParameterValueException("Unable to find the rule by id");
         }
-        return ip;
     }
 }