From 8ac177318bab17f91ea10c1aef0be38cd8239e8e Mon Sep 17 00:00:00 2001 From: fujinhua Date: Sat, 11 Feb 2017 15:40:34 +0800 Subject: [PATCH] Add port call of vimdriver Change-Id: Id5bb0229edfc63ccb221e8131a8a24d1b5366c67 Issue-Id: GVNFM-32 Signed-off-by: fujinhua --- lcm/lcm/pub/vimapi/api.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lcm/lcm/pub/vimapi/api.py b/lcm/lcm/pub/vimapi/api.py index a23ee8da..1cdb0273 100644 --- a/lcm/lcm/pub/vimapi/api.py +++ b/lcm/lcm/pub/vimapi/api.py @@ -59,3 +59,27 @@ def get_subnet(vim_id, subnet_id): def list_subnet(vim_id): return call(vim_id, "subnets", "GET") + +def create_port(vim_id, data): + return call(vim_id, "ports", "POST", data) + +def delete_port(vim_id, port_id): + return call(vim_id, "ports/%s" % port_id, "DELETE") + +def get_port(vim_id, port_id): + return call(vim_id, "ports/%s" % port_id, "GET") + +def list_port(vim_id): + return call(vim_id, "ports", "GET") + +def create_flavor(vim_id, data): + return call(vim_id, "flavors", "POST", data) + +def delete_flavor(vim_id, flavor_id): + return call(vim_id, "flavors/%s" % flavor_id, "DELETE") + +def get_flavor(vim_id, flavor_id): + return call(vim_id, "flavors/%s" % flavor_id, "GET") + +def list_flavor(vim_id): + return call(vim_id, "flavors", "GET") -- 2.16.6