Difference between revisions of "Using Management CLI"

Line 20: Line 20:
 
       <cli> add element --host=192.168.50.5 --name=TexasUSA --user=me --password=foo
 
       <cli> add element --host=192.168.50.5 --name=TexasUSA --user=me --password=foo
 
* list directory
 
* list directory
     <cli> ls
+
     Usage: ls [OBJECT_PATH]
    192.168.30.4:  NewEnglandRouter
+
    List information about the management objects (the current object by default).
    X.y.z.a:        HoChiMinhCity.Vietnam
+
    Example:
    192.168.50.5:  TexasUSA  DOWN!
+
      <cli> ls
    <cli> ls /TexasUSA/ethernet/interfaces
+
      192.168.30.4:  NewEnglandRouter
    <cli> ls /*/ethernet/interfaces
+
      X.y.z.a:        HoChiMinhCity.Vietnam
     <cli> ls /TexasUSA/ethernet/interfaces[name=eth0]
+
      192.168.50.5:  TexasUSA  DOWN!
    <cli> ls /TexasUSA/ethernet/interfaces[name=eth*]
+
      <cli> ls /TexasUSA/ethernet/interfaces
    <cli> ls /[TexasUSA,*.VN]/ethernet/interfaces
+
      <cli> ls /TexasUSA/ethernet/interfaces[name=eth0]
 +
     Example with wildcards & grouping:
 +
      <cli> ls /*/ethernet/interfaces
 +
      <cli> ls /TexasUSA/ethernet/interfaces[name=eth*]
 +
      <cli> ls /[TexasUSA,*.VN]/ethernet/interfaces
 
* change directory
 
* change directory
     <cli> cd /TexasUSA/ethernet/interfaces     
+
     Usage: cd [OBJECT_PATH]
    <cli> cd /[TexasUSA,*.VN]/ethernet/interfaces
+
    Change the current management object based on the OBJECT_PATH (the current object by default).
 +
    Example:
 +
      <cli> cd /TexasUSA/ethernet/interfaces     
 +
      <cli> cd /[TexasUSA,*.VN]/ethernet/interfaces
 
* set value
 
* set value
 
     <cli> set /[TexasUSA,*.VN]/ethernet/interfaces/status UP
 
     <cli> set /[TexasUSA,*.VN]/ethernet/interfaces/status UP

Revision as of 02:16, 24 January 2013

  • start cli
   cd cli
   ./mgtcli.py
  • show help
   Usage: help [COMMAND]
   Print help page
   Example:
     <cli> help
     <cli> help connect
  • add network element
   Usage: add element [OPTION]
   Add a network element into the system
   Mandatory arguments to long options
     --name=        name of netconf server
     --host=        address of netconf server
     --port=        port to connect to netconf server
     --user=        username to connect to netconf server
     --password=    password to connect to netconf server
   Example:
     <cli> add element --host=192.168.50.5 --name=TexasUSA --user=me --password=foo
  • list directory
   Usage: ls [OBJECT_PATH]
   List information about the management objects (the current object by default).
   Example:
     <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 /TexasUSA/ethernet/interfaces[name=eth0]
   Example with wildcards & grouping:
     <cli> ls /*/ethernet/interfaces
     <cli> ls /TexasUSA/ethernet/interfaces[name=eth*]
     <cli> ls /[TexasUSA,*.VN]/ethernet/interfaces
  • change directory
   Usage: cd [OBJECT_PATH]
   Change the current management object based on the OBJECT_PATH (the current object by default).
   Example:
     <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