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