mirror of https://github.com/apache/cloudstack.git
CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description: Removing two unexposed APIs that we never use: ConfigureCiscoNexusVSMCmd ListCiscoNexusVSMCmd More changes to follow.
This commit is contained in:
parent
77e914bc0a
commit
02d95e2b97
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
@ -206,12 +204,6 @@ public class CiscoNexusVSMElement extends CiscoNexusVSMDeviceManagerImpl impleme
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CiscoNexusVSMDeviceVO> listCiscoNexusVSMs(ListCiscoNexusVSMCmd cmd) {
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CiscoNexusVSMResponse createCiscoNexusVSMResponse(CiscoNexusVSMDeviceVO vsmDeviceVO) {
|
||||
CiscoNexusVSMResponse response = new CiscoNexusVSMResponse();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -37,13 +35,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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue