Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 1 | module ietf-network { |
| 2 | // yang-version 1.1; |
| 3 | yang-version 1; |
| 4 | namespace "urn:ietf:params:xml:ns:yang:ietf-network"; |
| 5 | prefix nd; |
| 6 | import ietf-inet-types { |
| 7 | prefix inet; |
| 8 | } |
| 9 | organization |
| 10 | "IETF I2RS (Interface to the Routing System) Working Group"; |
| 11 | contact |
| 12 | "WG Web: <http: tools.ietf.org/wg/i2rs/> |
| 13 | WG List: <mailto:i2rs@ietf.org> |
| 14 | WG Chair: Susan Hares |
| 15 | <mailto:shares@ndzh.com> |
| 16 | WG Chair: Jeffrey Haas |
| 17 | <mailto:jhaas@pfrc.org> |
| 18 | Editor: Alexander Clemm |
| 19 | <mailto:alex@cisco.com> |
| 20 | Editor: Jan Medved |
| 21 | <mailto:jmedved@cisco.com> |
| 22 | Editor: Robert Varga |
| 23 | <mailto:rovarga@cisco.com> |
| 24 | Editor: Tony Tkacik |
| 25 | <mailto:ttkacik@cisco.com> |
| 26 | Editor: Nitin Bahadur |
| 27 | <mailto:nitin_bahadur@yahoo.com> |
| 28 | Editor: Hariharan Ananthakrishnan |
| 29 | <mailto:hari@packetdesign.com>"; |
| 30 | description |
| 31 | "This module defines a common base model for a collection |
| 32 | of nodes in a network. Node definitions are further used |
| 33 | in network topologies and inventories. |
| 34 | Copyright (c) 2015 IETF Trust and the persons identified as |
| 35 | authors of the code. All rights reserved. |
| 36 | Redistribution and use in source and binary forms, with or |
| 37 | without modification, is permitted pursuant to, and subject |
| 38 | to the license terms contained in, the Simplified BSD License |
| 39 | set forth in Section 4.c of the IETF Trust's Legal Provisions |
| 40 | Relating to IETF Documents |
| 41 | (http: trustee.ietf.org/license-info). |
| 42 | This version of this YANG module is part of |
| 43 | draft-ietf-i2rs-yang-network-topo-02; |
| 44 | see the RFC itself for full legal notices. |
| 45 | NOTE TO RFC EDITOR: Please replace above reference to |
| 46 | draft-ietf-i2rs-yang-network-topo-02 with RFC |
| 47 | number when published (i.e. RFC xxxx)."; |
| 48 | revision 2015-12-08 { |
| 49 | description |
| 50 | "Initial revision. |
| 51 | NOTE TO RFC EDITOR: Please replace the following reference |
| 52 | to draft-ietf-i2rs-yang-network-topo-02 with |
| 53 | RFC number when published (i.e. RFC xxxx)."; |
| 54 | reference |
| 55 | "draft-ietf-i2rs-yang-network-topo-02"; |
| 56 | } |
| 57 | typedef node-id { |
| 58 | type inet:uri; |
| 59 | description |
| 60 | "Identifier for a node."; |
| 61 | } |
| 62 | typedef network-id { |
| 63 | type inet:uri; |
| 64 | description |
| 65 | "Identifier for a network."; |
| 66 | } |
| 67 | grouping network-ref { |
| 68 | description |
| 69 | "Contains the information necessary to reference a network, |
| 70 | for example an underlay network."; |
| 71 | leaf network-ref { |
| 72 | type leafref { |
| 73 | path "/nd:networks/nd:network/nd:network-id"; |
| 74 | require-instance false; |
| 75 | } |
| 76 | description |
| 77 | "Used to reference a network, for example an underlay |
| 78 | network."; |
| 79 | } |
| 80 | } |
| 81 | grouping node-ref { |
| 82 | description |
| 83 | "Contains the information necessary to reference a node."; |
| 84 | leaf node-ref { |
| 85 | type leafref { |
| 86 | path "/nd:networks/nd:network[nd:network-id=current()/../"+ |
| 87 | "network-ref]/nd:node/nd:node-id"; |
| 88 | require-instance false; |
| 89 | } |
| 90 | description |
| 91 | "Used to reference a node. |
| 92 | Nodes are identified relative to the network they are |
| 93 | contained in."; |
| 94 | } |
| 95 | uses network-ref; |
| 96 | } |
| 97 | container networks { |
| 98 | description |
| 99 | "Serves as top-level container for a list of networks."; |
| 100 | list network { |
| 101 | key "network-id"; |
| 102 | description |
| 103 | "Describes a network. |
| 104 | A network typically contains an inventory of nodes, |
| 105 | topological information (augmented through |
| 106 | network-topology model), as well as layering |
| 107 | information."; |
| 108 | container network-types { |
| 109 | description |
| 110 | "Serves as an augmentation target. |
| 111 | The network type is indicated through corresponding |
| 112 | presence containers augmented into this container."; |
| 113 | } |
| 114 | leaf network-id { |
| 115 | type network-id; |
| 116 | description |
| 117 | "Identifies a network."; |
| 118 | } |
| 119 | list supporting-network { |
| 120 | key "network-ref"; |
| 121 | description |
| 122 | "An underlay network, used to represent layered network |
| 123 | topologies."; |
| 124 | leaf network-ref { |
| 125 | type leafref { |
| 126 | path "/networks/network/network-id"; |
| 127 | require-instance false; |
| 128 | } |
| 129 | description |
| 130 | "References the underlay network."; |
| 131 | } |
| 132 | } |
| 133 | list node { |
| 134 | key "node-id"; |
| 135 | description |
| 136 | "The inventory of nodes of this network."; |
| 137 | leaf node-id { |
| 138 | type node-id; |
| 139 | description |
| 140 | "Identifies a node uniquely within the containing |
| 141 | network."; |
| 142 | } |
| 143 | list supporting-node { |
| 144 | key "network-ref node-ref"; |
| 145 | description |
| 146 | "Represents another node, in an underlay network, that |
| 147 | this node is supported by. Used to represent layering |
| 148 | structure."; |
| 149 | leaf network-ref { |
| 150 | type leafref { |
| 151 | path "../../../supporting-network/network-ref"; |
| 152 | require-instance false; |
| 153 | } |
| 154 | description |
| 155 | "References the underlay network that the |
| 156 | underlay node is part of."; |
| 157 | } |
| 158 | leaf node-ref { |
| 159 | type leafref { |
| 160 | path "/networks/network/node/node-id"; |
| 161 | require-instance false; |
| 162 | } |
| 163 | description |
| 164 | "References the underlay node itself."; |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | container networks-state { |
| 171 | config false; |
| 172 | description |
| 173 | "Serves as top-level container for a list of state information |
| 174 | for networks"; |
| 175 | list network { |
| 176 | key "network-ref"; |
| 177 | description |
| 178 | "Data nodes representing operational data and state of |
| 179 | networks. |
| 180 | An instance is automatically created for every network |
| 181 | in the corresponding list under the networks container."; |
| 182 | uses network-ref; |
| 183 | leaf server-provided { |
| 184 | type boolean; |
| 185 | description |
| 186 | "Indicates whether the information concerning this |
| 187 | particular network is populated by the server |
| 188 | (server-provided true, the general case for network |
| 189 | information discovered from the server), |
| 190 | or whether it is configured by a client |
| 191 | (server-provided true, possible e.g. for |
| 192 | service overlays managed through a controller)."; |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | } |