a8f4dc8f0e8130ce2f07ea054b640d21ad173e14
[smo/teiv.git] /
1 module o-ran-smo-teiv-common-yang-extensions {
2     yang-version 1.1;
3     namespace "urn:o-ran:smo-teiv-common-yang-extensions";
4     prefix or-teiv-yext;
5
6     organization "ORAN";
7     contact "The Authors";
8     description
9     "Topology and Inventory YANG extensions model.
10
11     Copyright (C) 2024 Ericsson
12     Modifications Copyright (C) 2024 OpenInfra Foundation Europe
13
14     This model contains extensions to the YANG language that topology and
15     inventory models will use to define and annotate types and relationships.";
16
17     revision "2024-05-14" {
18         description "Initial revision.";
19         or-teiv-yext:label 0.3.0;
20     }
21
22     extension biDirectionalTopologyRelationship {
23         description
24             "Defines a bi-directional relationship in the topology.
25
26             A bi-directional-association (BDA) is a relationship comprising of an
27             A-side and a B-side. The A-side is considered the originating side of
28             the relationship; the B-side is considered the terminating side of the
29             relationship. The order of A-side and B-side is of importance and MUST
30             NOT be changed once defined.
31
32             Both A-side and B-side are defined on a type, and are given a role. A
33             type may have multiple originating and/or terminating sides of a
34             relationship, all distinguished by role name.
35
36             The statement MUST only be a substatement of the 'module' statement.
37             Multiple 'bi-directional-topology-relationship' statements are allowed
38             per parent statement.
39
40             Substatements to the 'bi-directional-topology-relationship' define the
41             A-side and the B-side, respectively, and optionally properties of the
42             relationship. Data nodes of types 'leaf' and 'leaf-list' are used for
43             this purpose. One of the data nodes MUST be annotated with the 'a-side'
44             extension; another data node MUST be annotated with the 'b-side'
45             extension. Other data nodes define properties of the relationship.
46
47             The argument is the name of the relationship. The relationship name is
48             scoped to the namespace of the declaring module and MUST be unique
49             within the scope.";
50
51         argument relationshipName;
52     }
53
54     extension aSide {
55         description
56             "Defines the A-side of a relationship.
57
58             The statement MUST only be a substatement of a 'leaf' or 'leaf-list'
59             statement, which itself must be a substatement of the
60             'uni-directional-topology-relationship' statement.
61
62             The data type of the parent 'leaf' or 'leaf-list' MUST be
63             'instance-identifier'. Constraints MAY be used as part of the parent
64             'leaf' or 'leaf-list' to enforce cardinality.
65
66             The identifier of the parent 'leaf' or 'leaf-list' is used as name of
67             the role of the A-side of the relationship. The name of the role is
68             scoped to the type on which the A-side is defined and MUST be unique
69             within the scope.
70
71             While the parent 'leaf' or 'leaf-list' does not result in a property of
72             the relationship, it is RECOMMENDED to avoid using the name of an
73             existing type property as role name to avoid potential ambiguities
74             between properties of a type, and roles of a relationship on the type.
75
76             The argument is the name of the type on which the A-side resides. If the
77             type is declared in another module, the type must be prefixed, and a
78             corresponding 'import' statement be used to declare the prefix.";
79
80         argument aSideType;
81     }
82
83     extension bSide {
84         description
85             "Defines the B-side of a relationship.
86
87             The statement MUST only be a substatement of a 'leaf' or 'leaf-list'
88             statement, which itself must be a substatement of the
89             'uni-directional-topology-relationship' statement.
90
91             The data type of the parent 'leaf' or 'leaf-list' MUST be
92             'instance-identifier'. Constraints MAY be used as part of the parent
93             'leaf' or 'leaf-list' to enforce cardinality.
94
95             The identifier of the parent 'leaf' or 'leaf-list' is used as name of
96             the role of the B-side of the relationship. The name of the role is
97             scoped to the type on which the B-side is defined and MUST be unique
98             within the scope.
99
100             While the parent 'leaf' or 'leaf-list' does not result in a property of
101             the relationship, it is RECOMMENDED to avoid using the name of an
102             existing type property as role name to avoid potential ambiguities
103             between properties of a type, and roles of a relationship on the type.
104
105             The argument is the name of the type on which the B-side resides. If the
106             type is declared in another module, the type must be prefixed, and a
107             corresponding 'import' statement be used to declare the prefix.";
108
109         argument bSideType;
110     }
111
112     extension domain {
113         description "Keyword used to carry domain information.";
114         argument domainName;
115     }
116
117     extension label {
118         description
119             "The label can be used to give modules and submodules a semantic version, in addition to their revision.
120
121             The format of the label is ā€˜x.y.z’ ā€“ expressed as pattern, it is [0-9]+\\.[0-9]+\\.[0-9]+
122
123             The statement MUST only be a substatement of the revision statement.  Zero or one revision label statements
124             per parent statement are allowed.
125
126             Revision labels MUST be unique amongst all revisions of a module or submodule.";
127
128         argument semversion;
129     }
130 }