Merge "Fixed for bug 1197"
[controller.git] / opendaylight / netconf / netconf-cli / README_ODL
1 This file contains ODL controller specific examples:
2
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)                                             ....
16
17
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]
26     g. Address-name
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)
30     h. Address-port
31         Submit 1830 (default port for netconf SSH server in ODL)
32     i. User-name
33         Submit "admin"
34     j. User-password
35         Submit "admin"
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
38
39
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
47
48
49 3.  Using help command
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.
53         commands  {
54           commands [id=close(netconf-cli)] {
55             id close(netconf-cli)
56             description Close the whole cli
57           }
58           commands [id=help(netconf-cli)] {
59             id help(netconf-cli)
60             description Display help
61           }
62           commands [id=disconnect(netconf-cli)] {
63             id disconnect(netconf-cli)
64             description Disconnect from a netconf device that is currently connected
65           }
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.
69           }
70         }
71
72
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]
77     d. Filter
78         Submit "skip" (This will ignore the filter attribute, ODL does not support filtering at this moment, but will be supported in near future)
79     e. Source
80         You have to choose from candidate, running, startup. Submit running.
81     f. You should see the whole configuration of the ODL e.g.:
82         data {
83           modules {
84             module  {
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)  {
89                     ...
90
91
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]
96     d. 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
99
100
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]
105     d. Config
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
118         
119         The cli will now if you want to create another module entry.
120         Submit "N".
121     e. Default-operation
122         Submit "skip" to skip or pick from available e.g. merge, replace etc.
123     f. Error-option
124         Submit "skip" to skip option.
125     g. Config-target
126         This is a choice between running and candidate. Submit candidate to edit configuration only in the candidate datastore.
127     h. Test-option
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] {
133             name newModule
134             type (urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl?revision=2013-04-05)threadfactory-naming
135             choice configuration (threadfactory-naming)  {
136               name-prefix prefix
137             }
138           }
139
140
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.
145     d. Confirm-timeout
146         Skip
147     e. Confirmed
148         N
149     f. Persist
150         Skip
151     g. Persist-id
152         Skip
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.