Size: 5343
Comment:
|
Size: 6027
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 111: | Line 111: |
---- /!\ '''Edit conflict - other version:''' ---- ---- /!\ '''Edit conflict - your version:''' ---- ---- /!\ '''End of edit conflict''' ---- |
|
Line 132: | Line 140: |
---- /!\ '''Edit conflict - other version:''' ---- |
|
Line 134: | Line 144: |
syntax: set leaf value | syntax: getconfig <xpath> |
Line 136: | Line 146: |
For example, /test/myService/config>set port 3000 /test/>set myService/config/port 3000 |
For example, /test>getconfig myService/config The result of the above statement is: config: homeLocation:/srv/web port:8000 |
Line 141: | Line 159: |
---- /!\ '''Edit conflict - your version:''' ---- 5. getconfig: get the configuration values for an xpath located in the database set by previous setdatabase command syntax: getconfig <xpath> For example, /test>getconfig myService/config The result of the above statement is: config: homeLocation:/srv/web port:8000 ---- /!\ '''End of edit conflict''' ---- |
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
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:
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:
There are some openclovis command such as ls, cd, setdatabase, set, getconfig. They are to simplify some standard netconf protocol operations
1.cd : set the new current xpath (similar to linux "cd" command)
syntax: cd <xpath>
For example, /test> cd myService/config
The result of the above statement is: /test/myService/config>
2. ls: display the xpath structure of the running database for the passed argument xpath, if xpath is omitted, the command display the structure of current xpath
Systax: ls [<xpath>]
For example, /test/myService/config>ls port
The result of the above statement is: port:8000
/test/myService/config>ls
The result of the above statement is:
- homeLocation:/srv/web
Edit conflict - other version:
Edit conflict - your version:
End of edit conflict
- port:8000
3. setdatabase: set the operational database that will be applied for set and getconfig commands
Syntax: setdatabase <databasename>
For example, setdatabase running
- setdatabase candidate
4. set: assign a new value for a leaf located in the database set by previous setdatabase command
syntax: set leaf value
For example, /test/myService/config>set port 3000
/test/>set myService/config/port 3000
Edit conflict - other version:
5. getconfig: get the configuration values for an xpath
syntax: getconfig <xpath>
For example, /test>getconfig myService/config
The result of the above statement is:
config:
- homeLocation:/srv/web port:8000
Edit conflict - your version:
5. getconfig: get the configuration values for an xpath located in the database set by previous setdatabase command
syntax: getconfig <xpath>
For example, /test>getconfig myService/config
The result of the above statement is:
config:
- homeLocation:/srv/web port:8000
End of edit conflict