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 the Status object representing the result of the request
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 the Status object representing the result of the request
44 public Status removeSubnet(SubnetConfig configObject);
47 * Modify a subnet configuration
49 * @param configObject refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SubnetConfig}
50 * @return the Status object representing the result of the request
52 public Status modifySubnet(SubnetConfig configObject);
55 * Remove a subnet configuration given the name
57 * @param name subnet name
58 * @return "Success" or failure reason
60 public Status removeSubnet(String name);
63 * Return a list of all known devices in the system
65 * @return returns a list of {@link org.opendaylight.controller.switchmanager.Switch}
67 public List<Switch> getNetworkDevices();
70 * Return a list of subnet that were previously configured
72 * @return list of L3 interface {@link org.opendaylight.controller.switchmanager.SubnetConfig} configurations
74 public List<SubnetConfig> getSubnetsConfigList();
77 * Return the subnet configuration
79 * @param subnet subnet
80 * @return a L3 interface {@link org.opendaylight.controller.switchmanager.SubnetConfig} configuration
82 public SubnetConfig getSubnetConfig(String subnet);
85 * Return a subnet configuration given the network address
87 * @param networkAddress the ip address in long format
88 * @return the {@link org.opendaylight.controller.switchmanager.Subnet}
90 public Subnet getSubnetByNetworkAddress(InetAddress networkAddress);
93 * Save the current switch configurations
95 * @return the status code
97 public Status saveSwitchConfig();
100 * Add a span port configuration
102 * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
103 * @return status code
105 public Status addSpanConfig(SpanConfig configObject);
108 * Remove a span port configuration
110 * @param SpanConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SpanConfig}
111 * @return status code
113 public Status removeSpanConfig(SpanConfig cfgObject);
116 * Return a list of span configurations that were configured previously
118 * @return list of {@link org.opendaylight.controller.switchmanager.SpanConfig} resources
120 public List<SpanConfig> getSpanConfigList();
123 * Return the list of span ports of a given node
125 * @param node {@link org.opendaylight.controller.sal.core.Node}
126 * @return the list of span {@link org.opendaylight.controller.sal.core.NodeConnector} of the node
128 public List<NodeConnector> getSpanPorts(Node node);
131 * Update Switch specific configuration such as Switch Name and Tier
133 * @param cfgConfig refer to {@link Open Declaration org.opendaylight.controller.switchmanager.SwitchConfig}
135 * @deprecated replaced by updateNodeConfig(switchConfig)
138 public void updateSwitchConfig(SwitchConfig cfgObject);
141 * Update Node specific configuration such as Node Name and Tier
144 * refer to {@link Open Declaration
145 * org.opendaylight.controller.switchmanager.SwitchConfig}
146 * @return "Success" or failure reason
148 public Status updateNodeConfig(SwitchConfig switchConfig);
151 * Removes node properties configured by the user
154 * Node Identifier as specified by
155 * {@link org.opendaylight.controller.sal.core.Node}
156 * @return "Success" or failure reason
158 public Status removeNodeConfig(String nodeId);
161 * Return the previously configured Switch Configuration given the node id
164 * Node Identifier as specified by
165 * {@link org.opendaylight.controller.sal.core.Node}
166 * @return {@link org.opendaylight.controller.switchmanager.SwitchConfig}
169 public SwitchConfig getSwitchConfig(String nodeId);
172 * Add node connectors to a subnet
174 * @param name The configured subnet name
175 * @param nodeConnectors list of string each representing a node connector as specified by {@link Open Declaration org.opendaylight.controller.sal.core.NodeConnector}
176 * @return The Status object indicating the result of this request
178 public Status addPortsToSubnet(String name, List<String> nodeConnectors);
181 * Remove node connectors from a subnet
183 * @param name the configured subnet name
184 * @param nodeConnectors list of string each representing a node connector as specified by {@link Open Declaration org.opendaylight.controller.sal.core.NodeConnector}
185 * @return The Status object indicating the result of this request
187 public Status removePortsFromSubnet(String name, List<String> nodeConnectors);
190 * Return the set of all the nodes
192 * @return set of {@link org.opendaylight.controller.sal.core.Node}
194 public Set<Node> getNodes();
197 * Return all the properties of a node
199 * @param node {@link org.opendaylight.controller.sal.core.Node}
200 * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
201 * {@link org.opendaylight.controller.sal.core.Description} and/or
202 * {@link org.opendaylight.controller.sal.core.Tier} etc.
204 public Map<String, Property> getNodeProps(Node node);
207 * Return a specific property of a node given the property name
209 * @param node {@link org.opendaylight.controller.sal.core.Node}
210 * @param propName the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
211 * @return {@link org.opendaylight.controller.sal.core.Property}
213 public Property getNodeProp(Node node, String propName);
216 * Set a specific property of a node
218 * @param node {@link org.opendaylight.controller.sal.core.Node}
219 * @param prop {@link org.opendaylight.controller.sal.core.Property}
221 public void setNodeProp(Node node, Property prop);
224 * Remove a property of a node
226 * @param nc {@link org.opendaylight.controller.sal.core.Node}
227 * @param propName the property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
228 * @return success or failed reason
230 public Status removeNodeProp(Node node, String propName);
233 * Remove all the properties of a node
235 * @param node {@link org.opendaylight.controller.sal.core.Node}
236 * @return success or failed reason
238 public Status removeNodeAllProps(Node node);
241 * Return all the node connectors in up state for a given node
243 * @param node {@link org.opendaylight.controller.sal.core.Node}
244 * @return set of {@link org.opendaylight.controller.sal.core.NodeConnector}
246 public Set<NodeConnector> getUpNodeConnectors(Node node);
249 * Return all the node connectors including those special ones. Status of each node connector varies.
251 * @param node {@link org.opendaylight.controller.sal.core.Node}
252 * @return all listed {@link org.opendaylight.controller.sal.core.NodeConnector}
254 public Set<NodeConnector> getNodeConnectors(Node node);
257 * Return all the physical node connectors of a node. Status of each node connector varies.
259 * @param node {@link org.opendaylight.controller.sal.core.Node}
260 * @return all physical {@link org.opendaylight.controller.sal.core.NodeConnector}
262 public Set<NodeConnector> getPhysicalNodeConnectors(Node node);
265 * Return all the properties of a node connector
267 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
268 * @return map of {@link org.opendaylight.controller.sal.core.Property} such as
269 * {@link org.opendaylight.controller.sal.core.Description} and/or
270 * {@link org.opendaylight.controller.sal.core.State} etc.
272 public Map<String, Property> getNodeConnectorProps(
273 NodeConnector nodeConnector);
276 * Return a specific property of a node connector given the property name
278 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
279 * @param propName property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
280 * @return {@link org.opendaylight.controller.sal.core.Property}
282 public Property getNodeConnectorProp(NodeConnector nodeConnector,
286 * Add a node connector and its property
288 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
289 * @param prop {@link org.opendaylight.controller.sal.core.Property}
290 * @return success or failed reason
292 public Status addNodeConnectorProp(NodeConnector nodeConnector,
296 * Remove a property of a node connector
298 * @param nc {@link org.opendaylight.controller.sal.core.NodeConnector}
299 * @param propName property name specified by {@link org.opendaylight.controller.sal.core.Property} and its extended classes
300 * @return success or failed reason
302 public Status removeNodeConnectorProp(NodeConnector nc, String propName);
305 * Remove all the properties of a node connector
307 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
308 * @return success or failed reason
310 public Status removeNodeConnectorAllProps(NodeConnector nodeConnector);
313 * Return the node connector given its name
315 * @param node {@link org.opendaylight.controller.sal.core.Node}
316 * @param nodeConnectorName node connector identifier specified by {@link org.opendaylight.controller.sal.core.NodeConnector}
317 * @return {@link org.opendaylight.controller.sal.core.NodeConnector}
319 public NodeConnector getNodeConnector(Node node, String nodeConnectorName);
322 * Return whether the specified node connector is a special node port
323 * Example of node's special node connector are software stack, hardware path, controller...
325 * @param p {@link org.opendaylight.controller.sal.core.NodeConnector}
326 * @return true or false
328 public boolean isSpecial(NodeConnector p);
331 * Check if the node connector is up running
333 * @param nodeConnector {@link org.opendaylight.controller.sal.core.NodeConnector}
334 * @return true or false
336 public Boolean isNodeConnectorEnabled(NodeConnector nodeConnector);
339 * Test whether the given node connector exists.
341 * @param nc {@link org.opendaylight.controller.sal.core.NodeConnector}
342 * @return True if exists, false otherwise.
344 public boolean doesNodeConnectorExist(NodeConnector nc);
347 * Return controller MAC address
349 * @return MAC address in byte array
351 public byte[] getControllerMAC();
354 * Return MAC address for a given node
356 * @param node {@link org.opendaylight.controller.sal.core.Node}
357 * @return MAC address in byte array
359 public byte[] getNodeMAC(Node node);
362 * Create a Name/Tier/Bandwidth Property object based on given property name
363 * and value. Other property types are not supported yet.
366 * Name of the Property specified by
367 * {@link org.opendaylight.controller.sal.core.Property} and its
370 * Value of the Property specified by
371 * {@link org.opendaylight.controller.sal.core.Property} and its
373 * @return {@link org.opendaylight.controller.sal.core.Property}
375 public Property createProperty(String propName, String propValue);
378 * Returns the description for the specified node. It is either the one
379 * configured by user or the description advertised by the node.
381 * @param node the network node identifier
382 * @return the description of the specified node. If no description is
383 * configured and the network node does not provide its description,
384 * an empty string is returned.
387 public String getNodeDescription(Node node);
390 * Return all the properties of the controller
392 * @return map of {@link org.opendaylight.controller.sal.core.Property} such
393 * as {@link org.opendaylight.controller.sal.core.Description}
394 * and/or {@link org.opendaylight.controller.sal.core.Tier} etc.
396 public Map<String, Property> getControllerProperties();
399 * Return a specific property of the controller given the property name
402 * the property name specified by
403 * {@link org.opendaylight.controller.sal.core.Property} and its
405 * @return {@link org.opendaylight.controller.sal.core.Property}
407 public Property getControllerProperty(String propertyName);
410 * Set a specific property of the controller
413 * {@link org.opendaylight.controller.sal.core.Property}
416 public Status setControllerProperty(Property property);
419 * Remove a property of a node
421 * @param propertyName
422 * the property name specified by
423 * {@link org.opendaylight.controller.sal.core.Property} and its
425 * @return success or failed reason
427 public Status removeControllerProperty(String propertyName);