You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2012/05/28 00:30:43 UTC

[21/50] git commit: CS-9919: Support for Nexus Swiches (Cisco Vswitches)

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

Description:

	Removing two unexposed APIs that we never use:
		ConfigureCiscoNexusVSMCmd
		ListCiscoNexusVSMCmd

	More changes to follow.


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

Branch: refs/heads/master
Commit: 78d40da1bfd546acb33375057f8fcf1661c43f81
Parents: a31aa29
Author: Vijayendra Bhamidipati <vi...@citrix.com>
Authored: Mon May 21 16:49:11 2012 -0700
Committer: Vijayendra Bhamidipati <vi...@citrix.com>
Committed: Fri May 25 18:23:21 2012 -0700

----------------------------------------------------------------------
 .../api/commands/ConfigureCiscoNexusVSMCmd.java    |  117 ---------------
 .../cloud/api/commands/ListCiscoNexusVSMCmd.java   |   99 ------------
 .../network/element/CiscoNexusVSMElement.java      |    8 -
 .../element/CiscoNexusVSMElementService.java       |    9 -
 4 files changed, 0 insertions(+), 233 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d40da1/server/src/com/cloud/api/commands/ConfigureCiscoNexusVSMCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/ConfigureCiscoNexusVSMCmd.java b/server/src/com/cloud/api/commands/ConfigureCiscoNexusVSMCmd.java
deleted file mode 100644
index f210996..0000000
--- a/server/src/com/cloud/api/commands/ConfigureCiscoNexusVSMCmd.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- *  Copyright (C) 2011 Citrix Systems, Inc.  All rights reserved.
- * 
- * This software is licensed under the GNU General Public License v3 or later.
- * 
- * It is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- */
-
-package com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.PlugService;
-import com.cloud.api.ServerApiException;
-//import com.cloud.api.response.NetscalerLoadBalancerResponse;
-import com.cloud.api.response.CiscoNexusVSMResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-//import com.cloud.network.ExternalLoadBalancerDeviceVO;
-import com.cloud.network.CiscoNexusVSMDeviceVO;
-//import com.cloud.network.element.NetscalerLoadBalancerElementService;
-import com.cloud.network.element.CiscoNexusVSMElementService;
-import com.cloud.user.UserContext;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Implementation(responseObject=CiscoNexusVSMResponse.class, description="configures a netscaler load balancer device")
-public class ConfigureCiscoNexusVSMCmd extends BaseAsyncCmd {
-
-    public static final Logger s_logger = Logger.getLogger(ConfigureCiscoNexusVSMCmd.class.getName());
-    private static final String s_name = "configurecisconexusvsmresponse";
-    @PlugService CiscoNexusVSMElementService _ciscoNexusVSMService;
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @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;
-
-    // As of now, not sure what to configure the n1kv VSM device with! So we'll just place a note here to pass in the parameters we'd like to
-    // configure.
-    
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getCiscoNexusVSMDeviceId() {
-        return vsmDeviceId;
-    }
-
-    // We'll define more accessor methods in case we add more parameters above.
-    
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
-    	/**
-        try { 
-            CiscoNexusVSMDeviceVO ciscoNexusVSMDeviceVO = _ciscoNexusVSMService.configureCiscoNexusVSM(this);
-            if (ciscoNexusVSMDeviceVO != null) {
-                CiscoNexusVSMResponse response = _ciscoNexusVSMService.createCiscoNexusVSMResponse(ciscoNexusVSMDeviceVO);
-                response.setObjectName("cisconexusvsm");
-                response.setResponseName(getCommandName());
-                this.setResponseObject(response);
-            } else {
-                throw new ServerApiException(BaseAsyncCmd.INTERNAL_ERROR, "Failed to configure netscaler load balancer due to internal error.");
-            }
-        }  catch (InvalidParameterValueException invalidParamExcp) {
-            throw new ServerApiException(BaseCmd.PARAM_ERROR, invalidParamExcp.getMessage());
-        } catch (CloudRuntimeException runtimeExcp) {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, runtimeExcp.getMessage());
-        } **/
-    }
-
-    @Override
-    public String getEventDescription() {
-        return "Configuring a Cisco Nexus VSM device";
-    }
-
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_EXTERNAL_SWITCH_MGMT_DEVICE_CONFIGURE;
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return UserContext.current().getCaller().getId();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d40da1/server/src/com/cloud/api/commands/ListCiscoNexusVSMCmd.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/commands/ListCiscoNexusVSMCmd.java b/server/src/com/cloud/api/commands/ListCiscoNexusVSMCmd.java
deleted file mode 100644
index 2f45e96..0000000
--- a/server/src/com/cloud/api/commands/ListCiscoNexusVSMCmd.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- *  Copyright (C) 2011 Citrix Systems, Inc.  All rights reserved.
- * 
- * This software is licensed under the GNU General Public License v3 or later.
- * 
- * It is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- * 
- */
-
-package com.cloud.api.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.PlugService;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.CiscoNexusVSMResponse;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.CiscoNexusVSMDeviceVO;
-import com.cloud.network.element.CiscoNexusVSMElementService;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Implementation(responseObject=CiscoNexusVSMResponse.class, description="lists Cisco Nexus 1000v VSM devices")
-public class ListCiscoNexusVSMCmd extends BaseListCmd {
-
-    public static final Logger s_logger = Logger.getLogger(ListCiscoNexusVSMCmd.class.getName());
-    private static final String s_name = "listcisconexusvsmresponse";
-    @PlugService CiscoNexusVSMElementService _ciscoNexusVSMService;
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="external_switch_management_devices")
-    @Parameter(name=ApiConstants.EXTERNAL_SWITCH_MGMT_DEVICE_ID, type=CommandType.LONG,  description="Cisco Nexus 1000v VSM device ID")
-    private Long vsmDeviceId;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getCiscoNexusVSMDeviceId() {
-        return vsmDeviceId;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
-        try {
-            List<CiscoNexusVSMDeviceVO> vsmDevices = _ciscoNexusVSMService.listCiscoNexusVSMs(this);
-            ListResponse<CiscoNexusVSMResponse> response = new ListResponse<CiscoNexusVSMResponse>();
-            List<CiscoNexusVSMResponse> vsmDevicesResponse = new ArrayList<CiscoNexusVSMResponse>();
-
-            if (vsmDevices != null && !vsmDevices.isEmpty()) {
-                for (CiscoNexusVSMDeviceVO vsmDeviceVO : vsmDevices) {
-                	CiscoNexusVSMResponse vsmdeviceResponse = _ciscoNexusVSMService.createCiscoNexusVSMResponse(vsmDeviceVO);
-                    vsmDevicesResponse.add(vsmdeviceResponse);
-                }
-            }
-            response.setResponses(vsmDevicesResponse);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);            
-        }  catch (InvalidParameterValueException invalidParamExcp) {
-            throw new ServerApiException(BaseCmd.PARAM_ERROR, invalidParamExcp.getMessage());
-        } catch (CloudRuntimeException runtimeExcp) {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, runtimeExcp.getMessage());
-        }
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d40da1/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 5bcbb7b..570c82f 100644
--- a/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
+++ b/server/src/com/cloud/network/element/CiscoNexusVSMElement.java
@@ -21,7 +21,6 @@ import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 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;
@@ -37,7 +36,6 @@ 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;
@@ -207,12 +205,6 @@ public class CiscoNexusVSMElement extends CiscoNexusVSMDeviceManagerImpl impleme
     }
     
     @Override
