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