cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject [41/50] [abbrv] git commit: updated refs/heads/vmware-datamodel to 6a8c2bd
Date Fri, 31 May 2013 07:49:39 GMT
Added networkAclId to listNetworkResponse. Log ACL provider while applying network ACLs


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

Branch: refs/heads/vmware-datamodel
Commit: 3115ddf007ae2eea8b3bd2981638819c29dde549
Parents: 4b8bacd
Author: Kishan Kavala <kishan@cloud.com>
Authored: Thu May 30 16:34:49 2013 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Thu May 30 16:36:21 2013 +0530

----------------------------------------------------------------------
 .../cloudstack/api/response/NetworkResponse.java   |   12 ++++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java    |    7 +++++++
 .../cloud/network/vpc/NetworkACLManagerImpl.java   |    6 ++++++
 3 files changed, 25 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3115ddf0/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
index d6847d5..70c3d79 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
@@ -166,6 +166,10 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
     @SerializedName(ApiConstants.DISPLAY_NETWORK) @Param(description="an optional field,
whether to the display the network to the end user or not.")
     private Boolean displayNetwork;
 
+    @SerializedName(ApiConstants.ACL_ID) @Param(description="ACL Id associated with the VPC
network")
+    private String aclId;
+
+
     public Boolean getDisplayNetwork() {
         return displayNetwork;
     }
@@ -352,4 +356,12 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes
 	public void setIp6Cidr(String ip6Cidr) {
 		this.ip6Cidr = ip6Cidr;
 	}
+
+    public String getAclId() {
+        return aclId;
+    }
+
+    public void setAclId(String aclId) {
+        this.aclId = aclId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3115ddf0/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 89739cf..cf79ff8 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -2489,6 +2489,13 @@ public class ApiResponseHelper implements ResponseGenerator {
         }
         response.setTags(tagResponses);
 
+        if(network.getNetworkACLId() != null){
+            NetworkACL acl = ApiDBUtils.findByNetworkACLId(network.getNetworkACLId());
+            if(acl != null){
+                response.setAclId(acl.getUuid());
+            }
+        }
+
         response.setObjectName("network");
         return response;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3115ddf0/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
index e26dad9..cef6454 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
@@ -376,16 +376,22 @@ public class NetworkACLManagerImpl extends ManagerBase implements NetworkACLMana
     public boolean applyACLItemsToNetwork(long networkId, List<NetworkACLItemVO> rules)
throws ResourceUnavailableException {
         Network network = _networkDao.findById(networkId);
         boolean handled = false;
+        boolean foundProvider = false;
         for (NetworkACLServiceProvider element: _networkAclElements) {
             Network.Provider provider = element.getProvider();
             boolean  isAclProvider = _networkModel.isProviderSupportServiceInNetwork(network.getId(),
Service.NetworkACL, provider);
             if (!isAclProvider) {
                 continue;
             }
+            foundProvider = true;
+            s_logger.debug("Applying NetworkACL for network: "+network.getId()+" with Network
ACL service provider");
             handled = element.applyNetworkACLs(network, rules);
             if (handled)
                 break;
         }
+        if(!foundProvider){
+            s_logger.debug("Unable to find NetworkACL service provider for network: "+network.getId());
+        }
         return handled;
     }
 


Mime
View raw message