X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fsol005%2Fns.py;fp=osmclient%2Fsol005%2Fns.py;h=b6ccb9fe124ac75c94bcb2cc4590e65c694224e9;hb=961145b6c1ab65c8cc5953aae008781e285c1461;hp=d457cbd8774cf469fb959726f26344fbe4a94f10;hpb=8fdbc7b94c475febecf9896d9ea1e715f82c3daa;p=osm%2Fosmclient.git diff --git a/osmclient/sol005/ns.py b/osmclient/sol005/ns.py index d457cbd..b6ccb9f 100644 --- a/osmclient/sol005/ns.py +++ b/osmclient/sol005/ns.py @@ -181,6 +181,10 @@ class Ns(object): vim_account_id[vim_account] = vim["_id"] return vim["_id"] + def get_vca_id(vim_id): + vim = self._client.vim.get(vim_id) + return vim.get("vca") + def get_wim_account_id(wim_account): self._logger.debug("") # wim_account can be False (boolean) to indicate not use wim account @@ -194,11 +198,15 @@ class Ns(object): wim_account_id[wim_account] = wim["_id"] return wim["_id"] + vim_id = get_vim_account_id(account) + vca_id = get_vca_id(vim_id) ns = {} ns["nsdId"] = nsd["_id"] ns["nsName"] = nsr_name ns["nsDescription"] = description - ns["vimAccountId"] = get_vim_account_id(account) + ns["vimAccountId"] = vim_id + if vca_id: + ns["vcaId"] = vca_id # ns['userdata'] = {} # ns['userdata']['key1']='value1' # ns['userdata']['key2']='value2'