From: mirabal Date: Thu, 16 Mar 2017 10:19:19 +0000 (+0100) Subject: Add openflow-port-mapping CLI command X-Git-Tag: v2.0.0~22 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F17%2F1317%2F3;p=osm%2Fopenvim.git 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 --- 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")