diff options
-rw-r--r-- | opera/__init__.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | opera/deploy_vnf.py | 0 | ||||
-rwxr-xr-x | opera/openo_connect.py | 14 |
3 files changed, 14 insertions, 0 deletions
diff --git a/opera/__init__.py b/opera/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/opera/__init__.py diff --git a/opera/deploy_vnf.py b/opera/deploy_vnf.py index b9703a0..b9703a0 100644..100755 --- a/opera/deploy_vnf.py +++ b/opera/deploy_vnf.py diff --git a/opera/openo_connect.py b/opera/openo_connect.py index aa50562..9412f72 100755 --- a/opera/openo_connect.py +++ b/opera/openo_connect.py @@ -13,6 +13,7 @@ import sys import os import time import requests +import re import json from datetime import datetime from pprint import pprint @@ -86,6 +87,19 @@ def get_vim_id(msb_ip, vim_type): return vimId +def get_vnfm_ip(msb_ip): + vnfm_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vnfms/' + get_vnfm = request_get(vnfm_url) + vnfm_url = '' + for i in get_vnfm: + if i["type"] == "jujuvnfm": + vnfm_url = i["url"] + break + ip = re.compile("\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}") + vnfm_ip = re.findall(ip, vnfm_url)[0] + return vnfm_ip + + def add_openo_vim(msb_ip, auth_url): vim_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vims/' vnfm_url = 'http://' + msb_ip + '/openoapi/extsys/v1/vnfms/' |