-    public List<CiscoNexusVSMDeviceVO> listCiscoNexusVSMs(ListCiscoNexusVSMCmd cmd) {
-    	return null;
-    	
-    }
-    
-    @Override
     public CiscoNexusVSMResponse createCiscoNexusVSMResponse(CiscoNexusVSMDeviceVO vsmDeviceVO) {    		
             CiscoNexusVSMResponse response = new CiscoNexusVSMResponse();
             response.setId(vsmDeviceVO.getId());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/78d40da1/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 1810c3e..735464a 100644
--- a/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java
+++ b/server/src/com/cloud/network/element/CiscoNexusVSMElementService.java
@@ -18,13 +18,11 @@
 
 package com.cloud.network.element;
 
-import java.util.List;
 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.GetCiscoVSMDetailsCmd;
-import com.cloud.api.commands.ListCiscoNexusVSMCmd;
 import com.cloud.api.response.CiscoNexusVSMResponse;
 import com.cloud.network.CiscoNexusVSMDeviceVO;
 import com.cloud.utils.component.PluggableService;
@@ -38,13 +36,6 @@ public interface CiscoNexusVSMElementService extends PluggableService {
     public boolean deleteCiscoNexusVSM(DeleteCiscoNexusVSMCmd cmd);
 
     /**
-     * lists all the VSMs the Mgmt Server knows of.
-     * @param ListCiscoNexusVSMCmd
-     * @return list of CiscoNexusVSMDeviceVO for the VSMs the mgmt server knows of.
-     */
-    public List<CiscoNexusVSMDeviceVO> listCiscoNexusVSMs(ListCiscoNexusVSMCmd cmd);
-
-    /**
      * Enables a Cisco Nexus VSM. 
      */
     public boolean enableCiscoNexusVSM(EnableCiscoNexusVSMCmd cmd);