self.nsd.monitoring_param.append(nsd_monp)
param_id += 1
+ def get_vnfd_id(self, index):
+ for cv in self.nsd.constituent_vnfd:
+ if cv.member_vnf_index == index:
+ return cv.vnfd_id_ref
+
def add_conf_param_map(self):
nsd = self.nsd
confparam_map = nsd.config_parameter_map.add()
confparam_map.id = '1'
confparam_map.config_parameter_source.member_vnf_index_ref = 2
+ confparam_map.config_parameter_source.vnfd_id_ref = self.get_vnfd_id(2)
confparam_map.config_parameter_source.config_parameter_source_ref = 'service_ip'
confparam_map.config_parameter_request.member_vnf_index_ref = 1
+ confparam_map.config_parameter_request.vnfd_id_ref = self.get_vnfd_id(1)
confparam_map.config_parameter_request.config_parameter_request_ref = 'pong_ip'
confparam_map = nsd.config_parameter_map.add()
confparam_map.id = '2'
confparam_map.config_parameter_source.member_vnf_index_ref = 2
+ confparam_map.config_parameter_source.vnfd_id_ref = self.get_vnfd_id(2)
confparam_map.config_parameter_source.config_parameter_source_ref = 'service_port'
confparam_map.config_parameter_request.member_vnf_index_ref = 1
+ confparam_map.config_parameter_request.vnfd_id_ref = self.get_vnfd_id(1)
confparam_map.config_parameter_request.config_parameter_request_ref = 'pong_port'
def compose(self, vnfd_list, cpgroup_list, mano_ut,
path "../../../constituent-vnfd/member-vnf-index";
}
}
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../nsd:constituent-vnfd
+ + [nsd:id = current()/../nsd:id-ref]
+ + /nsd:vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ type leafref {
+ path "../../../constituent-vnfd[member-vnf-index = current()/../member-vnf-index-ref]/vnfd-id-ref";
+ }
+ }
leaf config-parameter-request-ref {
description "Reference to the request in the VNF
with the specified member-vnf-index";
type leafref {
- path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:config-parameter/vnfd:config-parameter-request/vnfd:name";
+ path
+ "/vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = current()/../vnfd-id-ref]" +
+ "/vnfd:config-parameter/vnfd:config-parameter-request/vnfd:name";
}
}
}
path "../../../constituent-vnfd/member-vnf-index";
}
}
+ leaf vnfd-id-ref {
+ description
+ "A reference to a vnfd. This is a
+ leafref to path:
+ ../../nsd:constituent-vnfd
+ + [nsd:id = current()/../nsd:id-ref]
+ + /nsd:vnfd-id-ref
+ NOTE: An issue with confd is preventing the
+ use of xpath. Seems to be an issue with leafref
+ to leafref, whose target is in a different module.
+ Once that is resovled this will switched to use
+ leafref";
+ type leafref {
+ path "../../../constituent-vnfd[member-vnf-index = current()/../member-vnf-index-ref]/vnfd-id-ref";
+ }
+ }
leaf config-parameter-source-ref {
description "Reference to the source in the VNF
with the specified member-vnf-index";
type leafref {
- path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:config-parameter/vnfd:config-parameter-source/vnfd:name";
+ path
+ "/vnfd:vnfd-catalog/vnfd:vnfd[vnfd:id = current()/../vnfd-id-ref]" +
+ "/vnfd:config-parameter/vnfd:config-parameter-source/vnfd:name";
}
}
}