Add openflow-port-mapping CLI command 17/1317/3
authormirabal <leonardo.mirabal@altran.com>
Thu, 16 Mar 2017 10:19:19 +0000 (11:19 +0100)
committermirabal <leonardo.mirabal@altran.com>
Mon, 17 Apr 2017 09:57:00 +0000 (10:57 +0100)
- 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>
httpserver.py
openvim

index 895b300..edf1e8d 100644 (file)
@@ -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 (executable)
--- 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")