cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject [2/4] git commit: refs/heads/cisco-vnmc-api-integration - List asa api to return guest network if associated. From this it can be inferred if asa is available or not
Date Mon, 04 Mar 2013 05:33:37 GMT
List asa api to return guest network if associated. From this it can be inferred if asa is
available or not


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

Branch: refs/heads/cisco-vnmc-api-integration
Commit: 22e1455142690acd7d5c5faed443cfb263d09dd9
Parents: 3222373
Author: Koushik Das <koushik.das@citrix.com>
Authored: Fri Mar 1 01:19:43 2013 +0530
Committer: Koushik Das <koushik.das@citrix.com>
Committed: Fri Mar 1 01:19:43 2013 +0530

----------------------------------------------------------------------
 .../response/CiscoAsa1000vResourceResponse.java    |   40 +++++++++-----
 .../cloud/network/element/CiscoVnmcElement.java    |   15 +++++-
 2 files changed, 39 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/22e14551/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
index 5425bf9..9cd87da 100755
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/api/response/CiscoAsa1000vResourceResponse.java
@@ -21,6 +21,7 @@ import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.NetworkResponse;
 import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
 
 import com.cloud.network.cisco.CiscoAsa1000vDevice;
@@ -34,28 +35,36 @@ public class CiscoAsa1000vResourceResponse extends BaseResponse {
     private String id;
 
     @SerializedName(ApiConstants.PHYSICAL_NETWORK_ID) 
-    @Parameter(description="the physical network to which this VNMC belongs to", entityType
= PhysicalNetworkResponse.class)
+    @Parameter(description="the physical network to which this ASA 1000v belongs to", entityType
= PhysicalNetworkResponse.class)
     private Long physicalNetworkId ;
 
     public Long getPhysicalNetworkId() {
-		return physicalNetworkId;
-	}
+        return physicalNetworkId;
+    }
 
-	@SerializedName(ApiConstants.HOST_NAME)
-	@Parameter(description="management ip address of ASA 1000v")
+    @SerializedName(ApiConstants.HOST_NAME)
+    @Parameter(description="management ip address of ASA 1000v")
     private String managementIp;
 
-	public String getManagementIp() {
-		return managementIp;
-	}
+    public String getManagementIp() {
+        return managementIp;
+    }
 
-	@SerializedName(ApiConstants.ASA_INSIDE_PORT_PROFILE)
-	@Parameter(description="management ip address of ASA 1000v")
+    @SerializedName(ApiConstants.ASA_INSIDE_PORT_PROFILE)
+    @Parameter(description="management ip address of ASA 1000v")
     private String inPortProfile;
 
-	public String getInPortProfile() {
-		return inPortProfile;
-	}
+    public String getInPortProfile() {
+        return inPortProfile;
+    }
+
+    @SerializedName(ApiConstants.NETWORK_ID)
+    @Parameter(description="the guest network to which ASA 1000v is associated", entityType
= NetworkResponse.class)
+    private Long guestNetworkId;
+
+    public Long getGuestNetworkId() {
+        return guestNetworkId;
+    }
 
     public void setId(String ciscoAsa1000vResourceId) {
         this.id = ciscoAsa1000vResourceId;
@@ -72,5 +81,8 @@ public class CiscoAsa1000vResourceResponse extends BaseResponse {
     public void setInPortProfile(String inPortProfile) {
         this.inPortProfile = inPortProfile;
     }     
-    
+
+    public void setGuestNetworkId(Long guestNetworkId) {
+        this.guestNetworkId = guestNetworkId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/22e14551/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
index 006874b..5805056 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElement.java
@@ -421,8 +421,14 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro
 
     @Override
     public List<Class<?>> getCommands() {
-        // TODO Auto-generated method stub
-        return null;
+        List<Class<?>> cmdList = new ArrayList<Class<?>>();
+        cmdList.add(AddCiscoVnmcResourceCmd.class);
+        cmdList.add(DeleteCiscoVnmcResourceCmd.class);
+        cmdList.add(ListCiscoVnmcResourcesCmd.class);
+        cmdList.add(AddCiscoAsa1000vResourceCmd.class);
+        cmdList.add(DeleteCiscoAsa1000vResourceCmd.class);
+        cmdList.add(ListCiscoAsa1000vResourcesCmd.class);
+        return cmdList;
     }
 
     @Override
@@ -774,6 +780,11 @@ public class CiscoVnmcElement extends AdapterBase implements SourceNatServicePro
         response.setManagementIp(ciscoAsa1000vDeviceVO.getManagementIp());
         response.setInPortProfile(ciscoAsa1000vDeviceVO.getInPortProfile());
 
+        NetworkAsa1000vMapVO networkAsaMap = _networkAsa1000vMapDao.findByAsa1000vId(ciscoAsa1000vDeviceVO.getId());
+        if (networkAsaMap != null) {
+            response.setGuestNetworkId(networkAsaMap.getNetworkId());
+        }
+
         return response;
     }
 


Mime
View raw message