Revision 11 as of 2017-11-22 03:57:26

Clear message

The OpenClovis Managment Command Line Interface

Overview

OpenClovis provides a powerful graphical Command Line Interface (CLI) and Text Command Line interface application that allows users to easily access information presented by network elements via the NETCONF protocol but in this first version, we only provide the latter.

To get started with the supported commands, you must be familiar with Netconf specification (https://tools.ietf.org/html/rfc6241) and Netconf notification (https://tools.ietf.org/html/rfc5277). These specifications define concepts as well as message structure in xml you must know in order to communicate with netconf server via commands such as get-config, edit-config, create-subscription...

First, you need to run ./safplus_cli

To get the command list, type help.

The first step you must to do is to connect to the mgt server by connect command below:

   1 connect <name> <username> <password> <host>

name : connection name (any name you like)

username: username that needs to authenticate with the machine on which the mgt server is running. Note that, to be able to run some netconf commands that changing the data e.g. edit-config, lock, ... the username must be the one defined in netconfd.conf located in mgt server

password: password that needs to authenticate with the machine on which the mgt server is running.

host: the ipaddress on which the mgt server is running

To run an rpc command, type: <command> [<name=value> <name=value> ...]

<command>: rpc command supported by OpenYuma such as get-config, edit-config... and your own commands defined in your app.

<name=value>: arguments for the command in pair separated by '=' and each pair is separated by space if the command has several arguments. Each name in each pair will be translated as an xml tag and value will be the text value for the tag. For example, get-config source=running will be translated as <get-config><source>running</source></get-config> . But according to the Netconf specification, the get-config xml message must be: <get-config><source><running/></source></get-config>. To achieve this, you must type: get-config source=<running/>

If the tag doesn't include any attribute, like <source><running/></source>, you can type get-config source=<running/>. But if a tag contains attribute like

   1        <get-config>
   2          <source>
   3            <running/>
   4          </source>
   5          <filter type="subtree">
   6            <myService>
   7              <config>
   8                <homeLocation/>
   9              </config>
  10            </myService>
  11          </filter>
  12        </get-config>

you must type: get-config source=<running/> 'filter type="subtree"'=<myService><config><homeLocation/></config></myService>

If <filter> doesn't contain any attribute (for example), type: get-config source=<running/> filter=<myService><config><homeLocation/></config></myService>. Xml generated:

   1         <get-config>
   2           <source>
   3             <running/>
   4           </source>
   5           <filter>
   6             <myService>
   7               <config>
   8                 <homeLocation/>
   9               </config>
  10             </myService>
  11           </filter>
  12         </get-config>

In general, if an argument contains space, it must be covered with single quotes. For example:

   1 edit-config target=<running/> 'tag attr1="blah" attr2="blah blah"'='<othertag attr="blah blah blah" attr2="blah blah"/>'

The xml generated:

   1         <edit-config>
   2           <target>
   3             <running/>
   4           </target>
   5           <tag attr1="blah" attr2="blah blah">
   6             <othertag attr="blah blah blah" attr2="blah blah"/>           
   7           </tag>
   8         </edit-config>