Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2336CE9F for ; Sun, 27 May 2012 22:30:50 +0000 (UTC) Received: (qmail 88794 invoked by uid 500); 27 May 2012 22:30:45 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 88681 invoked by uid 500); 27 May 2012 22:30:45 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 87721 invoked by uid 99); 27 May 2012 22:30:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 May 2012 22:30:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5958A1844A; Sun, 27 May 2012 22:30:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ke4qqq@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [43/50] git commit: CS-9919 Support for Nexus Swiches (Cisco Vswitches) Message-Id: <20120527223044.5958A1844A@tyr.zones.apache.org> Date: Sun, 27 May 2012 22:30:44 +0000 (UTC) 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 Authored: Sun May 13 11:25:37 2012 -0700 Committer: Vijayendra Bhamidipati 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 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