Adding nst.yang and nsi.yang to data model.
[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
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
79   grouping vnf {
80     leaf member-vnf-index{
81       mandatory true;
82       type string;
83     }
84     leaf vimAccountId {
85       type string;
86     }
87     list vdu {
88       key "id";
89       uses ns_instantiate_vdu;
90     }
91     list internal-vld {
92       key "name";
93       uses ns-instantiate-internal-vld;
94     }
95   }
96
97   grouping vld {
98     leaf name {
99       type string;
100     }
101     leaf vim-network-name {
102       type string;
103     }
104     container ip-profile {
105       uses ip-profile-update-schema;
106     }
107     list vnfd-connection-point-ref {
108       key "member-vnf-index-ref vnfd-connection-point-ref";
109       leaf member-vnf-index-ref {
110         type leafref {
111             //path "../../../vnf/member-vnf-index";
112             path "/nsd:nsd-catalog/nsd:nsd/nsd:constituent-vnfd/nsd:member-vnf-index";
113         }
114       }
115       leaf vnfd-connection-point-ref {
116         type leafref {
117           path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
118         }
119       }
120       leaf ip-address{
121         type inet:ip-address;
122       }
123     }
124   }
125
126   grouping ns_instantiate_vdu {
127     leaf id {
128       mandatory true;
129       type string;
130     }
131     list volume {
132       key "name";
133       leaf name {
134         mandatory true;
135         type string;
136       }
137       leaf vim-volume-id {
138         mandatory true;
139         type string;
140       }
141     }
142     list interface {
143       key "name";
144       leaf name {
145         mandatory true;
146         type string;
147       }
148       leaf ip-address {
149         type inet:ip-address;
150       }
151       leaf mac-address {
152         type ietf-yang:mac-address;
153       }
154       leaf floating-ip-required {
155         type boolean;
156       }
157     }
158   }
159
160   grouping ns-instantiate-internal-vld {
161     leaf name {
162       mandatory true;
163       type string;
164     }
165     leaf vim-network-name {
166       type string; 
167     }
168     container ip-profile {
169       uses ip-profile-update-schema;
170     }
171     list internal-connection-point {
172       key "id-ref";
173       leaf id-ref {
174         mandatory true;
175         type string;
176       }
177       leaf ip-address{
178         type inet:ip-address;
179       }
180     }
181   }
182
183   grouping ip-profile-update-schema { //each leaf/list is either null or something
184     leaf ip-version {
185       type inet:ip-version;
186     }
187     leaf subnet-address {
188       type inet:ip-prefix;
189     }
190     leaf gateway-address {
191       type inet:ip-prefix;
192     }
193     list dns-server {
194       key "address";
195       leaf address {
196         mandatory true;
197         type inet:ip-address;
198       }
199     }
200     container dhcp-params {
201       leaf enabled {
202         type boolean;
203       }
204       leaf count {
205         type uint8; // >=1
206       }
207       leaf start-address {
208         type inet:ip-address;
209       }
210     }
211   }
212
213 }