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