1 This file contains ODL controller specific examples:
3 1A. Connecting to ODL controller automatically:
4 a. Make sure ODL controller is running on your or any other accessible device
5 b. Start the cli using this command (in folder controller/opendaylight/netconf/netconf-cli/target/):
6 java -jar netconf-cli-0.2.5-SNAPSHOT-executable.jar --server localhost --port 1830 --username admin --password admin
7 c. The cli will start up in aprox. 20 seconds (Schema download might take some time on the first connection, subsequent attempts should take less time)
8 d. You should see the list of commands avaliable in the controller e.g.:
9 add-flow(sal-flow) add-group(sal-group)
10 add-meter(sal-meter) begin-transaction(sal-remote)
11 cancel-commit(ietf-netconf) cancel-toast(toaster)
12 clear-toasts-made(toaster-provider-impl) close(netconf-cli)
13 close-session(ietf-netconf) commit(ietf-netconf)
14 connect(netconf-cli) copy-config(ietf-netconf)
15 create-data-change-event-subscription(sal-remote) ....
18 1B. Connecting to ODL from the CLI:
19 a. Make sure ODL controller is running on your or any other accessible device
20 b. Start the cli using this command (in folder controller/opendaylight/netconf/netconf-cli/target/):
21 java -jar netconf-cli-0.2.5-SNAPSHOT-executable.jar
22 c. The cli will start app right away (few seconds)
23 d. You should see only the basic commands e.g. connect, close, help, disconnect
24 e. Type connect, hit TAB, hit ENTER
25 f. Cli will ask for connect arguments: [address-name, address-port, user-name, user-password]
27 The cli will ask what type of address you want to provide (domain-name or ip-address). This is caused by the yang model for connect command, the address-name is of type ietf-inet-types:host, which is a union of domain-name and ip-address.
28 Submit "domain-name" (TAB can be used for autocompete)
29 Now you need to provide value, submit "localhost" (TAB can be used for autocomplete, as "localhost" is the default value)
31 Submit 1830 (default port for netconf SSH server in ODL)
36 k. The connection will be up in aprox. 20 seconds (Schema download might take some time on the first connection, subsequent attempts should take less time)
37 l. You should see the list of commands available in the controller
40 2. Disconnecting from ODL in the CLI
41 a. Execute scenario 1A or 1B
42 b. Type "disconn", hit TAB, hit Enter
43 c. You should see the following output:
44 status Connection disconnected
45 d. Use TAB to see available commands, only local commands are present now
46 e. Now you can use the connect command(as in 1B) to connect again
50 a. Help command can be executed in connected as well as disconnected state
51 b. Type "help", hit TAB, hit Enter
52 c. You should see the help conent containing the list of all available commands with description for each of them e.g.
54 commands [id=close(netconf-cli)] {
56 description Close the whole cli
58 commands [id=help(netconf-cli)] {
60 description Display help
62 commands [id=disconnect(netconf-cli)] {
63 id disconnect(netconf-cli)
64 description Disconnect from a netconf device that is currently connected
66 commands [id=connect(netconf-cli)] {
67 id connect(netconf-cli)
68 description Connect to a remote netconf device, if not connected yet. Connection initialization is blocking and might take some time, depending on amount of yang schemas in remote device.
73 4. Executing get-config command (get-config(ietf-netconf))
74 a. Execute scenario 1A or 1B
75 b. Type "get-config", hit TAB, hit Enter
76 c. Cli will ask for get-config arguments: [filter, source]
78 Submit "skip" (This will ignore the filter attribute, ODL does not support filtering at this moment, but will be supported in near future)
80 You have to choose from candidate, running, startup. Submit running.
81 f. You should see the whole configuration of the ODL e.g.:
85 module [name=toaster-provider-impl] {
86 name toaster-provider-impl
87 type (urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl?revision=2014-01-31)toaster-provider-impl
88 choice configuration (toaster-provider-impl) {
92 5. Executing get command (get(ietf-netconf))
93 a. Execute scenario 1A or 1B
94 b. Type "get(", hit TAB, hit Enter
95 c. Cli will ask for get arguments: [filter]
97 Submit "skip" (This will ignore the filter attribute, ODL does not support filtering at this moment, but will be supported in near future)
98 f. You should see the whole data-tree of the ODL
101 6. Executing edit-config command (edit-config(ietf-netconf))
102 a. Execute scenario 1A or 1B
103 b. Type "edit", hit TAB, hit Enter
104 c. Cli will ask for edit-config arguments: [default-operation, edit-content, error-option, target, test-option]
106 Config contains the data to be edited
107 1. First you have to specify a path pointing to a concrete data node. Use TAB to help with autocomplete.
108 Submit "modules(config)/module(config)/"
109 Module node is of type list and now you have to construct a whole new list entry for the module list.
110 2. The cli will ask for these nodes: [configuration, name, type]
111 Name - Submit any name e.g. newModule
112 Type - For Type you have to pick from available module types in the ODL, hit TAB for hints
113 Submit "threadfactory-naming(threadpool-impl)" to create a new instance of threadfactory in the ODL.
114 Configuration - For configuration you have to pick from available module types again
115 Submit "threadfactory-naming" to match previous module type
116 The cli will now ask for threadfactory-naming specific configuration: [prefix]
117 Prefix - Submit any string
119 The cli will now if you want to create another module entry.
122 Submit "skip" to skip or pick from available e.g. merge, replace etc.
124 Submit "skip" to skip option.
126 This is a choice between running and candidate. Submit candidate to edit configuration only in the candidate datastore.
128 Submit "skip" to skip option.
129 i. You should see OK response
130 j. You can check the candidate datastore change by executing get-config command as in scenario 4, but pick candidate as the source.
131 k. You should see this module in the output:
132 module [name=newModule] {
134 type (urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl?revision=2013-04-05)threadfactory-naming
135 choice configuration (threadfactory-naming) {
141 7. Commiting changes from candidate to running datastore
142 a. Execute scenario 6.
143 b. Type commit, hit TAB, hit Enter
144 c. Cli will ask for commit arguments: [confirm-timeout, confirmed, persist, persist-id]. We will skip all these arguments since they are not supported in ODL. Cli should be able to detect this and not ask for them. This is a TODO, by supporting feature/if-feature detection in the CLI.
153 h. You should see OK response
154 i. You can check the candidate datastore change by executing get-config command as in scenario 4.