diff --git a/src/yang/etsi-nfv-ns.yang b/src/yang/etsi-nfv-ns.yang index 8e77ebe3d285743d5e53d618b767459b5f627e34..b244e35b304d1c0895f63e3f1709943b8d123f71 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"; + } } } }