a9540663295e3cb162dc2f87c59d558f9288898b
[osm/IM.git] / models / yang / instantiation-parameters.yang
1 //INFORMATION
2 //organization "CTTC";
3 //contact "Pol Alemany, Ricard Vilalta, Juan Luis de la Cruz";
4 //description "Network Slice components definition";
5
6 // MODULE STRUCTURE
7 module instantiation-parameters {
8   //header information
9   yang-version 1;
10   namespace "urn:ietf:params:xml:ns:yang:nfvo:instantiation-parameters";
11   prefix "instantiation-parameters";
12   
13   import rw-project {
14     prefix "rw-project";
15   }
16   
17   import nsd {
18     prefix "nsd";
19   }
20
21   import vnfd {
22     prefix "vnfd";
23   }
24
25   import nsr {
26     prefix "nsr";
27   }
28
29   import ietf-inet-types {
30     prefix "inet";
31   }
32
33   import ietf-yang-types {
34     prefix "ietf-yang";
35   }
36
37   //revision history
38   revision 2018-09-14 {
39     description "Initial version";
40   }
41   //typedef definitions
42   grouping ns_instantiate {
43     leaf nsName {
44       mandatory true;
45       type string;
46     }
47     leaf nsDescription {
48       type string;
49     }
50     leaf nsdId {
51       mandatory true;
52       type leafref {
53         path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
54       }
55     }
56     leaf vimAccountId {
57       mandatory true;
58       type string;
59     }
60     leaf ssh_keys {
61       type string;
62     }
63     leaf nsr_id {
64       config false;
65       type leafref {
66         path "/rw-project:project/nsr:ns-instance-opdata/nsr:nsr/nsr:ns-instance-config-ref";
67       }
68     }
69     list vnf {
70       key "member-vnf-index";
71       uses vnf;
72     }
73     list vld {
74       key "name";
75       uses vld;
76     }
77   }
78   grouping vnf {
79     leaf member-vnf-index{
80       mandatory true;
81       type string;
82     }
83     leaf vimAccountId {
84       type string;
85     }
86     list vdu {
87       key "id";
88       uses ns_instantiate_vdu;
89     }
90     list internal-vld {
91       key "name";
92       uses ns-instantiate-internal-vld;
93     }
94   }
95
96   grouping vld {
97     leaf name {
98       type string;
99     }
100     leaf vim-network-name {
101       type string;
102     }
103     container ip-profile {
104       uses ip-profile-update-schema;
105     }
106     list vnfd-connection-point-ref {
107       key "member-vnf-index-ref vnfd-connection-point-ref";
108       leaf member-vnf-index-ref {
109         type leafref {
110             path "../../../vnf/member-vnf-index";
111         }
112       }
113       leaf vnfd-connection-point-ref {
114         type leafref {
115           path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
116         }
117       }
118       leaf ip-address{
119         type inet:ip-address;
120       }
121     }
122
123   }
124
125   grouping ns_instantiate_vdu {
126     leaf id {
127       mandatory true;
128       type string;
129     }
130     list volume {
131       key "name";
132       leaf name {
133         mandatory true;
134         type string;
135       }
136       leaf vim-volume-id {
137         mandatory true;
138         type string;
139       }
140     }
141     list interface {
142       key "name";
143       leaf name {
144         mandatory true;
145         type string;
146       }
147       leaf ip-address {
148         type inet:ip-address;
149       }
150       leaf mac-address {
151         type ietf-yang:mac-address;
152       }
153       leaf floating-ip-required {
154         type boolean;
155       }
156     }
157   }
158
159   grouping ns-instantiate-internal-vld {
160     leaf name {
161       mandatory true;
162       type string;
163     }
164     leaf vim-network-name {
165       type string; 
166     }
167     container ip-profile {
168       uses ip-profile-update-schema;
169     }
170     list internal-connection-point {
171       key "id-ref";
172       leaf id-ref {
173         mandatory true;
174         type string;
175       }
176       leaf ip-address{
177         type inet:ip-address;
178       }
179     }
180   }
181
182   grouping ip-profile-update-schema { //each leaf/list is either null or something
183     leaf ip-version {
184       type inet:ip-version;
185     }
186     leaf subnet-address {
187       type inet:ip-prefix;
188     }
189     leaf gateway-address {
190       type inet:ip-prefix;
191     }
192     list dns-server {
193       key "address";
194       leaf address {
195         mandatory true;
196         type inet:ip-address;
197       }
198     }
199     container dhcp-params {
200       leaf enabled {
201         type boolean;
202       }
203       leaf count {
204         type uint8; // >=1
205       }
206       leaf start-address {
207         type inet:ip-address;
208       }
209     }
210   }
211   
212   list instantiation-parameters {
213     key "nsName";
214     uses ns_instantiate;
215   }
216
217 }