aboutsummaryrefslogtreecommitdiffstats
path: root/lcm/pub/msapi/aai.py
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-09-08 13:52:13 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-09-08 13:57:52 +0800
commit81e431e0fbc9ab3a3b476e4cd8fb2a255d90eaf1 (patch)
tree2d1cc9abadc5290e841711573ad0640593e2f74a /lcm/pub/msapi/aai.py
parent9b7ccbd778edbe84fb7d83c1b280b7ba2320461d (diff)
Update lcm extsys query vnfm by id
Change-Id: Id1d0da493d22228540212e52810063b9b03275ea Issue-ID: VFC-315 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm/pub/msapi/aai.py')
-rw-r--r--lcm/pub/msapi/aai.py36
1 files changed, 4 insertions, 32 deletions
diff --git a/lcm/pub/msapi/aai.py b/lcm/pub/msapi/aai.py
index 6779e1d0..251f8e0f 100644
--- a/lcm/pub/msapi/aai.py
+++ b/lcm/pub/msapi/aai.py
@@ -29,15 +29,17 @@ def call_aai(resource, method, content=''):
'X-FromAppId': 'VFC-NFVO-LCM',
'X-TransactionId': str(uuid.uuid1())
}
+ resource = resource + "?depth=all"
return restcall.call_req(base_url=AAI_BASE_URL,
user=AAI_USER,
passwd=AAI_PASSWD,
- auth_type=restcall.rest_no_auth,
- resource=resource + "?depth=all",
+ auth_type=0,
+ resource=resource,
method=method,
content=content,
additional_headers=additional_headers)
+
def create_ns_aai(global_customer_id, service_type, service_instance_id, data):
resource = "/business/customers/customer/%s/service-subscriptions/service-subscription/" \
"%s/service-instances/service-instance/%s" % \
@@ -184,36 +186,6 @@ def delete_ns_relationship(global_customer_id, service_type, service_instance_id
return json.JSONDecoder().decode(ret[1])
-def get_vnfm_by_id(vnfm_inst_id):
- uri = '/external-system/esr-vnfm-list/esr-vnfm/%s' % vnfm_inst_id
- ret = call_aai(uri, "GET")
- if ret[0] > 0:
- logger.error('Send get VNFM information request to extsys failed.')
- raise NSLCMException('Send get VNFM information request to extsys failed.')
- # convert vnfm_info_aai to internal vnfm_info
- vnfm_info_aai = json.JSONDecoder().decode(ret[1])
- vnfm_info = convert_vnfm_info(vnfm_info_aai)
- return vnfm_info
-
-def convert_vnfm_info(vnfm_info_aai):
- esr_system_info = ignore_case_get(ignore_case_get(vnfm_info_aai, "esr-system-info-list"), "esr-system-info")
- vnfm_info = {
- "vnfmId": vnfm_info_aai["vnfm-id"],
- "name": vnfm_info_aai["vnfm-id"],
- "type": ignore_case_get(esr_system_info[0], "type"),
- "vimId": vnfm_info_aai["vim-id"],
- "vendor": ignore_case_get(esr_system_info[0], "vendor"),
- "version": ignore_case_get(esr_system_info[0], "version"),
- "description": "vnfm",
- "certificateUrl": vnfm_info_aai["certificate-url"],
- "url": ignore_case_get(esr_system_info[0], "service-url"),
- "userName": ignore_case_get(esr_system_info[0], "user-name"),
- "password": ignore_case_get(esr_system_info[0], "password"),
- "createTime": "2016-07-06 15:33:18"
- }
- return vnfm_info
-
-
def split_vim_to_owner_region(vim_id):
split_vim = vim_id.split('_')
cloud_owner = split_vim[0]