This file contains ODL controller specific examples: 1A. Connecting to ODL controller automatically: a. Make sure ODL controller is running on your or any other accessible device b. Start the cli using this command (in folder controller/opendaylight/netconf/netconf-cli/target/): java -jar netconf-cli-0.2.5-SNAPSHOT-executable.jar --server localhost --port 1830 --username admin --password admin 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) d. You should see the list of commands avaliable in the controller e.g.: add-flow(sal-flow) add-group(sal-group) add-meter(sal-meter) begin-transaction(sal-remote) cancel-commit(ietf-netconf) cancel-toast(toaster) clear-toasts-made(toaster-provider-impl) close(netconf-cli) close-session(ietf-netconf) commit(ietf-netconf) connect(netconf-cli) copy-config(ietf-netconf) create-data-change-event-subscription(sal-remote) .... 1B. Connecting to ODL from the CLI: a. Make sure ODL controller is running on your or any other accessible device b. Start the cli using this command (in folder controller/opendaylight/netconf/netconf-cli/target/): java -jar netconf-cli-0.2.5-SNAPSHOT-executable.jar c. The cli will start app right away (few seconds) d. You should see only the basic commands e.g. connect, close, help, disconnect e. Type connect, hit TAB, hit ENTER f. Cli will ask for connect arguments: [address-name, address-port, user-name, user-password] g. Address-name 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. Submit "domain-name" (TAB can be used for autocompete) Now you need to provide value, submit "localhost" (TAB can be used for autocomplete, as "localhost" is the default value) h. Address-port Submit 1830 (default port for netconf SSH server in ODL) i. User-name Submit "admin" j. User-password Submit "admin" 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) l. You should see the list of commands available in the controller 2. Disconnecting from ODL in the CLI a. Execute scenario 1A or 1B b. Type "disconn", hit TAB, hit Enter c. You should see the following output: status Connection disconnected d. Use TAB to see available commands, only local commands are present now e. Now you can use the connect command(as in 1B) to connect again 3. Using help command a. Help command can be executed in connected as well as disconnected state b. Type "help", hit TAB, hit Enter c. You should see the help conent containing the list of all available commands with description for each of them e.g. commands { commands [id=close(netconf-cli)] { id close(netconf-cli) description Close the whole cli } commands [id=help(netconf-cli)] { id help(netconf-cli) description Display help } commands [id=disconnect(netconf-cli)] { id disconnect(netconf-cli) description Disconnect from a netconf device that is currently connected } commands [id=connect(netconf-cli)] { id connect(netconf-cli) 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. } } 4. Executing get-config command (get-config(ietf-netconf)) a. Execute scenario 1A or 1B b. Type "get-config", hit TAB, hit Enter c. Cli will ask for get-config arguments: [filter, source] d. Filter Submit "skip" (This will ignore the filter attribute, ODL does not support filtering at this moment, but will be supported in near future) e. Source You have to choose from candidate, running, startup. Submit running. f. You should see the whole configuration of the ODL e.g.: data { modules { module { module [name=toaster-provider-impl] { name toaster-provider-impl type (urn:opendaylight:params:xml:ns:yang:controller:config:toaster-provider:impl?revision=2014-01-31)toaster-provider-impl choice configuration (toaster-provider-impl) { ... 5. Executing get command (get(ietf-netconf)) a. Execute scenario 1A or 1B b. Type "get(", hit TAB, hit Enter c. Cli will ask for get arguments: [filter] d. Filter Submit "skip" (This will ignore the filter attribute, ODL does not support filtering at this moment, but will be supported in near future) f. You should see the whole data-tree of the ODL 6. Executing edit-config command (edit-config(ietf-netconf)) a. Execute scenario 1A or 1B b. Type "edit", hit TAB, hit Enter c. Cli will ask for edit-config arguments: [default-operation, edit-content, error-option, target, test-option] d. Config Config contains the data to be edited 1. First you have to specify a path pointing to a concrete data node. Use TAB to help with autocomplete. Submit "modules(config)/module(config)/" Module node is of type list and now you have to construct a whole new list entry for the module list. 2. The cli will ask for these nodes: [configuration, name, type] Name - Submit any name e.g. newModule Type - For Type you have to pick from available module types in the ODL, hit TAB for hints Submit "threadfactory-naming(threadpool-impl)" to create a new instance of threadfactory in the ODL. Configuration - For configuration you have to pick from available module types again Submit "threadfactory-naming" to match previous module type The cli will now ask for threadfactory-naming specific configuration: [prefix] Prefix - Submit any string The cli will now if you want to create another module entry. Submit "N". e. Default-operation Submit "skip" to skip or pick from available e.g. merge, replace etc. f. Error-option Submit "skip" to skip option. g. Config-target This is a choice between running and candidate. Submit candidate to edit configuration only in the candidate datastore. h. Test-option Submit "skip" to skip option. i. You should see OK response j. You can check the candidate datastore change by executing get-config command as in scenario 4, but pick candidate as the source. k. You should see this module in the output: module [name=newModule] { name newModule type (urn:opendaylight:params:xml:ns:yang:controller:threadpool:impl?revision=2013-04-05)threadfactory-naming choice configuration (threadfactory-naming) { name-prefix prefix } } 7. Commiting changes from candidate to running datastore a. Execute scenario 6. b. Type commit, hit TAB, hit Enter 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. d. Confirm-timeout Skip e. Confirmed N f. Persist Skip g. Persist-id Skip h. You should see OK response i. You can check the candidate datastore change by executing get-config command as in scenario 4.