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 <leonardo.mirabal@altran.com>
diff --git a/httpserver.py b/httpserver.py
index 895b300..edf1e8d 100644
--- a/httpserver.py
+++ b/httpserver.py
@@ -2356,7 +2356,7 @@
@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 @@
@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 @@
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 @@
#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")