Merge from OSM SO master
[osm/SO.git] / models / plugins / yang / vld.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 vld
22 {
23   namespace "urn:ietf:params:xml:ns:yang:nfvo:vld";
24   prefix "vld";
25
26   import rw-pb-ext {
27     prefix "rwpb";
28   }
29
30   import project-vnfd {
31     prefix "project-vnfd";
32   }
33
34   import ietf-inet-types {
35     prefix "inet";
36   }
37
38   import ietf-yang-types {
39     prefix "yang";
40   }
41
42   import mano-types {
43     prefix "manotypes";
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 Descriptor (VLD)";
59     reference
60       "Derived from earlier versions of base YANG files";
61   }
62
63   augment "/rw-project:project" {
64     container vld-catalog {
65
66       list vld {
67         key "id";
68
69         leaf id {
70           description "Identifier for the VLD.";
71           type yang:uuid;
72         }
73
74         leaf name {
75           description "Virtual Link Descriptor (VLD) name.";
76           type string;
77         }
78
79         leaf short-name {
80           description "Short name for VLD for UI";
81           type string;
82         }
83
84         leaf vendor {
85           description "Provider of the VLD.";
86           type string;
87         }
88
89         leaf description {
90           description "Description of the VLD.";
91           type string;
92         }
93
94         leaf version {
95           description "Version of the VLD";
96           type string;
97         }
98
99         leaf type {
100           type manotypes:virtual-link-type;
101         }
102
103         leaf root-bandwidth {
104           description
105             "For ELAN this is the aggregate bandwidth.";
106           type uint64;
107         }
108
109         leaf leaf-bandwidth {
110           description
111             "For ELAN this is the bandwidth of branches.";
112           type uint64;
113         }
114
115         list vnfd-connection-point-ref {
116           description
117             "A list of references to connection points.";
118           key "vnfd-ref member-vnf-index-ref";
119
120           leaf vnfd-ref {
121             description "A reference to a vnfd";
122             type leafref {
123               path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
124             }
125           }
126
127           leaf member-vnf-index-ref {
128             description
129               "A reference to the consituent-vnfd id in nsd. 
130               Should have been a leafref to:
131                 '/rw-project:project/project-nsd:nsd-catalog:/nsd/constituent-vnfd/member-vnf-index-ref'.
132               Instead using direct leaf to avoid circular reference.";
133             type uint64;
134           }
135
136           leaf vnfd-connection-point-ref {
137             description
138               "A reference to a connection point name in a vnfd";
139             type leafref {
140               path "../../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd"
141                 + "[project-vnfd:id = current()/../vld:vnfd-ref]"
142                 + "/project-vnfd:connection-point/project-vnfd:name";
143             }
144           }
145         }
146
147         // replicate for pnfd container here
148         uses manotypes:provider-network;
149       }
150     }
151   }
152 }