diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2013-02-05 20:10:51 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-02-05 23:38:04 +0900 |
commit | 3c39edc289018258c61d151aa7aa561edfc944d3 (patch) | |
tree | 2ff96da1c63cfe9df039d80811e0f12c60244a44 /bin | |
parent | 021adfb4c1891da66037a6420d3d8e74b1efb878 (diff) |
bin/ryu-client: support switch_conf
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ryu-client | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/ryu-client b/bin/ryu-client index 15e83f28..3d816b8f 100755 --- a/bin/ryu-client +++ b/bin/ryu-client @@ -21,6 +21,7 @@ from optparse import OptionParser from ryu.app.client import TunnelClient from ryu.app.client import OFPClient +from ryu.app.client import SwitchConfClient def client_test(): @@ -37,6 +38,7 @@ def client_test(): address = options.host + ':' + str(options.port) ofp_client = OFPClient(address) tun_client = TunnelClient(address) + sc_client = SwitchConfClient(address) commands = { 'list_nets': lambda a: sys.stdout.write(ofp_client.get_networks()), @@ -62,6 +64,14 @@ def client_test(): a[1], a[2], a[3]), 'update_remote_dpid': lambda a: tun_client.update_remote_dpid( a[1], a[2], a[3]), + + 'sc_list_sw': lambda a: sys.stdout.write(sc_client.list_switches()), + 'sc_delete_sw': lambda a: sc_client.delete_switch(a[1]), + 'sc_list_keys': lambda a: sys.stdout.write(sc_client.list_keys(a[1])), + 'sc_set_key': lambda a: sc_client.set_key(a[1], a[2], a[3]), + 'sc_get_key': lambda a: sys.stdout.write( + sc_client.get_key(a[1], a[2])), + 'sc_delete_key': lambda a: sc_client.delete_key(a[1], a[2]), } # allow '-', instead of '_' |