20ba6f7e498bb46de3e414ae2e73aa83bca07604
[osm/SO.git] / models / plugins / yang / vlr.yang
1
2 /*
3  * 
4  *   Copyright 2016 RIFT.IO Inc
5  *
6  *   Licensed under the Apache License, Version 2.0 (the "License");
7  *   you may not use this file except in compliance with the License.
8  *   You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *   Unless required by applicable law or agreed to in writing, software
13  *   distributed under the License is distributed on an "AS IS" BASIS,
14  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *   See the License for the specific language governing permissions and
16  *   limitations under the License.
17  *
18  *
19  */
20
21 module vlr
22 {
23   namespace "urn:ietf:params:xml:ns:yang:nfvo:vlr";
24   prefix "vlr";
25
26   import rw-pb-ext {
27     prefix "rwpb";
28   }
29
30   import ietf-inet-types {
31     prefix "inet";
32   }
33
34   import ietf-yang-types {
35     prefix "yang";
36   }
37
38   import mano-types {
39     prefix "manotypes";
40   }
41
42   import vld {
43     prefix "vld";
44   }
45
46   revision 2015-09-10 {
47     description
48       "Initial revision. This YANG file defines
49        the Virtual Link Record (VLR)";
50     reference
51       "Derived from earlier versions of base YANG files";
52   }
53
54   container vlr-catalog {
55     config false;
56
57     list vlr {
58       key "id";
59       unique "name";
60
61       leaf id {
62         description "Identifier for the VLR.";
63         type yang:uuid;
64       }
65
66       leaf name {
67         description "VLR name.";
68         type string;
69       }
70
71       leaf nsr-id-ref {
72         description 
73             "NS instance identifier. 
74              This is a leafref /nsr:ns-instance-config/nsr:nsr/nsr:id";
75         type yang:uuid;
76       }
77
78       leaf vld-ref {
79         description
80           "Reference to VLD
81            /nsr:ns-instance-config/nsr:nsr[nsr:id=../nsr-id-ref]/nsd/vld:vld/vld:id";
82         type string;
83       }
84
85       leaf res-id {
86         description "Identifier for resmgr id mapping";
87         type yang:uuid;
88       }
89
90       leaf short-name {
91         description "Short name for VLR for UI";
92         type string;
93       }
94
95       leaf vendor {
96         description "Provider of the VLR.";
97         type string;
98       }
99
100       leaf description {
101         description "Description of the VLR.";
102         type string;
103       }
104
105       leaf version {
106         description "Version of the VLR";
107         type string;
108       }
109
110       leaf type {
111         type manotypes:virtual-link-type;
112       }
113
114       leaf root-bandwidth {
115         description
116             "For ELAN this is the aggregate bandwidth.";
117         type uint64;
118       }
119
120       leaf leaf-bandwidth {
121         description
122             "For ELAN this is the bandwidth of branches.";
123         type uint64;
124       }
125
126       leaf create-time {
127         description
128           "Creation timestamp of this Virtual Link.
129           The timestamp is expressed as seconds 
130           since unix epoch - 1970-01-01T00:00:00Z";
131
132         type uint32;
133       }
134
135       leaf uptime {
136         description
137           "Active period of this Virtual Link.
138           Uptime is expressed in seconds";
139
140         type uint32;
141       }
142
143       leaf network-id {
144         description 
145             "Identifier for the allocated network resource.";
146         type string;
147       }
148
149       leaf vim-network-name {
150         description
151             "Name of network in VIM account. This is used to indicate
152             pre-provisioned network name in cloud account.";
153         type string;
154       }
155
156       // replicate for pnfd container here
157
158       uses manotypes:provider-network;
159       uses manotypes:ip-profile-info;
160       
161       leaf status {
162         description
163             "Status of the virtual link record.";
164         type enumeration {
165           enum LINK_UP;
166           enum DEGRADED;
167           enum LINK_DOWN;
168         }
169       }
170       leaf operational-status {
171         description
172           "The operational status of the Virtual Link
173             init                 : The VL is in init stat.
174             vl-alloc-pending     : The VL alloc is pending in VIM
175             running              : The VL is up  and running in VM
176             vl-terminate-pending : The VL is being terminated in VIM.
177             terminated           : The VL is terminated in the VM.
178             failed               : The VL instantiation failed in VIM.
179           ";
180
181         type enumeration {
182           rwpb:enum-type "VlOperationalStatus";
183           enum init;
184           enum vl-alloc-pending;
185           enum running;
186           enum vl-terminate-pending;
187           enum terminated;
188           enum failed;
189         }
190       }
191     }
192   }
193 }
194