CS-9919: Support for Nexus Swiches (Cisco Vswitches)

Description:

	1. Missed replacing older table name for VSMs in a few
	   files (changed the name from
	   external_virtual_switch_management_devices to
	   virtual_supervisor_module). Fixed that in this commit.

	2. Missed adding the new Dao ClusterVSMMapDao in the Dao
	   loading in DefaultComponentLibrary. Fixed.

	3. Fixed wrong searchbuilder options passed to ipaddrSearch
	   in CiscoNexusVSMDeviceDaoImpl.
This commit is contained in:
Vijayendra Bhamidipati 2012-05-02 19:49:11 -07:00
parent a940d962ca
commit 7380f52f12
8 changed files with 18 additions and 15 deletions

View File

@ -21,7 +21,7 @@ public class CiscoNexusVSMResponse extends BaseResponse {
@SerializedName(ApiConstants.EXTERNAL_SWITCH_MGMT_DEVICE_ID) @Param(description="device id of the Cisco N1KV VSM device")
// Do we need a new table name for this? During discussion with Frank, we thought we could just use the host table.
private IdentityProxy id = new IdentityProxy("external_virtual_switch_management_devices");
private IdentityProxy id = new IdentityProxy("virtual_supervisor_module");
// A Cisco n1kv vsm could be plumbed in multiple VLANs.. not sure what a physical network id is, so commenting it
// out for now.

View File

@ -50,7 +50,7 @@ public class AddCiscoNexusVSMCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="external_virtual_switch_management_devices")
@IdentityMapper(entityTableName="virtual_supervisor_module")
@Parameter(name=ApiConstants.IP_ADDRESS, type=CommandType.STRING, required = true, description="IP Address of the Cisco Nexus 1000v VSM appliance.")
private String ipaddr;

View File

@ -54,7 +54,7 @@ public class ConfigureCiscoNexusVSMCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="external_virtual_switch_management_devices")
@IdentityMapper(entityTableName="virtual_supervisor_module")
@Parameter(name=ApiConstants.EXTERNAL_SWITCH_MGMT_DEVICE_ID, type=CommandType.LONG, required=true, description="Cisco Nexus 1000v VSM device ID")
private Long vsmDeviceId;

View File

@ -50,7 +50,7 @@ public class DeleteCiscoNexusVSMCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="external_virtual_switch_management_devices")
@IdentityMapper(entityTableName="virtual_supervisor_module")
@Parameter(name=ApiConstants.EXTERNAL_SWITCH_MGMT_DEVICE_ID, type=CommandType.LONG, required=true, description="Cisco Nexus 1000v VSM device ID")
private Long vsmDeviceId;

View File

@ -73,6 +73,7 @@ import com.cloud.network.StorageNetworkManagerImpl;
import com.cloud.network.dao.ExternalFirewallDeviceDaoImpl;
import com.cloud.network.dao.ExternalLoadBalancerDeviceDaoImpl;
import com.cloud.network.dao.CiscoNexusVSMDeviceDaoImpl;
import com.cloud.dc.dao.ClusterVSMMapDaoImpl;
// TODO - Import the Port Profile Device Dao as well.
import com.cloud.network.dao.FirewallRulesCidrsDaoImpl;
import com.cloud.network.dao.FirewallRulesDaoImpl;
@ -322,6 +323,7 @@ public class DefaultComponentLibrary extends ComponentLibraryBase implements Com
addDao("NetworkExternalFirewallDao", NetworkExternalFirewallDaoImpl.class);
addDao("NetScalerPodDao", NetScalerPodDaoImpl.class);
addDao("CiscoNexusVSMDeviceDao", CiscoNexusVSMDeviceDaoImpl.class);
addDao("ClusterVSMMapDao", ClusterVSMMapDaoImpl.class);
// TODO - Also put in the Port Profile Device Dao here.
addDao("PhysicalNetworkTrafficTypeDao", PhysicalNetworkTrafficTypeDaoImpl.class);
addDao("NetworkServiceMapDao", NetworkServiceMapDaoImpl.class);

View File

@ -15,11 +15,10 @@ package com.cloud.dc.dao;
import java.util.List;
import com.cloud.dc.ClusterVSMMapVO;
import com.cloud.utils.db.GenericDao;
public interface ClusterVSMMapDao extends GenericDao<ClusterVSMMapVO, Long> {
public ClusterVSMMapVO findByClusterId(long clusterId);
public List<ClusterVSMMapVO> listByVSMId(long vsmId);
public boolean removeByVsmId(long vsmId);
}
ClusterVSMMapVO findByClusterId(long clusterId);
List<ClusterVSMMapVO> listByVSMId(long vsmId);
boolean removeByVsmId(long vsmId);
}

View File

@ -13,23 +13,25 @@
package com.cloud.dc.dao;
import java.util.List;
import javax.ejb.Local;
import com.cloud.dc.ClusterVSMMapVO;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.SearchCriteria.Op;
import com.cloud.utils.db.Transaction;
@Local(value=ClusterVSMMapDao.class)
@DB(txn = false)
public class ClusterVSMMapDaoImpl extends GenericDaoBase<ClusterVSMMapVO, Long> implements ClusterVSMMapDao {
protected final SearchBuilder<ClusterVSMMapVO> ClusterSearch;
protected final SearchBuilder<ClusterVSMMapVO> VsmSearch;
final SearchBuilder<ClusterVSMMapVO> ClusterSearch;
final SearchBuilder<ClusterVSMMapVO> VsmSearch;
protected ClusterVSMMapDaoImpl() {
super();
public ClusterVSMMapDaoImpl() {
//super();
ClusterSearch = createSearchBuilder();
ClusterSearch.and("clusterId", ClusterSearch.entity().getClusterId(), SearchCriteria.Op.EQ);

View File

@ -55,7 +55,7 @@ public class CiscoNexusVSMDeviceDaoImpl extends GenericDaoBase<CiscoNexusVSMDevi
nameSearch.done();
ipaddrSearch = createSearchBuilder();
ipaddrSearch.and("vsmIp", nameSearch.entity().getvsmName(), Op.EQ);
ipaddrSearch.and("vsmMgmtIPAddr", ipaddrSearch.entity().getvsmName(), Op.EQ);
ipaddrSearch.done();
// We may add more and conditions by specifying more fields, like say, accountId.