0417bef704d2a26ab01d11bcb9adb69c5b3ae20c
[osm/IM.git] / models / yang / instantiation-parameters.yang
1 /*
2  *
3  *   Copyright 2018 CTTC
4  *   Copyright 2018 Telefonica Investigacion y Desarrollo S.A.U.
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 instantiation-parameters {
22   //header information
23   yang-version 1;
24   namespace "urn:etsi:osm:yang:instantiation-parameters";
25   prefix "instantiation-parameters";
26   
27   import nsd {
28     prefix "nsd";
29   }
30
31   import vnfd {
32     prefix "vnfd";
33   }
34
35   import ietf-inet-types {
36     prefix "inet";
37   }
38
39   import ietf-yang-types {
40     prefix "ietf-yang";
41   }
42   
43   //revision history
44   revision 2018-09-14 {
45     description "Initial version";
46   }
47
48   grouping ns_params {
49     leaf vimAccountId {
50       mandatory true;
51       type string;
52     }
53     leaf ssh_keys {
54       type string;
55     }
56     list vnf {
57       key "member-vnf-index";
58       uses vnf_params;
59     }
60     list vld {
61       key "name";
62       uses vld_params;
63     }
64   }
65
66   grouping vnf_params {
67     leaf member-vnf-index{
68       mandatory true;
69       type string;
70     }
71     leaf vimAccountId {
72       type string;
73     }
74     list vdu {
75       key "id";
76       uses vdu_params;
77     }
78     list internal-vld {
79       key "name";
80       uses internal_vld_params;
81     }
82   }
83
84   grouping vld_common_params {
85     leaf name {
86       type string;
87     }
88     leaf vim-network-name {
89       type string;
90     }
91     container ip-profile {
92       uses ip-profile-update-schema;
93     }
94   }
95
96   grouping vld_params {
97     uses vld_common_params;
98     list vnfd-connection-point-ref {
99       key "member-vnf-index-ref vnfd-connection-point-ref";
100       leaf member-vnf-index-ref {
101         type leafref {
102             //path "../../../vnf/member-vnf-index";
103             path "/nsd:nsd-catalog/nsd:nsd/nsd:constituent-vnfd/nsd:member-vnf-index";
104         }
105       }
106       leaf vnfd-connection-point-ref {
107         type leafref {
108           path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
109         }
110       }
111       leaf ip-address{
112         type inet:ip-address;
113       }
114     }
115   }
116
117   grouping vdu_params {
118     leaf id {
119       mandatory true;
120       type string;
121     }
122     list volume {
123       key "name";
124       leaf name {
125         mandatory true;
126         type string;
127       }
128       leaf vim-volume-id {
129         mandatory true;
130         type string;
131       }
132     }
133     list interface {
134       key "name";
135       leaf name {
136         mandatory true;
137         type string;
138       }
139       leaf ip-address {
140         type inet:ip-address;
141       }
142       leaf mac-address {
143         type ietf-yang:mac-address;
144       }
145       leaf floating-ip-required {
146         type boolean;
147       }
148     }
149   }
150
151   grouping internal_vld_params {
152     leaf name {
153       mandatory true;
154       type string;
155     }
156     leaf vim-network-name {
157       type string; 
158     }
159     container ip-profile {
160       uses ip-profile-update-schema;
161     }
162     list internal-connection-point {
163       key "id-ref";
164       leaf id-ref {
165         mandatory true;
166         type string;
167       }
168       leaf ip-address{
169         type inet:ip-address;
170       }
171     }
172   }
173
174   grouping ip-profile-update-schema { //each leaf/list is either null or something
175     leaf ip-version {
176       type inet:ip-version;
177     }
178     leaf subnet-address {
179       type inet:ip-prefix;
180     }
181     leaf gateway-address {
182       type inet:ip-prefix;
183     }
184     list dns-server {
185       key "address";
186       leaf address {
187         mandatory true;
188         type inet:ip-address;
189       }
190     }
191     container dhcp-params {
192       leaf enabled {
193         type boolean;
194       }
195       leaf count {
196         type uint8; // >=1
197       }
198       leaf start-address {
199         type inet:ip-address;
200       }
201     }
202   }
203
204 }