Sync Common folder
[transportpce.git] / ordmodels / network / src / main / yang / ietf-network@2015-06-08.yang
1 module ietf-network {
2   yang-version 1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-network";
4   prefix nd;
5
6   import ietf-inet-types {
7     prefix inet;
8   }
9
10   organization "TBD";
11   contact
12     "WILL-BE-DEFINED-LATER";
13   description
14     "This module defines a common base model for a collection 
15      of nodes in a network. Node definitions s are further used
16      in network topologies and inventories.";
17
18   revision 2015-06-08 {
19     description
20       "Initial revision.";
21     reference "draft-ietf-i2rs-yang-network-topo-01";
22   }
23
24   typedef node-id {
25     type inet:uri;
26     description
27       "Identifier for a node.";
28   }
29
30   typedef network-id {
31     type inet:uri;
32     description
33       "Identifier for a network.";
34   }
35
36   grouping network-ref {
37     description
38       "Contains the information necessary to reference a network,
39        for example an underlay network.";
40     leaf network-ref {
41       type leafref {
42         path "/network/network-id";
43       }
44       description
45         "Used to reference a network, for example an underlay
46          network.";
47     }
48   }
49
50   grouping node-ref {
51     description 
52       "Contains the information necessary to reference a node.";
53     leaf node-ref {
54       type leafref {
55         path "/network[network-id=current()/../network-ref]"+
56           "/node/node-id";
57       }
58       description
59         "Used to reference a node.  
60          Nodes are identified relative to the network they are
61          contained in.";
62     }
63     uses network-ref;
64   }
65
66   list network {
67     key "network-id";
68     description
69       "Describes a network.
70        A network typically contains an inventory of nodes,
71        topological information (augmented through 
72        network-topology model), as well as layering 
73        information.";
74     container network-types {
75       description
76         "Serves as an augmentation target.  
77          The network type is indicated through corresponding
78          presence containers augmented into this container.";
79     }
80     leaf network-id {
81       type network-id;
82       description
83         "Identifies a network.";
84     }
85     leaf server-provided {
86       type boolean;
87       config false;
88       description
89         "Indicates whether the information concerning this
90          particular network is populated by the server 
91          (server-provided true, the general case for network 
92          information discovered from the server), 
93          or whether it is configured by a client 
94          (server-provided true, possible e.g. for 
95          service overlays managed through a controller).";
96     }
97     list supporting-network {
98       key "network-ref";
99       description
100         "An underlay network, used to represent layered network
101          topologies.";
102       leaf network-ref {
103         type leafref {
104           path "/network/network-id";
105         }
106         description
107           "References the underlay network.";
108       }
109     }
110     list node {
111       key "node-id";
112       description
113         "The inventory of nodes of this network.";
114       leaf node-id {
115         type node-id;
116         description
117           "Identifies a node uniquely within the containing 
118            network.";
119       }
120       list supporting-node {
121         key "network-ref node-ref";
122         description
123           "Represents another node, in an underlay network, that 
124            this node is supported by.  Used to represent layering 
125            structure.";
126         leaf network-ref {
127           type leafref {
128             path "../../../supporting-network/network-ref";
129           }
130           description
131             "References the underlay network that the 
132              underlay node is part of.";
133         }
134         leaf node-ref {
135           type leafref {
136             path "/network/node/node-id";
137           }
138           description
139             "References the underlay node itself.";
140         }
141       }
142     }
143   }
144 }