06b91711d41ca5e148b6370fe207b4d64348ffbf
[netconf.git] / apps / netconf-console / src / main / java / org / opendaylight / netconf / console / api / NetconfCommands.java
1 /*
2  * Copyright (c) 2016 Inocybe Technologies and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.console.api;
9
10 import java.util.List;
11 import java.util.Map;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode;
13
14 public interface NetconfCommands {
15     /**
16      * Returns a Hashmap with NETCONF ID as outer key and
17      * inner keys representing attributes of a NETCONF device.
18      * @return :Hashmap with two keys for all NETCONF devices in topology
19      */
20     Map<String, Map<String, String>> listDevices();
21
22     /**
23      * Returns a Hashmap with NETCONF ID as outer key and inner keys representing
24      * attributes of a NETCONF device for the requested IP and Port. If port is not
25      * specified, all NETCONF devices with requested IP address are returned.
26      * @param deviceIp :IP address of NETCONF device
27      * @param devicePort :Port of the NETCONF device
28      * @return :Hashmap with two keys for the requested device IP and/or Port
29      */
30     Map<String, Map<String, List<String>>> showDevice(String deviceIp, String devicePort);
31
32     /**
33      * Returns a Hashmap with NETCONF ID as outer key and inner keys representing
34      * attributes of a NETCONF device for the requested netconf device ID.
35      * @param deviceId :Node id of NETCONF device
36      * @return :Hashmap with two keys for the requested device Id
37      */
38     Map<String, Map<String, List<String>>> showDevice(String deviceId);
39
40     /**
41      * Add a NETCONF connector.
42      * @param netconfNode :An instance of {@link NetconfNode} containing
43      *     all required information
44      * @param deviceId :NETCONF node ID
45      */
46     void connectDevice(NetconfNode netconfNode, String deviceId);
47
48     /**
49      * Disconnect a NETCONF connector.
50      * @param deviceIp :IP address of NETCONF device
51      * @param devicePort :Port of NETCONF device
52      * @return :Status of disconnect NETCONF connector
53      */
54     boolean disconnectDevice(String deviceIp, String devicePort);
55
56     /**
57      * Disconnect a NETCONF connector.
58      * @param deviceId :Node id of NETCONF device
59      * @return :Status of disconnect NETCONF connector
60      */
61     boolean disconnectDevice(String deviceId);
62
63     /**
64      * Update the NETCONF device for requested values.
65      * @param deviceId :NETCONF node ID
66      * @param username :Username for NETCONF device
67      * @param password :Password for NETCONF device
68      * @param updated :HashMap of attributes to update
69      * @return :Status of update NETCONF connector
70      */
71     String updateDevice(String deviceId, String username, String password, Map<String, String> updated);
72 }