3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.switchmanager;
12 import java.net.InetAddress;
13 import java.util.List;
17 import org.opendaylight.controller.sal.core.Node;
18 import org.opendaylight.controller.sal.core.NodeConnector;
19 import org.opendaylight.controller.sal.core.Property;
20 import org.opendaylight.controller.sal.utils.Status;
23 * Primary purpose of this interface is to provide methods for application to
24 * access various system resources and inventory data including nodes, node
25 * connectors and their properties, Layer3 configurations, Span configurations,
26 * node configurations, network device representations viewed by Controller Web
29 public interface ISwitchManager {
31 * Add a subnet configuration
33 * @param configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
34 * @return "Success" or failure reason
36 public Status addSubnet(SubnetConfig configObject);
39 * Remove a subnet configuration
41 * @param configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
42 * @return "Success" or failure reason
44 public Status removeSubnet(SubnetConfig configObject);
47 * Remove a subnet configuration given the name
49 * @param name subnet name
50 * @return "Success" or failure reason
52 public Status removeSubnet(String name);
55 * Return a list of all known devices in the system
57 * @return returns a list of {@link org.opendaylight.controller.switchmanager.Switch}
59 public List<Switch> getNetworkDevices();
62 * Return a list of subnet that were previously configured
64 * @return list of L3 interface {@link org.opendaylight.controller.switchmanager.SubnetConfig} configurations
66 public List<SubnetConfig> getSubnetsConfigList();
69 * Return the subnet configuration
71 * @param subnet subnet
72 * @return a L3 interface {@link org.opendaylight.controller.switchmanager.SubnetConfig} configuration
74 public SubnetConfig getSubnetConfig(String subnet);
77 * Return a subnet configuration given the network address
79 * @param networkAddress the ip address in long format
80 * @return the {@link org.opendaylight.controller.switchmanager.Subnet}
82 public Subnet getSubnetByNetworkAddress(InetAddress networkAddress);
85 * Save the current switch configurations
87 * @return the status code
89 public Status saveSwitchConfig();
92 * Add a span port configuration
94 * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
97 public Status addSpanConfig(SpanConfig configObject);
100 * Remove a span port configuration
102 * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
103 * @return status code
105 public Status removeSpanConfig(SpanConfig cfgObject);
108 * Return a list of span configurations that were configured previously
110 * @return list of {@link org.opendaylight.controller.switchmanager.SpanConfig} resources
112 public List<SpanConfig> getSpanConfigList();
115 * Return the list of span ports of a given node
117 * @param node {@link org.opendaylight.controller.sal.core.Node}
118 * @return the list of span {@link org.opendaylight.controller.sal.core.NodeConnector} of the node
120 public List<NodeConnector> getSpanPorts(Node node);
123 * Update Switch specific configuration such as Switch Name and Tier
125 * @param cfgConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SwitchConfig}
127 * @deprecated replaced by updateNodeConfig(switchConfig)
130 public void updateSwitchConfig(SwitchConfig cfgObject);
133 * Update Node specific configuration such as Node Name and Tier
136 * refer to {@link Open Declaration
137 * org.opendaylight.controller.switchmanager.SwitchConfig}
138 * @return "Success" or failure reason
140 public Status updateNodeConfig(SwitchConfig switchConfig);
143 * Removes node properties configured by the user
146 * Node Identifier as specified by
147 * {@link org.opendaylight.controller.sal.core.Node}
148 * @return "Success" or failure reason
150 public Status removeNodeConfig(String nodeId);
153 * Return the previously configured Switch Configuration given the node id
156 * Node Identifier as specified by
157 * {@link org.opendaylight.controller.sal.core.Node}
158 * @return {@link org.opendaylight.controller.switchmanager.SwitchConfig}
161 public SwitchConfig getSwitchConfig(String nodeId);
164 * Add node connectors to a subnet
166 * @param name The subnet config name
167 * @param nodeConnectors nodePorts string specified by {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
168 * @return "Success" or failure reason
170 public Status addPortsToSubnet(String name, String nodeConnectors);
173 * Remove node connectors from a subnet
175 * @param name the subnet config name
176 * @param nodeConnectors nodePorts string specified by {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
177 * @return "Success" or failure reason
179 public Status removePortsFromSubnet(String name, String nodeConnectors);
182 * Return the set of all the nodes
184 * @return set of {@link org.opendaylight.controller.sal.core.Node}
186 public Set<Node> getNodes();
189 * Return all the properties of a node
191 * @param node {@link org.opendaylight.controller.sal.core.Node}
192 * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
193 * {@link org.opendaylight.controller.sal.core.Description} and/or
194 * {@link org.opendaylight.controller.sal.core.Tier} etc.
196 public Map<String, Property> getNodeProps(Node node);
199 * Return a specific property of a node given the property name
201 * @param node {@link org.opendaylight.controller.sal.core.Node}
202 * @param propName the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
203 * @return {@link org.opendaylight.controller.sal.core.Property}
205 public Property getNodeProp(Node node, String propName);
208 * Set a specific property of a node
210 * @param node {@link org.opendaylight.controller.sal.core.Node}
211 * @param prop {@link org.opendaylight.controller.sal.core.Property}
213 public void setNodeProp(Node node, Property prop);
216 * Remove a property of a node
218 * @param nc {@link org.opendaylight.controller.sal.core.Node}
219 * @param propName the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
220 * @return success or failed reason
222 public Status removeNodeProp(Node node, String propName);
225 * Remove all the properties of a node
227 * @param node {@link org.opendaylight.controller.sal.core.Node}
228 * @return success or failed reason
230 public Status removeNodeAllProps(Node node);
233 * Return all the node connectors in up state for a given node
235 * @param node {@link org.opendaylight.controller.sal.core.Node}
236 * @return set of {@link org.opendaylight.controller.sal.core.NodeConnector}
238 public Set<NodeConnector> getUpNodeConnectors(Node node);
241 * Return all the node connectors including those special ones. Status of each node connector varies.
243 * @param node {@link org.opendaylight.controller.sal.core.Node}
244 * @return all listed {@link org.opendaylight.controller.sal.core.NodeConnector}
246 public Set<NodeConnector> getNodeConnectors(Node node);
249 * Return all the physical node connectors of a node. Status of each node connector varies.
251 * @param node {@link org.opendaylight.controller.sal.core.Node}
252 * @return all physical {@link org.opendaylight.controller.sal.core.NodeConnector}
254 public Set<NodeConnector> getPhysicalNodeConnectors(Node node);
257 * Return all the properties of a node connector
259 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
260 * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
261 * {@link org.opendaylight.controller.sal.core.Description} and/or
262 * {@link org.opendaylight.controller.sal.core.State} etc.
264 public Map<String, Property> getNodeConnectorProps(
265 NodeConnector nodeConnector);
268 * Return a specific property of a node connector given the property name
270 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
271 * @param propName property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
272 * @return {@link org.opendaylight.controller.sal.core.Property}
274 public Property getNodeConnectorProp(NodeConnector nodeConnector,
278 * Add a node connector and its property
280 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
281 * @param prop {@link org.opendaylight.controller.sal.core.Property}
282 * @return success or failed reason
284 public Status addNodeConnectorProp(NodeConnector nodeConnector,
288 * Remove a property of a node connector
290 * @param nc {@link org.opendaylight.controller.sal.core.NodeConnector}
291 * @param propName property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
292 * @return success or failed reason
294 public Status removeNodeConnectorProp(NodeConnector nc, String propName);
297 * Remove all the properties of a node connector
299 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
300 * @return success or failed reason
302 public Status removeNodeConnectorAllProps(NodeConnector nodeConnector);
305 * Return the node connector given its name
307 * @param node {@link org.opendaylight.controller.sal.core.Node}
308 * @param nodeConnectorName node connector identifier specified by {@link org.opendaylight.controller.sal.core.NodeConnector}
309 * @return {@link org.opendaylight.controller.sal.core.NodeConnector}
311 public NodeConnector getNodeConnector(Node node, String nodeConnectorName);
314 * Return whether the specified node connector is a special node port
315 * Example of node's special node connector are software stack, hardware path, controller...
317 * @param p {@link org.opendaylight.controller.sal.core.NodeConnector}
318 * @return true or false
320 public boolean isSpecial(NodeConnector p);
323 * Check if the node connector is up running
325 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
326 * @return true or false
328 public Boolean isNodeConnectorEnabled(NodeConnector nodeConnector);
331 * Return controller MAC address
333 * @return MAC address in byte array
335 public byte[] getControllerMAC();
338 * Return MAC address for a given node
340 * @param node {@link org.opendaylight.controller.sal.core.Node}
341 * @return MAC address in byte array
343 public byte[] getNodeMAC(Node node);
346 * Return true if the host Refresh procedure (by sending ARP request probes
347 * to known hosts) is enabled. By default, the procedure is enabled. This can
348 * be overwritten by OSFI CLI "hostRefresh off".
350 * @return true if it is enabled; false if it's disabled.
352 public boolean isHostRefreshEnabled();
355 * Return host refresh retry count
357 * @return host refresh retry count
359 public int getHostRetryCount();
362 * Create a Name/Tier/Bandwidth Property object based on given property
363 * name and value. Other property types are not supported yet.
365 * @param propName Name of the Property specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
366 * @param propValue Value of the Property specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
367 * @return {@link org.opendaylight.controller.sal.core.Property}
369 public Property createProperty(String propName, String propValue);
372 * Returns the description for the specified node. It is either the one
373 * configured by user or the description advertised by the node.
375 * @param node the network node identifier
376 * @return the description of the specified node. If no description is
377 * configured and the network node does not provide its description,
378 * an empty string is returned.
381 public String getNodeDescription(Node node);