wiki:GENIExperimenter/Tutorials/GENIDesktop/GEC23/GENIDesktop_CLI

Version 10 (modified by Hussamuddin Nasir, 9 years ago) (diff)

--

Navigation: Back

GENIDesktop Command Line Interface Tool

The GENIDesktop Command line Interface Tool is a simple client side tool written in python that interacts with the GENIDesktop server to provide a user with a subset of operations that can currently be done via the GUI interface. It provides a user with the flexibility to automate GENIDesktop related operations by combining multiple operation into a bash/.bat scripts and customize them as per their use case. Some of the operations currently supported by the GENIDesktop CLI Tool are :

  • Check status of the slice/slivers
  • Download files from nodes in the Slice
  • Download passive monitoring data collected from nodes in a CSV, PNG and RRD formats.
  • Download a list of slice, list of nodes/link from a slice or the whole slice topology itself in a JSON format.
  • Run commands on the node(s) in the slice. (Similar to the Run module in the GUI)
  • Upload file(s) to the node(s) in the slice. (Similar to the File upload module in the GUI)
  • CLI version of the Experiment validation tool provided in the GUI.

So to get started please follow the steps below.

  1. Download and Install and Test GENIDesktop CLI Tool.
  2. Generate and Download GDCLI key.
  3. Enable the GDCLI using the GDCLI key.
  4. Using GENIDesktop CLI

STEP 1. Download and Install and Test GENIDesktop CLI Tool

STEP 2. Generate and Download GDCLI key.

STEP 3. Enable the GDCLI using the GDCLI key.

STEP 4. Using GENIDesktop CLI

gdcli listnodes -s demo -r UKGENI

["node-0", "node-1", "GDGN0"]
gdcli run -s demo -r UKGENI -n "node-0,node-1" -c "sudo apt-get -y update;sudo apt-get -y install iperf"

