cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke4...@apache.org
Subject [43/50] git commit: CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Date Sun, 27 May 2012 22:30:44 GMT
CS-9919 Support for Nexus Swiches (Cisco Vswitches)

Description:

	Adding command getCiscoVSMByClusterId to
	retrieve a VSM associated with a cluster.


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

Branch: refs/heads/master
Commit: d933358f1062bf9cdb153445a8869cd05262f248
Parents: 8db1ca2
Author: Vijayendra Bhamidipati <vijayendra.bhamidipati@citrix.com>
Authored: Sun May 13 11:25:37 2012 -0700
Committer: Vijayendra Bhamidipati <vijayendra.bhamidipati@citrix.com>
Committed: Fri May 25 17:41:24 2012 -0700

----------------------------------------------------------------------
 .../cisconexusvsm_commands.properties.in           |    3 ++-
 .../network/CiscoNexusVSMDeviceManagerImpl.java    |   12 ++++++++++++
 .../network/element/CiscoNexusVSMElement.java      |    8 ++++++++
 .../element/CiscoNexusVSMElementService.java       |    8 ++++++++
 4 files changed, 30 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d933358f/client/tomcatconf/cisconexusvsm_commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/cisconexusvsm_commands.properties.in b/client/tomcatconf/cisconexusvsm_commands.properties.in
index 05939bb..258f358 100644
--- a/client/tomcatconf/cisconexusvsm_commands.properties.in
+++ b/client/tomcatconf/cisconexusvsm_commands.properties.in
@@ -5,4 +5,5 @@
 addCiscoNexusVSM = com.cloud.api.commands.AddCiscoNexusVSMCmd;7
 deleteCiscoNexusVSM = com.cloud.api.commands.DeleteCiscoNexusVSMCmd;7
 enableCiscoNexusVSM = com.cloud.api.commands.EnableCiscoNexusVSMCmd;7
-disableCiscoNexusVSM = com.cloud.api.commands.DisableCiscoNexusVSMCmd;7
\ No newline at end of file
+disableCiscoNexusVSM = com.cloud.api.commands.DisableCiscoNexusVSMCmd;7
+getCiscoVSMByClusterId = com.cloud.api.commands.GetCiscoVSMByClusterIdCmd;7
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d933358f/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java b/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
index 63512aa..ff8da40 100644
--- a/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java
@@ -303,6 +303,18 @@ public abstract class CiscoNexusVSMDeviceManagerImpl extends AdapterBase
{
         return true;
     }
     
+    @DB
+    public CiscoNexusVSMDeviceVO getCiscoVSMbyClusId(long clusterId) {
+    	ClusterVSMMapVO mapVO = _clusterVSMDao.findByClusterId(clusterId);
+    	if (mapVO == null) {
+    		s_logger.info("Couldn't find a VSM associated with the specified cluster Id");
+    		return null;
+    	}
+    	// Else, pull out the VSM associated with the VSM id in mapVO.
+    	CiscoNexusVSMDeviceVO result = _ciscoNexusVSMDeviceDao.findById(mapVO.getVsmId());
+    	return result;
+    }
+    
     public HostVO createHostVOForConnectedAgent(HostVO host, StartupCommand[] cmd) {
         // TODO Auto-generated method stub
         return null;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d933358f/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/CiscoNexusVSMElement.java b/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
index 870691f..d9e7df2 100644
--- a/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
+++ b/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
@@ -25,6 +25,7 @@ import com.cloud.api.commands.DeleteCiscoNexusVSMCmd;
 import com.cloud.api.commands.ListCiscoNexusVSMCmd;
 import com.cloud.api.commands.EnableCiscoNexusVSMCmd;
 import com.cloud.api.commands.DisableCiscoNexusVSMCmd;
+import com.cloud.api.commands.GetCiscoVSMByClusterIdCmd;
 import com.cloud.api.response.CiscoNexusVSMResponse;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.dao.ConfigurationDao;
@@ -36,6 +37,7 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.host.dao.HostDao;
 import com.cloud.host.dao.HostDetailsDao;
 import com.cloud.network.CiscoNexusVSMDeviceVO;
+import com.cloud.dc.ClusterVSMMapVO;
 import com.cloud.network.CiscoNexusVSMDeviceManagerImpl;
 import com.cloud.network.Network;
 import com.cloud.network.NetworkManager;
@@ -214,6 +216,12 @@ public class CiscoNexusVSMElement extends CiscoNexusVSMDeviceManagerImpl
impleme
     }
 
     @Override
+    public CiscoNexusVSMDeviceVO getCiscoNexusVSMByClusId(GetCiscoVSMByClusterIdCmd cmd)
{
+    	CiscoNexusVSMDeviceVO result = getCiscoVSMbyClusId(cmd.getClusterId());
+    	return result;
+    }
+    
+    @Override
     public List<CiscoNexusVSMDeviceVO> listCiscoNexusVSMs(ListCiscoNexusVSMCmd cmd)
{
     	return null;
     	

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d933358f/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java b/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java
index a9b8676..a0bf1dd 100644
--- a/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java
+++ b/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java
@@ -23,6 +23,7 @@ import com.cloud.api.commands.AddCiscoNexusVSMCmd;
 import com.cloud.api.commands.DeleteCiscoNexusVSMCmd;
 import com.cloud.api.commands.EnableCiscoNexusVSMCmd;
 import com.cloud.api.commands.DisableCiscoNexusVSMCmd;
+import com.cloud.api.commands.GetCiscoVSMByClusterIdCmd;
 import com.cloud.api.commands.ListCiscoNexusVSMCmd;
 import com.cloud.api.response.CiscoNexusVSMResponse;
 import com.cloud.network.CiscoNexusVSMDeviceVO;
@@ -63,6 +64,13 @@ public interface CiscoNexusVSMElementService extends PluggableService {
     public boolean disableCiscoNexusVSM(DisableCiscoNexusVSMCmd cmd);
     
     /**
+     * Returns a VSM associated with a cluster.
+     * @param cmd
+     * @return
+     */
+    public CiscoNexusVSMDeviceVO getCiscoNexusVSMByClusId(GetCiscoVSMByClusterIdCmd cmd);

+    
+    /**
      * creates API response object for Cisco Nexus VSMs
      * @param vsmDeviceVO VSM VO object
      * @return CiscoNexusVSMResponse


Mime
View raw message