+ def _get_terminate_primitive_params(self, seq, vnf_index):
+ primitive = seq.get('name')
+ primitive_params = {}
+ params = {
+ "member_vnf_index": vnf_index,
+ "primitive": primitive,
+ "primitive_params": primitive_params,
+ }
+ desc_params = {}
+ return self._map_primitive_params(seq, params, desc_params)
+
+ def _add_suboperation(self, db_nslcmop, nslcmop_id, vnf_index, vdu_id, vdu_count_index,
+ vdu_name, primitive, mapped_primitive_params):
+ # Create the "_admin.operations" array, or append operation if array already exists
+ key_admin = '_admin'
+ key_operations = 'operations'
+ db_nslcmop_update = {}
+ db_nslcmop_admin = db_nslcmop.get(key_admin, {})
+ op_list = db_nslcmop_admin.get(key_operations)
+ new_op = {'member_vnf_index': vnf_index,
+ 'vdu_id': vdu_id,
+ 'vdu_count_index': vdu_count_index,
+ 'primitive': primitive,
+ 'primitive_params': mapped_primitive_params}
+ if db_nslcmop_admin:
+ if not op_list:
+ # First operation, create key 'operations' with current operation as first list element
+ db_nslcmop_admin.update({key_operations: [new_op]})
+ op_list = db_nslcmop_admin.get(key_operations)
+ else:
+ # Not first operation, append operation to existing list
+ op_list.append(new_op)
+
+ db_nslcmop_update['_admin.operations'] = op_list
+ self.update_db_2("nslcmops", nslcmop_id, db_nslcmop_update)
+