mirror of https://github.com/apache/cloudstack.git
CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description: Adding command getCiscoVSMByClusterId to retrieve a VSM associated with a cluster.
This commit is contained in:
parent
8db1ca296b
commit
d933358f10
|
|
@ -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
|
||||
disableCiscoNexusVSM = com.cloud.api.commands.DisableCiscoNexusVSMCmd;7
|
||||
getCiscoVSMByClusterId = com.cloud.api.commands.GetCiscoVSMByClusterIdCmd;7
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -213,6 +215,12 @@ public class CiscoNexusVSMElement extends CiscoNexusVSMDeviceManagerImpl impleme
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CiscoNexusVSMDeviceVO getCiscoNexusVSMByClusId(GetCiscoVSMByClusterIdCmd cmd) {
|
||||
CiscoNexusVSMDeviceVO result = getCiscoVSMbyClusId(cmd.getClusterId());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CiscoNexusVSMDeviceVO> listCiscoNexusVSMs(ListCiscoNexusVSMCmd cmd) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -62,6 +63,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
|
||||
|
|
|
|||
Loading…
Reference in New Issue