Difference between revisions of "Using Management CLI"

Line 1: Line 1:
 
* start cli
 
* start cli
:* cd cli
+
    cd cli
:* ./mgtcli.py
+
    ./mgtcli.py
# add network element
+
* add network element
<cli> add element --host=192.168.50.5 --
+
    <cli> add element --host=192.168.50.5 --
name=TexasUSA --user=me --password=foo
+
    name=TexasUSA --user=me --password=foo
# list directory
+
* list directory
<cli> ls
+
    <cli> ls
192.168.30.4:  NewEnglandRouter
+
    192.168.30.4:  NewEnglandRouter
X.y.z.a:             HoChiMinhCity.
+
    X.y.z.a:       HoChiMinhCity.Vietnam
Vietnam
+
    192.168.50.5:  TexasUSA   DOWN!
192.168.50.5:  TexasUSA
+
    <cli> ls /TexasUSA/ethernet/interfaces
DOWN!
+
    <cli> ls /*/ethernet/interfaces
<cli> ls /TexasUSA/ethernet/interfaces
+
    <cli> ls /TexasUSA/ethernet/interfaces[name=eth0]
<cli> ls /*/ethernet/interfaces
+
    <cli> ls /TexasUSA/ethernet/interfaces[name=eth*]
<cli> ls /TexasUSA/ethernet/interfaces[name=eth0]
+
    <cli> ls /[TexasUSA,*.VN]/ethernet/interfaces
<cli> ls /TexasUSA/ethernet/interfaces[name=eth*]
+
* change directory
<cli> ls /[TexasUSA,*.VN]/ethernet/interfaces
+
    <cli> cd /TexasUSA/ethernet/interfaces  
#change directory
+
    <cli> cd /[TexasUSA,*.VN]/ethernet/interfaces
<cli> cd /TexasUSA/ethernet/interfaces
+
* set value
<cli> cd /[TexasUSA,*.VN]/ethernet/interfaces
+
    <cli> set /[TexasUSA,*.VN]/ethernet/interfaces/status UP
# set value
+
* load user plugin
<cli> set /[TexasUSA,*.VN]/ethernet/interfaces/status UP
+
    <cli> load testplugin.py
# load user plugin
+
* run commands define in the plugin
<cli> load testplugin.py
+
    <cli> show_by_name eth0
# run commands define in the plugin
+
    <cli> show_by_path /TexasUSA/ethernet/interfaces[name=eth0]
<cli> show_by_name eth0
+
* demo notification when network disconnect
<cli> show_by_path /TexasUSA/ethernet/interfaces
+
    <model deployment machine>./etc/init.d/asp stop
[name=eth0]
+
    <cli>typing something  
# demo notification when network disconnect
+
    Disconnected to server TexasUSA!
<model deployment machine>./etc/init.d/asp stop
+
    <cli>typing something
<cli>typing something
+
* reconnect server
Disconnected to server TexasUSA!
+
    connect TexasUSA
<cli>typing something
+
# reconnect server
+
connect TexasUSA
+

Revision as of 01:51, 24 January 2013

  • start cli
   cd cli
   ./mgtcli.py
  • add network element
   <cli> add element --host=192.168.50.5 --
   name=TexasUSA --user=me --password=foo
  • list directory
   <cli> ls
   192.168.30.4:   NewEnglandRouter
   X.y.z.a:        HoChiMinhCity.Vietnam
   192.168.50.5:  TexasUSA   DOWN!
   <cli> ls /TexasUSA/ethernet/interfaces
   <cli> ls /*/ethernet/interfaces
   <cli> ls /TexasUSA/ethernet/interfaces[name=eth0]
   <cli> ls /TexasUSA/ethernet/interfaces[name=eth*]
   <cli> ls /[TexasUSA,*.VN]/ethernet/interfaces
  • change directory
   <cli> cd /TexasUSA/ethernet/interfaces    
   <cli> cd /[TexasUSA,*.VN]/ethernet/interfaces
  • set value
   <cli> set /[TexasUSA,*.VN]/ethernet/interfaces/status UP
  • load user plugin
   <cli> load testplugin.py
  • run commands define in the plugin
   <cli> show_by_name eth0
   <cli> show_by_path /TexasUSA/ethernet/interfaces[name=eth0]
  • demo notification when network disconnect
   <model deployment machine>./etc/init.d/asp stop
   <cli>typing something    
   Disconnected to server TexasUSA!
   <cli>typing something
  • reconnect server
   connect TexasUSA