From 4f3146d29eaccf31bd67e455dc672ce2cb1cc689 Mon Sep 17 00:00:00 2001 From: Mahesh Jethanandani Date: Tue, 5 Feb 2019 17:47:11 -0800 Subject: [PATCH] Fix for bug#133 --- src/yang/etsi-nfv-ns.yang | 91 ++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/src/yang/etsi-nfv-ns.yang b/src/yang/etsi-nfv-ns.yang index 8e77ebe..b244e35 100644 --- a/src/yang/etsi-nfv-ns.yang +++ b/src/yang/etsi-nfv-ns.yang @@ -146,63 +146,66 @@ submodule etsi-nfv-ns { "GS NFV IFA014: Section 6.2.3.2 Sapd information element"; } - leaf virtual-link-desc { - type leafref { - path "../../virtual-link-desc/id"; + choice cpd-or-virtual-link { + leaf virtual-link-desc { + type leafref { + path "../../virtual-link-desc/id"; + } + description + "References the descriptor of the NS VL instance to + which the SAP instantiated from this SAPD connects to."; + reference + "GS NFV IFA014: Section 6.2.3.2 Sapd information element"; } - description - "References the descriptor of the NS VL instance to - which the SAP instantiated from this SAPD connects to."; - reference - "GS NFV IFA014: Section 6.2.3.2 Sapd information element"; - } - choice associated-cpd-id { - container vnf { - leaf vnfd-id { - mandatory true; - type leafref { - path "../../../../nfv:vnfd/nfv:id"; + choice associated-cpd-id { + container vnf { + leaf vnfd-id { + mandatory true; + type leafref { + path "../../../../nfv:vnfd/nfv:id"; + } + must "boolean(../../../vnfd-id[.=current()])"; } - must "boolean(../../../vnfd-id[.=current()])"; - } - leaf ext-cpd-id { - mandatory true; - type leafref { - path "deref(../vnfd-id)/../nfv:ext-cpd/nfv:id"; + leaf ext-cpd-id { + mandatory true; + type leafref { + path "deref(../vnfd-id)/../nfv:ext-cpd/nfv:id"; + } } } - } - container pnf { - leaf pnfd-id { - mandatory true; + + container pnf { + leaf pnfd-id { + mandatory true; type leafref { - path "../../../../nfv:pnfd/nfv:id"; + path "../../../../nfv:pnfd/nfv:id"; + } + must "boolean(../pnfd-id[.=current()])"; } - must "boolean(../pnfd-id[.=current()])"; - } - leaf ext-cpd-id { - mandatory true; - type leafref { - path "deref(../pnfd-id)/../nfv:ext-cpd/nfv:id"; + leaf ext-cpd-id { + mandatory true; + type leafref { + path "deref(../pnfd-id)/../nfv:ext-cpd/nfv:id"; + } } } - } - container ns { - leaf nsd-id { - mandatory true; - type leafref { - path "../../../../nfv:nsd/nfv:id"; + container ns { + leaf nsd-id { + mandatory true; + type leafref { + path "../../../../nfv:nsd/nfv:id"; + } + must "boolean(../nsd-id[.=current()])"; } - must "boolean(../nsd-id[.=current()])"; - } - leaf ext-cpd-id { - mandatory true; - type leafref { - path "deref(../nsd-id)/../nfv:sapd/nfv:id"; + leaf ext-cpd-id { + mandatory true; + type leafref { + path "deref(../nsd-id)/../nfv:sapd/nfv:id"; + } } } } -- GitLab