diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2013-02-05 20:10:55 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-02-05 23:38:04 +0900 |
commit | 670e2b46b0c53e488f6fabe118164719a01ceff1 (patch) | |
tree | 411d24d82cfe01eef8f91a4391bf3522ab7dc046 | |
parent | 1bf4e885ccf2f329c7b6b086990169f32d9dc87c (diff) |
bin/ryu-client: teach quantum iface rest api
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rwxr-xr-x | bin/ryu-client | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/ryu-client b/bin/ryu-client index 3d816b8f..292ee261 100755 --- a/bin/ryu-client +++ b/bin/ryu-client @@ -19,9 +19,10 @@ import sys from optparse import OptionParser -from ryu.app.client import TunnelClient from ryu.app.client import OFPClient +from ryu.app.client import QuantumIfaceClient from ryu.app.client import SwitchConfClient +from ryu.app.client import TunnelClient def client_test(): @@ -39,6 +40,7 @@ def client_test(): ofp_client = OFPClient(address) tun_client = TunnelClient(address) sc_client = SwitchConfClient(address) + qi_client = QuantumIfaceClient(address) commands = { 'list_nets': lambda a: sys.stdout.write(ofp_client.get_networks()), @@ -72,6 +74,19 @@ def client_test(): '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]), + + 'qi_list_iface': lambda a: sys.stdout.write(qi_client.list_ifaces()), + 'qi_delete_iface': lambda a: qi_client.delete_iface(a[1]), + 'qi_list_keys': lambda a: sys.stdout.write( + qi_client.list_keys(a[1])), + 'qi_create_key': lambda a: qi_client.create_network_id( + a[1], a[2], a[3]), + 'qi_update_key': lambda a: qi_client.update_network_id( + a[1], a[2], a[3]), + 'qi_get_net_id': lambda a: sys.stdout.write( + qi_client.get_network_id(a[1])), + 'qi_create_net_id': lambda a: qi_client.create_network_id(a[1], a[2]), + 'qi_update_net_id': lambda a: qi_client.update_network_id(a[1], a[2]), } # allow '-', instead of '_' |