Add OpenROADM 7.1.0 device and common models
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-dhcp@2020-05-29.yang
1 module org-openroadm-dhcp {
2   namespace "http://org/openroadm/dhcp";
3   prefix org-openroadm-dhcp;
4
5   import org-openroadm-device {
6     prefix org-openroadm-device;
7     revision-date 2020-05-29;
8   }
9   import ietf-inet-types {
10     prefix ietf-inet-types;
11     revision-date 2013-07-15;
12   }
13
14   organization
15     "Open ROADM MSA";
16   contact
17     "OpenROADM.org";
18   description
19     "YANG definitions for dhcp protocol.
20
21
22      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
23      All other rights reserved.
24
25      Redistribution and use in source and binary forms, with or without modification,
26      are permitted provided that the following conditions are met:
27
28      * Redistributions of source code must retain the above copyright notice, this
29        list of conditions and the following disclaimer.
30      * Redistributions in binary form must reproduce the above copyright notice,
31        this list of conditions and the following disclaimer in the documentation and/or
32        other materials provided with the distribution.
33      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
34        contributors may be used to endorse or promote products derived from this software
35        without specific prior written permission.
36
37      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
38      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
39      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
40      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
41      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
43      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46      POSSIBILITY OF SUCH DAMAGE.";
47
48   revision 2020-05-29 {
49     description
50       "Version 7.1.0";
51   }
52   revision 2020-03-27 {
53     description
54       "Version 7.0.0";
55   }
56   revision 2019-11-29 {
57     description
58       "Version 6.1.0";
59   }
60   revision 2019-09-27 {
61     description
62       "Version 6.0.0";
63   }
64   revision 2019-05-31 {
65     description
66       "Version 5.1.0";
67   }
68   revision 2019-03-29 {
69     description
70       "Version 5.0.0";
71   }
72   revision 2018-11-30 {
73     description
74       "Version 4.1.0";
75   }
76   revision 2018-09-28 {
77     description
78       "Version 4.0.0";
79   }
80   revision 2018-05-30 {
81     description
82       "Version 3.1.0";
83   }
84   revision 2017-03-16 {
85     description
86       "Version 3.0";
87   }
88
89   grouping dhcp-relay {
90     container ipv4-dhcp-relay {
91       list ipv4-server-group {
92         key "server-group-name";
93         description
94           "DHCP server group configuration that DHCP relays to";
95         leaf server-group-name {
96           type string;
97           description
98             "Name of the server-group";
99         }
100         leaf-list interface-name {
101           type leafref {
102             path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
103           }
104           description
105             "Name of the interface";
106         }
107         leaf-list server-address {
108           type ietf-inet-types:ipv4-address;
109           description
110             "List of IPv4 server addresses";
111         }
112       }
113     }
114     container ipv6-dhcp-relay {
115       list ipv6-server-group {
116         key "server-group-name";
117         description
118           "DHCP server group configuration that DHCP relays to";
119         leaf server-group-name {
120           type string;
121           description
122             "Name of the server-group";
123         }
124         leaf-list interface-name {
125           type leafref {
126             path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
127           }
128           description
129             "Name of the interface";
130         }
131         leaf-list server-address {
132           type ietf-inet-types:ipv6-address;
133           description
134             "List of IPv6 server addresses";
135         }
136       }
137     }
138   }
139
140   augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
141     when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='xpdr'";
142     uses dhcp-relay;
143   }
144 }