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