From 38cf60728eb2467162ef1623b537b8bae3340b61 Mon Sep 17 00:00:00 2001 From: mirabal Date: Thu, 16 Mar 2017 11:19:19 +0100 Subject: [PATCH] Add openflow-port-mapping CLI command - Add openflow-port-mapping cli command to openvim - Minor funtion description changes in httpserver Change-Id: Ib2cf6dfa791f95d3263f38af5d0b7db3d4d29011 Signed-off-by: mirabal --- httpserver.py | 4 ++-- openvim | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/httpserver.py b/httpserver.py index 895b300..edf1e8d 100644 --- a/httpserver.py +++ b/httpserver.py @@ -2356,7 +2356,7 @@ def http_delete_port_id(port_id): @bottle.route(url_base + '/openflow/mapping', method='POST') def http_of_port_mapping(): """ - Insert a tenant into the database. + Create new compute port mapping entry :return: """ my = config_dic['http_threads'][threading.current_thread().name] @@ -2384,7 +2384,7 @@ def http_of_port_mapping(): @bottle.route(url_base + '/openflow/mapping', method='GET') def get_of_port_mapping(): """ - Insert a tenant into the database. + Get compute port mapping :return: """ my = config_dic['http_threads'][threading.current_thread().name] diff --git a/openvim b/openvim index 58d6ff0..524e348 100755 --- a/openvim +++ b/openvim @@ -861,6 +861,9 @@ def openflow_action(args): if args.action=='port-list': url = "http://%s:%s/openvim/networks/openflow/ports" %(vim_config["HOST"], vim_config["PORT"]) r,c = vim_read(url) + elif args.action == 'port-mapping': + url = "http://%s:%s/openvim/openflow/mapping" % (vim_config["HOST"], vim_config["PORT"]) + r, c = vim_read(url) elif args.action=='rules-list' or args.action=='reinstall': PORT = vim_config["PORT"] if args.action=='reinstall': @@ -1013,6 +1016,9 @@ if __name__=="__main__": #openflow rules openflow_list_action = subparsers.add_parser("openflow-port-list", help="list openflow switch ports name") openflow_list_action.set_defaults(func=openflow_action, action="port-list") + + openflow_list_action = subparsers.add_parser("openflow-port-mapping-list", help="list computes port mapping") + openflow_list_action.set_defaults(func=openflow_action, action="port-mapping") openflow_list_action = subparsers.add_parser("openflow-clear-all", help="removes all openflow rules") openflow_list_action.set_defaults(func=openflow_action, action="clear-all") -- 2.17.1