Ign http://www.cs.uky.edu trusty InRelease
Ign http://www.cs.uky.edu trusty-updates InRelease
Hit http://www.cs.uky.edu trusty Release.gpg
Get:1 http://www.cs.uky.edu trusty-updates Release.gpg [933 B]
Hit http://www.cs.uky.edu trusty Release
Get:2 http://www.cs.uky.edu trusty-updates Release [63.5 kB]
Hit http://www.cs.uky.edu trusty/main Sources
Hit http://www.cs.uky.edu trusty/restricted Sources
Hit http://www.cs.uky.edu trusty/universe Sources
Hit http://www.cs.uky.edu trusty/main amd64 Packages
Hit http://www.cs.uky.edu trusty/restricted amd64 Packages
Hit http://www.cs.uky.edu trusty/universe amd64 Packages
Hit http://www.cs.uky.edu trusty/main i386 Packages
Hit http://www.cs.uky.edu trusty/restricted i386 Packages
Hit http://www.cs.uky.edu trusty/universe i386 Packages
Get:3 http://www.cs.uky.edu trusty-updates/main Sources [263 kB]
Get:4 http://www.cs.uky.edu trusty-updates/restricted Sources [3,158 B]
Get:5 http://www.cs.uky.edu trusty-updates/universe Sources [148 kB]
Get:6 http://www.cs.uky.edu trusty-updates/main amd64 Packages [674 kB]
Get:7 http://www.cs.uky.edu trusty-updates/restricted amd64 Packages [18.1 kB]
Get:8 http://www.cs.uky.edu trusty-updates/universe amd64 Packages [371 kB]
Get:9 http://www.cs.uky.edu trusty-updates/main i386 Packages [657 kB]
Get:10 http://www.cs.uky.edu trusty-updates/restricted i386 Packages [18.1 kB]
Get:11 http://www.cs.uky.edu trusty-updates/universe i386 Packages [372 kB]
Ign http://www.cs.uky.edu trusty-updates/main Translation-en
Ign http://www.cs.uky.edu trusty-updates/restricted Translation-en
Ign http://www.cs.uky.edu trusty-updates/universe Translation-en
Ign http://www.cs.uky.edu trusty/main Translation-en_US
Ign http://www.cs.uky.edu trusty/main Translation-en
Ign http://www.cs.uky.edu trusty/restricted Translation-en_US
Ign http://www.cs.uky.edu trusty/restricted Translation-en
Ign http://www.cs.uky.edu trusty/universe Translation-en_US
Ign http://www.cs.uky.edu trusty/universe Translation-en
Fetched 2,587 kB in 1s (2,016 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  iperf
0 upgraded, 1 newly installed, 0 to remove and 219 not upgraded.
Need to get 56.3 kB of archives.
After this operation, 174 kB of additional disk space will be used.
Get:1 http://www.cs.uky.edu/ubuntu/ trusty/universe iperf amd64 2.0.5-3 [56.3 kB]
Fetched 56.3 kB in 0s (4,642 kB/s)
Selecting previously unselected package iperf.
(Reading database ... 91795 files and directories currently installed.)
Preparing to unpack .../iperf_2.0.5-3_amd64.deb ...
Unpacking iperf (2.0.5-3) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up iperf (2.0.5-3) ...

Ign http://www.cs.uky.edu trusty InRelease
Ign http://www.cs.uky.edu trusty-updates InRelease
Hit http://www.cs.uky.edu trusty Release.gpg
Get:1 http://www.cs.uky.edu trusty-updates Release.gpg [933 B]
Hit http://www.cs.uky.edu trusty Release
Get:2 http://www.cs.uky.edu trusty-updates Release [63.5 kB]
Hit http://www.cs.uky.edu trusty/main Sources
Hit http://www.cs.uky.edu trusty/restricted Sources
Hit http://www.cs.uky.edu trusty/universe Sources
Hit http://www.cs.uky.edu trusty/main amd64 Packages
Hit http://www.cs.uky.edu trusty/restricted amd64 Packages
Hit http://www.cs.uky.edu trusty/universe amd64 Packages
Hit http://www.cs.uky.edu trusty/main i386 Packages
Hit http://www.cs.uky.edu trusty/restricted i386 Packages
Hit http://www.cs.uky.edu trusty/universe i386 Packages
Get:3 http://www.cs.uky.edu trusty-updates/main Sources [263 kB]
Get:4 http://www.cs.uky.edu trusty-updates/restricted Sources [3,158 B]
Get:5 http://www.cs.uky.edu trusty-updates/universe Sources [148 kB]
Get:6 http://www.cs.uky.edu trusty-updates/main amd64 Packages [674 kB]
Get:7 http://www.cs.uky.edu trusty-updates/restricted amd64 Packages [18.1 kB]
Get:8 http://www.cs.uky.edu trusty-updates/universe amd64 Packages [371 kB]
Get:9 http://www.cs.uky.edu trusty-updates/main i386 Packages [657 kB]
Get:10 http://www.cs.uky.edu trusty-updates/restricted i386 Packages [18.1 kB]
Get:11 http://www.cs.uky.edu trusty-updates/universe i386 Packages [372 kB]
Ign http://www.cs.uky.edu trusty-updates/main Translation-en
Ign http://www.cs.uky.edu trusty-updates/restricted Translation-en
Ign http://www.cs.uky.edu trusty-updates/universe Translation-en
Ign http://www.cs.uky.edu trusty/main Translation-en_US
Ign http://www.cs.uky.edu trusty/main Translation-en
Ign http://www.cs.uky.edu trusty/restricted Translation-en_US
Ign http://www.cs.uky.edu trusty/restricted Translation-en
Ign http://www.cs.uky.edu trusty/universe Translation-en_US
Ign http://www.cs.uky.edu trusty/universe Translation-en
Fetched 2,587 kB in 1s (1,946 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  iperf
0 upgraded, 1 newly installed, 0 to remove and 219 not upgraded.
Need to get 56.3 kB of archives.
After this operation, 174 kB of additional disk space will be used.
Get:1 http://www.cs.uky.edu/ubuntu/ trusty/universe iperf amd64 2.0.5-3 [56.3 kB]
Fetched 56.3 kB in 0s (1,983 kB/s)
Selecting previously unselected package iperf.
(Reading database ... 91795 files and directories currently installed.)
Preparing to unpack .../iperf_2.0.5-3_amd64.deb ...
Unpacking iperf (2.0.5-3) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up iperf (2.0.5-3) ...

Start Iperf Server in daemon on node-0

gdcli run -s demo -r UKGENI -n "node-0" -c "iperf -s -D> /dev/null 2>&1"

Start iperf client on node-1

nasir@thirdday:~$ gdcli run -s demo -r UKGENI -n "node-1" -c "iperf -t 30 -c node-0 -b 1000M"
------------------------------------------------------------
Client connecting to node-0, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 10.10.1.2 port 52305 connected with 10.10.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-30.0 sec  2.69 GBytes   771 Mbits/sec
[  3] Sent 1967561 datagrams

nasir@thirdday:~$ gdcli run -s demo -r UKGENI -n "node-1" -c "iperf -t 30 -c node-0 -b 10000M"
------------------------------------------------------------
Client connecting to node-0, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 10.10.1.2 port 53242 connected with 10.10.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-30.0 sec  2.68 GBytes   768 Mbits/sec
[  3] Sent 1959326 datagrams

Fetch graphs for the link in the slice.

gdcli getpng -s demo -r UKGENI  -g linkbytes -l link-0 -n node-0 -o mygraphs

cd into mygraphs directory. You will get two graphs one for each end of the link.