- def _get_vim_account_id(self, nsr_id: str, vnf_member_index: int) -> str:
- vnfr = self.common_db.get_vnfr(nsr_id, vnf_member_index)
- return vnfr['vim-account-id']
-
- def _get_vim_type(self, vim_account_id):
- """Get the vim type that is required by the message."""
- credentials = self.database_manager.get_credentials(vim_account_id)
- return credentials.type
-
- def _init_vim_collector_and_collect(self, vnfr: dict, vim_account_id: str, queue: multiprocessing.Queue):
- # TODO(diazb) Add support for vrops and aws
- vim_type = self._get_vim_type(vim_account_id)
- if vim_type in VIM_COLLECTORS:
- collector = VIM_COLLECTORS[vim_type](vim_account_id)
- collector.collect(vnfr, queue)
- else:
- log.debug("vimtype %s is not supported.", vim_type)
-
- def _init_vca_collector_and_collect(self, vnfr: dict, queue: multiprocessing.Queue):
- vca_collector = VCACollector()
- vca_collector.collect(vnfr, queue)
-