Admin CLI

Download *-bin.zip distribution archive from repository. Unzip the archive in a directory and within that directory issue the following command:

$ java -cp sensnet-cli-0.9.5-SNAPSHOT.jar cythres.sensnet.cli.Console

Now you can type your commands in the console:

  • Connect to the server
    open "URL" "root_username" "root_password"
    
    open "https://snog.cythres.cz/sn/rest/admin" "operator_1" "4efGGb.33a"
  • Disconnect
    close
  • Exit/quit
    quit
  • Add a user
    adduser "USER" "PASSWORD" "DESCRIPTION"
    
    adduser "voice@airport.prague.cz" "efg55ds..3" "Tel 555-345-123"
  • Change password
    chuser "USER" [ "OLD_PASS" ] "NEW_PASS"
    
    chuser "voice@airport.prague.cz" "efg55ds..3" "efg55ds.x.3"
  • Change user description
    chudes "USER" "DESCRIPTION"
    
    chudes "voice@airport.prague.cz" "Tel 555-123-345"
  • List users
    lsuser [ "FILTER" ]
    
    lsuser "%@airport.prague.cz"
  • Remove a user
    rmuser "USER"
    
    rmuser "voice@airport.prague.cz"
  • Add a role
    addrole "NAME" "DESCRIPTION"
    
    addrole "net:airport.prague.cz" "vlan airport"
  • Change role description
    chrole "NAME" "NEW_DESCRIPTION"
    
    chrole "net:airport.prague.cz" "vlan"
  • List roles
    lsrole [ "FILTER" ]
    
    lsrole "%.cz"
  • Remove a role
    rmrole "NAME"
    
    rmrole "net:airport.prague.cz"
  • Add a data resource
    addres ID "NAME" "MAP_LAYER" "UNITS" "DESCRIPTION"
    
    addres 40 "Temperature" "false" "C" "Unit board temperature"
  • Change a data resource
    chres ID "NEW_NAME" "NEW_MAP_LAYER" "NEW_UNITS" "NEW_DESCRIPTION"
    
    chres 40 "Temperature" "true" "C" "Unit board temperature"
  • List data resources
    lsres [ "FILTER" ]
    
    lsres "Temperature"
  • Remove a data resource
    rmres id
    
    rmres 40
  • Add a sensor
    addsens ID RESOURCE_ID "DESCRIPTION"
    
    addsens 40 8 "Chip BC440"
  • Change a sensor
    chsens ID ( RESOURCE_ID | "NEW_DESCRIPTION" )+
    
    chsens 40 "Chip BC442"
  • List sensors
    lssens [ "FILTER" ]
    
    lssens "Chip BC442"
  • Remove a sensor
    rmsens id
    
    rmsens 40
  • Add a unit
    addunit ID SERIAL CFG PIN Xf Yf TBD "DESCRIPTION" "COMMENT"
    
    addunit 501 666 3 1234 15.5f 50.9f true "hello" "broken handle on top"
  • Change a unit
    chunit ID "SERIAL" "CFG" "PIN" "X" "Y" "TBD" "DESCRIPTION" "COMMENT"
    
    chunit 501 "" "300" "4321" "" "52.5" "" "bye" "fixed handle on top"
  • List units
    lsunit [ "FILTER" | NUMBER ]
    
    lsunit "Chip BC442"
    lsunit 300
  • Remove a unit
    rmunit id
    
    rmunit 40

Security labels

Unit, DataResource and User are tagged with labels (roles). To list, add or remove an existing role use:

label ( unit | resource ) NUMBER ( + | - "ROLE" )?

label unit 50
label resource 10
label unit 50 + "res:temperature"
label unit 51 - "net:test.domain"

label user "USERNAME" ( + | - "ROLE" )?

label user "test@test.domain"
label user "test@test.domain" + "net:test2.domain"
label user "test@test.domain" + "net:test3.domain"

Topology

The administrator may open a route through a master node:

topo NUMBER_NODE [ NUMBER_MASTER ]

topo 50 5

To disable the routing for the node 50, issue:

topo 50