616bad0bae80095e4de2140284898e5a573fd8a5
[osm/IM.git] / models / yang / vlr.yang
1
2 /*
3  * 
4  *   Copyright 2016-2017 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-yang-types {
31     prefix "yang";
32   }
33
34   import mano-types {
35     prefix "manotypes";
36   }
37
38   import rw-project {
39     prefix "rw-project";
40   }
41
42   revision 2017-02-08 {
43     description
44       "Update model to support projects.";
45   }
46
47   revision 2015-09-10 {
48     description
49       "Initial revision. This YANG file defines
50        the Virtual Link Record (VLR)";
51     reference
52       "Derived from earlier versions of base YANG files";
53   }
54
55   augment "/rw-project:project" {
56     container vlr-catalog {
57       config false;
58
59       list vlr {
60         key "id";
61         unique "name";
62
63         leaf id {
64           description "Identifier for the VLR.";
65           type yang:uuid;
66         }
67
68         leaf name {
69           description "VLR name.";
70           type string;
71         }
72
73         leaf nsr-id-ref {
74           description
75             "NS instance identifier. 
76              This is a leafref /rw-project:project/nsr:ns-instance-config/nsr:nsr/nsr:id";
77           type yang:uuid;
78         }
79
80         leaf vld-ref {
81           description
82             "Reference to VLD
83            /rw-project:project/nsr:ns-instance-config/nsr:nsr[nsr:id=../nsr-id-ref]
84            /nsd/vld:vld/vld:id";
85           type string;
86         }
87
88         leaf res-id {
89           description "Identifier for resmgr id mapping";
90           type yang:uuid;
91         }
92
93         leaf short-name {
94           description "Short name to appear as label in the UI";
95           type string;
96         }
97
98         leaf vendor {
99           description "Provider of the VLR.";
100           type string;
101         }
102
103         leaf description {
104           description "Description of the VLR.";
105           type string;
106         }
107
108         leaf version {
109           description "Version of the VLR";
110           type string;
111         }
112
113         leaf type {
114           type manotypes:virtual-link-type;
115         }
116
117         leaf root-bandwidth {
118           description
119             "For ELAN this is the aggregate bandwidth.";
120           type uint64;
121         }
122
123         leaf leaf-bandwidth {
124           description
125             "For ELAN this is the bandwidth of branches.";
126           type uint64;
127         }
128
129         leaf create-time {
130           description
131             "Creation timestamp of this Virtual Link.
132           The timestamp is expressed as seconds 
133           since unix epoch - 1970-01-01T00:00:00Z";
134
135           type uint32;
136         }
137
138         leaf uptime {
139           description
140             "Active period of this Virtual Link.
141           Uptime is expressed in seconds";
142
143           type uint32;
144         }
145
146         leaf network-id {
147           description
148             "Identifier for the allocated network resource.";
149           type string;
150         }
151
152         leaf vim-network-name {
153           description
154             "Name of network in VIM account. This is used to indicate
155             pre-provisioned network name in cloud account.";
156           type string;
157         }
158
159         // replicate for pnfd container here
160
161         uses manotypes:provider-network;
162         uses manotypes:ip-profile-info;
163       
164         leaf status {
165           description
166             "Status of the virtual link record.";
167           type enumeration {
168             enum LINK_UP;
169             enum DEGRADED;
170             enum LINK_DOWN;
171           }
172         }
173         leaf operational-status {
174           description
175             "The operational status of the Virtual Link
176             init                 : The VL is in init stat.
177             vl-alloc-pending     : The VL alloc is pending in VIM
178             running              : The VL is up  and running in VM
179             vl-terminate-pending : The VL is being terminated in VIM.
180             terminated           : The VL is terminated in the VM.
181             failed               : The VL instantiation failed in VIM.
182           ";
183
184           type enumeration {
185             rwpb:enum-type "VlOperationalStatus";
186             enum init;
187             enum vl-alloc-pending;
188             enum running;
189             enum vl-terminate-pending;
190             enum terminated;
191             enum failed;
192           }
193         }
194       }
195     }
196   }
197 }
198