Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • <region-id> is a unique identifier for the region
  • <region-name> is a human readable name for the region
  • <region-type> is one of the values defined in the Region.Type enumeration:
    • CONTINENT, COUNTRY, METRO, CAMPUS, BUILDING, DATA_CENTER, FLOOR, ROOM, RACK, LOGICAL_GROUP
  • <lat/Y>, <long/X> are the latitude / longitude (for geo layouts) or Y-coord / X-coord (for grid layouts) to be assigned to the region when it is displayed as a node in its parent layout.
  • <locType> is either geo (for geographical (map) layout) or grid (for logical grid layout).
  • <region-master> is a list of sets of node-IDs for mastership of the devices (see RegionAddCommand for more details).

A couple of examples:

Code Block
region-add rUK "United Kingdom" COUNTRY 52.206035 -1.310384 geo "192.168.56.101 / 192.168.56.102"
region-add rRack1 "Primary Rack" RACK 15.0 20.0 grid 10.0.0.5

Note that CLI commands are scriptable. One way of doing this is as follows:

Code Block
#!/bin/bash
host=${1:-localhost}
 
onos ${host} <<-EOF
region-add rUK "United Kingdom" COUNTRY 52.206035 -1.310384 geo ${host}
region-add rIT "Italy"   COUNTRY 44.447951  11.093161 geo ${host}
region-add rFR "France"  COUNTRY 47.066264  2.711458 geo ${host}
EOF


region-add-devices

Devices can be assigned to regions with the region-add-devices command:

region-add-devices <region-id> <dev1> <dev2> ... <dev-n>

where

  • <region-id> is the region unique identifier
  • <dev-...> is a device identifier

For example:

Code Block
region-add-devices rUK \
    of:0000000000000001 \
    of:0000000000000002 \    
    of:0000000000000003