49bb9e6c356d0b8be100f7ba5bf564dc1a282dfa
[osm/SO.git] / models / plugins / yang / nsd.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 nsd
22 {
23   namespace "urn:ietf:params:xml:ns:yang:nfvo:nsd";
24   prefix "nsd";
25
26   import rw-pb-ext {
27     prefix "rwpb";
28   }
29
30   import vld {
31     prefix "vld";
32   }
33
34   import vnfd {
35     prefix "vnfd";
36   }
37
38   import ietf-inet-types {
39     prefix "inet";
40   }
41
42   import ietf-yang-types {
43     prefix "yang";
44   }
45
46   import mano-types {
47     prefix "manotypes";
48   }
49
50   import rw-project {
51     prefix "rw-project";
52   }
53
54   revision 2017-02-08 {
55     description
56       "Update model to support projects.";
57   }
58
59   revision 2014-10-27 {
60     description
61       "Initial revision. This YANG file defines
62        the Network Service Descriptor (NSD)";
63     reference
64       "Derived from earlier versions of base YANG files";
65   }
66
67   typedef scaling-trigger {
68     type enumeration {
69       enum pre-scale-in {
70         value 1;
71       }
72       enum post-scale-in {
73         value 2;
74       }
75       enum pre-scale-out {
76         value 3;
77       }
78       enum post-scale-out {
79         value 4;
80       }
81     }
82   }
83
84   typedef scaling-policy-type {
85     type enumeration {
86       enum manual {
87         value 1;
88       }
89       enum automatic {
90         value 2;
91       }
92     }
93   }
94
95   typedef scaling-criteria-operation {
96     type enumeration {
97       enum AND {
98         value 1;
99       }
100       enum OR {
101         value 2;
102       }
103     }
104   }
105
106   grouping primitive-parameter {
107     leaf name {
108       description
109           "Name of the parameter.";
110       type string;
111     }
112
113     leaf data-type {
114       description
115           "Data type associated with the name.";
116       type manotypes:parameter-data-type;
117     }
118
119     leaf mandatory {
120       description "Is this field mandatory";
121       type boolean;
122       default false;
123     }
124
125     leaf default-value {
126       description "The default value for this field";
127       type string;
128     }
129
130     leaf parameter-pool {
131       description "NSD Parameter pool name to use for this paramter";
132       type string;
133     }
134   }
135
136   grouping nsd-descriptor-common {
137     leaf id {
138       description "Identifier for the NSD.";
139       type string;
140     }
141
142     leaf name {
143       description "NSD name.";
144       mandatory true;
145       type string;
146     }
147
148     leaf short-name {
149       description "NSD short name.";
150       type string;
151     }
152
153     leaf vendor {
154       description "Vendor of the NSD.";
155       type string;
156     }
157
158     leaf logo {
159       description
160         "File path for  the vendor specific logo. For example icons/mylogo.png.
161          The logo  should be part of the network service";
162       type string;
163     }
164
165     leaf description {
166       description "Description of the NSD.";
167       type string;
168     }
169
170     leaf version {
171       description "Version of the NSD";
172       type string;
173     }
174
175     list connection-point {
176       description
177           "List for external connection points.
178           Each NS has one or more external connection
179           points. As the name implies that external
180           connection points are used for connecting
181           the NS to other NS or to external networks.
182           Each NS exposes these connection points to
183           the orchestrator. The orchestrator can
184           construct network service chains by
185           connecting the connection points between
186           different NS.";
187
188       key "name";
189       leaf name {
190         description
191             "Name of the NS connection point.";
192         type string;
193       }
194
195       leaf type {
196         description
197             "Type of the connection point.";
198         type manotypes:connection-point-type;
199       }
200     }
201
202     list scaling-group-descriptor {
203       description
204           "scaling group descriptor within this network service.
205            The scaling group defines a group of VNFs,
206            and the ratio of VNFs in the network service
207            that is used as target for scaling action";
208
209       key "name";
210
211       leaf name {
212         description "Name of this scaling group.";
213         type string;
214       }
215
216       list scaling-policy {
217
218         key "name";
219
220         leaf name {
221           description
222               "Name of the scaling policy";
223           type string;
224         }
225
226         leaf scaling-type {
227           description
228               "Type of scaling";
229           type scaling-policy-type;
230         }
231
232         leaf enabled {
233           description
234             "Specifies if the scaling policy can be applied";
235           type boolean;
236           default true;
237         }
238
239         leaf scale-in-operation-type {
240           description
241               "Operation to be applied to check between scaling criterias to
242                check if the scale in threshold condition has been met.
243                Defaults to AND";
244           type scaling-criteria-operation;
245           default AND;
246         }
247
248         leaf scale-out-operation-type {
249           description
250               "Operation to be applied to check between scaling criterias to
251                check if the scale out threshold condition has been met.
252                Defauls to OR";
253           type scaling-criteria-operation;
254           default OR;
255         }
256
257         leaf threshold-time {
258           description
259             "The duration for which the criteria must hold true";
260           type uint32;
261           mandatory true;
262         }
263
264         leaf cooldown-time {
265           description
266             "The duration after a scaling-in/scaling-out action has been
267             triggered, for which there will be no further optional";
268           type uint32;
269           mandatory true;
270         }
271
272         list scaling-criteria {
273           description
274               "list of conditions to be met for generating scaling
275                  requests";
276           key "name";
277
278           leaf name {
279             type string;
280           }
281
282           leaf scale-in-threshold {
283             description
284                 "Value below which scale-in requests are generated";
285             type uint64;
286           }
287
288           leaf scale-out-threshold {
289             description
290                 "Value above which scale-out requests are generated";
291             type uint64;
292           }
293
294           leaf ns-monitoring-param-ref {
295             description
296                "Reference to the NS level monitoring parameter
297                 that is aggregated";
298             type leafref {
299               path "../../../../monitoring-param/id";
300             }
301           }
302         }
303       }
304
305       list vnfd-member {
306         description "List of VNFs in this scaling group";
307         key "member-vnf-index-ref";
308
309         leaf member-vnf-index-ref {
310           description "member VNF index of this member VNF";
311           type leafref {
312             path "../../../constituent-vnfd/member-vnf-index";
313           }
314         }
315
316         leaf count {
317           description
318             "count of this member VNF  within this scaling group.
319              The count allows to define  the number of instances
320              when a scaling action targets this scaling group";
321           type uint32;
322           default 1;
323         }
324       }
325
326       leaf min-instance-count {
327         description
328           "Minimum instances of the scaling group which are allowed.
329           These instances are created by default when the network service
330           is instantiated.";
331         type uint32;
332         default 0;
333       }
334
335       leaf max-instance-count {
336         description
337           "Maximum instances of this scaling group that are allowed
338            in a single network service. The network service scaling
339            will fail, when the number of service group instances
340            exceed the max-instance-count specified.";
341         type uint32;
342         default 10;
343       }
344
345       list scaling-config-action {
346         description "List of scaling config actions";
347         key "trigger";
348
349         leaf trigger {
350           description "scaling trigger";
351           type scaling-trigger;
352         }
353
354         leaf ns-config-primitive-name-ref {
355           description "Reference to the NS config name primitive";
356           type leafref {
357             path "../../../service-primitive/name";
358           }
359         }
360       }
361     }
362
363
364     list vnffgd {
365       description
366           "List of VNF Forwarding Graph Descriptors (VNFFGD).";
367
368       key "id";
369
370       leaf id {
371         description
372             "Identifier for the VNFFGD.";
373         type string;
374       }
375
376       leaf name {
377         description
378             "VNFFGD name.";
379         type string;
380       }
381
382       leaf short-name {
383         description
384             "Short name for VNFFGD for UI";
385         type string;
386       }
387
388       leaf vendor {
389         description "Provider of the VNFFGD.";
390         type string;
391       }
392
393       leaf description {
394         description "Description of the VNFFGD.";
395         type string;
396       }
397
398       leaf version {
399         description "Version of the VNFFGD";
400         type string;
401       }
402
403       list rsp {
404         description
405           "List of Rendered Service Paths (RSP).";
406
407         key "id";
408
409         leaf id {
410           description
411             "Identifier for the RSP.";
412           type string;
413         }
414
415         leaf name {
416           description
417             "RSP name.";
418           type string;
419         }
420
421         list vnfd-connection-point-ref {
422           description
423             "A list of references to connection points.";
424           key "member-vnf-index-ref";
425
426           leaf member-vnf-index-ref {
427             description "Reference to member-vnf within constituent-vnfds";
428             type leafref {
429               path "../../../../constituent-vnfd/member-vnf-index";
430             }
431           }
432
433           leaf order {
434             type uint8;
435             description
436               "A number that denotes the order of a VNF in a chain";
437           }
438
439           leaf vnfd-id-ref {
440             description
441               "A reference to a vnfd. This is a
442                   leafref to path:
443                       ../../../../nsd:constituent-vnfd
444                       + [nsd:id = current()/../nsd:id-ref]
445                       + /nsd:vnfd-id-ref
446                   NOTE: An issue with confd is preventing the
447                   use of xpath. Seems to be an issue with leafref
448                   to leafref, whose target is in a different module.
449                   Once that is resovled this will switched to use
450                   leafref";
451              type leafref {
452                 path "../../../../constituent-vnfd" +
453                      "[member-vnf-index = current()/../member-vnf-index-ref]" +
454                      "/vnfd-id-ref";
455              }
456            }
457
458           leaf vnfd-connection-point-ref {
459             description
460               "A reference to a connection point name
461                   in a vnfd. This is a leafref to path:
462                       /vnfd:vnfd-catalog/vnfd:vnfd
463                       + [vnfd:id = current()/../nsd:vnfd-id-ref]
464                       + /vnfd:connection-point/vnfd:name
465                   NOTE: An issue with confd is preventing the
466                   use of xpath. Seems to be an issue with leafref
467                   to leafref, whose target is in a different module.
468                   Once that is resovled this will switched to use
469                   leafref";
470             // TODO: Keeping as string as this needs to be
471             // diffenent lvel based of if it is nsd-catalog or
472             // in nsr.
473             // type leafref {
474             //   path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
475             //        "[vnfd:id = current()/../vnfd-id-ref]/" +
476             //        "vnfd:connection-point/vnfd:name";
477             // }
478             type string;
479           }
480         }
481       } //rsp
482
483       list classifier {
484         description
485             "List of classifier rules.";
486
487         key "id";
488
489         leaf id {
490           description
491               "Identifier for the classifier rule.";
492           type string;
493         }
494
495         leaf name {
496           description
497               "Name of the classifier.";
498           type string;
499         }
500
501         leaf rsp-id-ref {
502           description
503               "A reference to the RSP.";
504           type leafref {
505             path "../../rsp/id";
506           }
507         }
508
509         leaf member-vnf-index-ref {
510           description "Reference to member-vnf within constituent-vnfds";
511           type leafref {
512             path "../../../constituent-vnfd/member-vnf-index";
513           }
514         }
515
516         leaf vnfd-id-ref {
517           description
518               "A reference to a vnfd. This is a
519                   leafref to path:
520                       ../../../nsd:constituent-vnfd
521                       + [nsd:id = current()/../nsd:id-ref]
522                       + /nsd:vnfd-id-ref
523                   NOTE: An issue with confd is preventing the
524                   use of xpath. Seems to be an issue with leafref
525                   to leafref, whose target is in a different module.
526                   Once that is resovled this will switched to use
527                   leafref";
528           type leafref {
529               path "../../../constituent-vnfd" +
530                    "[member-vnf-index = current()/../member-vnf-index-ref]" +
531                    "/vnfd-id-ref";
532           }
533         }
534
535         leaf vnfd-connection-point-ref {
536           description
537               "A reference to a connection point name
538                   in a vnfd. This is a leafref to path:
539                       /vnfd:vnfd-catalog/vnfd:vnfd
540                       + [vnfd:id = current()/../nsd:vnfd-id-ref]
541                       + /vnfd:connection-point/vnfd:name
542                   NOTE: An issue with confd is preventing the
543                   use of xpath. Seems to be an issue with leafref
544                   to leafref, whose target is in a different module.
545                   Once that is resovled this will switched to use
546                   leafref";
547           // TODO: Keeping as string as this needs to be
548           // diffenent lvel based of if it is nsd-catalog or
549           // in nsr.
550           // type leafref {
551           //     path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
552           //          "[vnfd:id = current()/../vnfd-id-ref]/" +
553           //          "vnfd:connection-point/vnfd:name";
554           // }
555           type string;
556         }
557
558         list match-attributes {
559           description
560               "List of match attributes.";
561
562           key "id";
563
564           leaf id {
565             description
566                 "Identifier for the classifier match attribute rule.";
567             type string;
568           }
569
570           leaf ip-proto {
571             description
572                 "IP Protocol.";
573             type uint8;
574           }
575
576           leaf source-ip-address {
577             description
578                 "Source IP address.";
579             type inet:ip-address;
580           }
581
582           leaf destination-ip-address {
583             description
584                 "Destination IP address.";
585             type inet:ip-address;
586           }
587
588           leaf source-port {
589             description
590                 "Source port number.";
591             type inet:port-number;
592           }
593
594           leaf destination-port {
595             description
596                 "Destination port number.";
597             type inet:port-number;
598           }
599           //TODO: Add more match criteria
600         } //match-attributes
601       } // classifier
602     } // vnffgd
603
604     uses manotypes:ip-profile-list;
605
606     uses manotypes:ns-service-primitive;
607
608     list initial-config-primitive {
609       rwpb:msg-new NsdInitialConfigPrimitive;
610       description
611         "Initial set of configuration primitives for NSD.";
612       key "seq";
613
614       uses manotypes:initial-config;
615     }
616
617     uses manotypes:input-parameter-xpath;
618
619     list parameter-pool {
620       description
621         "Pool of parameter values which must be
622          pulled from during configuration";
623       key "name";
624
625       leaf name {
626         description
627             "Name of the configuration value pool";
628         type string;
629       }
630
631       container range {
632         description
633             "Create a range of values to populate the pool with";
634
635         leaf start-value {
636           description
637               "Generated pool values start at this value";
638           type uint32;
639           mandatory true;
640         }
641
642         leaf end-value {
643           description
644               "Generated pool values stop at this value";
645           type uint32;
646           mandatory true;
647         }
648       }
649     }
650
651     list key-pair {
652       key "name";
653       description "Used to configure the list of public keys to be injected as part
654           of ns instantiation";
655
656       leaf name {
657         description "Name of this key pair";
658         type string;
659       }
660
661       leaf key {
662         description "Key associated with this key pair";
663         type string;
664       }
665     }
666
667     list user {
668       key "name";
669       description "List of users to be added through cloud-config";
670
671       leaf name {
672         description "Name of the user ";
673         type string;
674       }
675
676       leaf user-info {
677         description "The user name's real name";
678         type string;
679       }
680
681       list key-pair {
682         key "name";
683         description "Used to configure the list of public keys to be injected as part
684             of ns instantiation";
685
686         leaf name {
687           description "Name of this key pair";
688           type string;
689         }
690
691         leaf key {
692           description "Key associated with this key pair";
693           type string;
694         }
695       }
696     }
697   }
698
699   grouping nsd-vld-common {
700     /* Still having issues modelling this,
701        see the comments under vnfd-connection-point-ref
702     */
703     description
704       "List of Virtual Link Descriptors.";
705
706     leaf id {
707       description
708         "Identifier for the VLD.";
709       type string;
710     }
711
712     leaf name {
713       description
714         "Virtual Link Descriptor (VLD) name.";
715       type string;
716     }
717
718     leaf short-name {
719       description
720         "Short name for VLD for UI";
721       type string;
722     }
723
724     leaf vendor {
725       description "Provider of the VLD.";
726       type string;
727     }
728
729     leaf description {
730       description "Description of the VLD.";
731       type string;
732     }
733
734     leaf version {
735       description "Version of the VLD";
736       type string;
737     }
738
739     leaf type {
740       type manotypes:virtual-link-type;
741     }
742
743     leaf root-bandwidth {
744       description
745         "For ELAN this is the aggregate bandwidth.";
746       type uint64;
747     }
748
749     leaf leaf-bandwidth {
750       description
751         "For ELAN this is the bandwidth of branches.";
752       type uint64;
753     }
754
755     // replicate for pnfd container here
756     uses manotypes:provider-network;
757
758     leaf mgmt-network {
759       description "Flag indicating whether this network is a VIM management network";
760       type boolean;
761       default false;
762     }
763
764     choice init-params {
765       description "Extra parameters for VLD instantiation";
766
767       case vim-network-ref {
768         leaf vim-network-name {
769           description
770             "Name of network in VIM account. This is used to indicate
771                    pre-provisioned network name in cloud account.";
772           type string;
773         }
774       }
775
776       case vim-network-profile {
777         leaf ip-profile-ref {
778           description "Named reference to IP-profile object";
779           type string;
780         }
781       }
782
783     }
784   }
785
786   grouping nsd-vld {
787     list vld {
788
789       key "id";
790
791       uses nsd-vld-common;
792
793       list vnfd-connection-point-ref {
794         description
795             "A list of references to connection points.";
796         key "member-vnf-index-ref vnfd-connection-point-ref";
797
798         leaf member-vnf-index-ref {
799           description "Reference to member-vnf within constituent-vnfds";
800           type leafref {
801             path "../../../constituent-vnfd/member-vnf-index";
802           }
803         }
804
805         leaf vnfd-id-ref {
806           description
807               "A reference to a vnfd. This is a
808                leafref to path:
809                    ../../nsd:constituent-vnfd
810                    + [nsd:id = current()/../nsd:id-ref]
811                    + /nsd:vnfd-id-ref
812                NOTE: An issue with confd is preventing the
813                use of xpath. Seems to be an issue with leafref
814                to leafref, whose target is in a different module.
815                Once that is resovled this will switched to use
816                leafref";
817           type string;
818         }
819
820         leaf vnfd-connection-point-ref {
821           description "A reference to a connection point name";
822           type leafref {
823             path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
824                  "[vnfd:id = current()/../vnfd-id-ref]/" +
825                  "vnfd:connection-point/vnfd:name";
826           }
827         }
828       }
829     }
830   }
831
832   grouping nsr-nsd-vld {
833     list vld {
834
835       key "id";
836
837       uses nsd-vld-common;
838
839       list vnfd-connection-point-ref {
840         description
841             "A list of references to connection points.";
842         key "member-vnf-index-ref vnfd-connection-point-ref";
843
844         leaf member-vnf-index-ref {
845           description "Reference to member-vnf within constituent-vnfds";
846           type leafref {
847             path "../../../constituent-vnfd/member-vnf-index";
848           }
849         }
850
851         leaf vnfd-id-ref {
852           description
853               "A reference to a vnfd. This is a
854                leafref to path:
855                    ../../nsd:constituent-vnfd
856                    + [nsd:id = current()/../nsd:id-ref]
857                    + /nsd:vnfd-id-ref
858                NOTE: An issue with confd is preventing the
859                use of xpath. Seems to be an issue with leafref
860                to leafref, whose target is in a different module.
861                Once that is resovled this will switched to use
862                leafref";
863           type string;
864         }
865
866         leaf vnfd-connection-point-ref {
867           description "A reference to a connection point name";
868           type leafref {
869             path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd" +
870                  "[vnfd:id = current()/../vnfd-id-ref]/" +
871                  "vnfd:connection-point/vnfd:name";
872           }
873         }
874       }
875     }
876   }
877
878   grouping nsd-constituent-vnfd {
879     list constituent-vnfd {
880       description
881           "List of VNFDs that are part of this
882           network service.";
883
884       key "member-vnf-index";
885
886       leaf member-vnf-index {
887         description
888           "Identifier/index for the VNFD. This separate id
889            is required to ensure that multiple VNFs can be
890            part of single NS";
891         type uint64;
892       }
893
894       leaf vnfd-id-ref {
895         description
896           "Identifier for the VNFD.";
897         type leafref {
898           path "../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
899         }
900       }
901
902       leaf start-by-default {
903         description
904           "VNFD is started as part of the NS instantiation";
905         type boolean;
906         default true;
907       }
908     }
909   }
910
911   grouping nsr-nsd-constituent-vnfd {
912     list constituent-vnfd {
913       description
914           "List of VNFDs that are part of this
915           network service.";
916
917       key "member-vnf-index";
918
919       leaf member-vnf-index {
920         description
921           "Identifier/index for the VNFD. This separate id
922            is required to ensure that multiple VNFs can be
923            part of single NS";
924         type uint64;
925       }
926
927       leaf vnfd-id-ref {
928         description
929           "Identifier for the VNFD.";
930         type leafref {
931           path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
932         }
933       }
934
935       leaf start-by-default {
936         description
937           "VNFD is started as part of the NS instantiation";
938         type boolean;
939         default true;
940       }
941     }
942   }
943
944   grouping nsd-placement-groups {
945     list placement-groups {
946       description "List of placement groups at NS level";
947
948       key "name";
949       uses manotypes:placement-group-info;
950
951       list member-vnfd {
952         description
953             "List of VNFDs that are part of this placement group";
954
955         key "member-vnf-index-ref";
956
957         leaf member-vnf-index-ref {
958           description "member VNF index of this member VNF";
959           type leafref {
960             path "../../../constituent-vnfd/member-vnf-index";
961           }
962         }
963
964         leaf vnfd-id-ref {
965           description
966               "Identifier for the VNFD.";
967           type leafref {
968             path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
969           }
970         }
971       }
972     }
973   }
974
975   grouping nsr-nsd-placement-groups {
976     list placement-groups {
977       description "List of placement groups at NS level";
978
979       key "name";
980       uses manotypes:placement-group-info;
981
982       list member-vnfd {
983         description
984             "List of VNFDs that are part of this placement group";
985
986         key "member-vnf-index-ref";
987
988         leaf member-vnf-index-ref {
989           description "member VNF index of this member VNF";
990           type leafref {
991             path "../../../constituent-vnfd/member-vnf-index";
992           }
993         }
994
995         leaf vnfd-id-ref {
996           description
997               "Identifier for the VNFD.";
998           type leafref {
999             path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
1000           }
1001         }
1002       }
1003     }
1004   }
1005
1006   grouping nsd-vnf-dependency {
1007     list vnf-dependency {
1008       description
1009           "List of VNF dependencies.";
1010       key vnf-source-ref;
1011       leaf vnf-source-ref {
1012         type leafref {
1013           path "../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
1014         }
1015       }
1016       leaf vnf-depends-on-ref {
1017         description
1018             "Reference to VNF that sorce VNF depends.";
1019         type leafref {
1020           path "../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
1021         }
1022       }
1023     }
1024   }
1025
1026   grouping nsr-nsd-vnf-dependency {
1027     list vnf-dependency {
1028       description
1029           "List of VNF dependencies.";
1030       key vnf-source-ref;
1031       leaf vnf-source-ref {
1032         type leafref {
1033           path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
1034         }
1035       }
1036       leaf vnf-depends-on-ref {
1037         description
1038             "Reference to VNF that sorce VNF depends.";
1039         type leafref {
1040           path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
1041         }
1042       }
1043     }
1044   }
1045
1046   grouping monitoring-param-common {
1047     // list monitoring-param {
1048     description
1049       "List of monitoring parameters from VNF's that should be
1050         propogated up into NSR";
1051     leaf id {
1052       type string;
1053     }
1054
1055     leaf name {
1056       type string;
1057     }
1058
1059     uses manotypes:monitoring-param-value;
1060     uses manotypes:monitoring-param-ui-data;
1061     uses manotypes:monitoring-param-aggregation;
1062   }
1063
1064   grouping nsd-monitoring-param {
1065
1066     list monitoring-param {
1067       key "id";
1068
1069       uses monitoring-param-common;
1070
1071       list vnfd-monitoring-param {
1072         description "A list of VNFD monitoring params";
1073         key "vnfd-id-ref vnfd-monitoring-param-ref";
1074
1075         leaf vnfd-id-ref {
1076           description
1077             "A reference to a vnfd. This is a
1078               leafref to path:
1079                   ../../../../nsd:constituent-vnfd
1080                   + [nsd:id = current()/../nsd:id-ref]
1081                   + /nsd:vnfd-id-ref
1082               NOTE: An issue with confd is preventing the
1083               use of xpath. Seems to be an issue with leafref
1084               to leafref, whose target is in a different module.
1085               Once that is resolved this will switched to use
1086               leafref";
1087
1088           type yang:uuid;
1089         }
1090
1091         leaf vnfd-monitoring-param-ref {
1092           description "A reference to the VNFD monitoring param";
1093           type leafref {
1094             path "../../../../../vnfd:vnfd-catalog/vnfd:vnfd"
1095               + "[vnfd:id = current()/../vnfd-id-ref]"
1096               + "/vnfd:monitoring-param/vnfd:id";
1097           }
1098         }
1099
1100         leaf-list member-vnf-index-ref {
1101           description
1102             "Optional reference to member-vnf within constituent-vnfds";
1103           type uint64;
1104         }
1105       }
1106     }
1107   }
1108
1109   grouping nsr-nsd-monitoring-param {
1110     list monitoring-param {
1111       key "id";
1112
1113       uses monitoring-param-common;
1114
1115       list vnfd-monitoring-param {
1116         description "A list of VNFD monitoring params";
1117         key "vnfd-id-ref vnfd-monitoring-param-ref";
1118
1119         leaf vnfd-id-ref {
1120           description
1121             "A reference to a vnfd. This is a
1122               leafref to path:
1123                   ../../../../nsd:constituent-vnfd
1124                   + [nsd:id = current()/../nsd:id-ref]
1125                   + /nsd:vnfd-id-ref
1126               NOTE: An issue with confd is preventing the
1127               use of xpath. Seems to be an issue with leafref
1128               to leafref, whose target is in a different module.
1129               Once that is resolved this will switched to use
1130               leafref";
1131
1132           type yang:uuid;
1133         }
1134
1135         leaf vnfd-monitoring-param-ref {
1136           description "A reference to the VNFD monitoring param";
1137           type leafref {
1138             path "../../../../../../vnfd:vnfd-catalog/vnfd:vnfd"
1139               + "[vnfd:id = current()/../vnfd-id-ref]"
1140               + "/vnfd:monitoring-param/vnfd:id";
1141           }
1142         }
1143
1144         leaf-list member-vnf-index-ref {
1145           description
1146             "Optional reference to member-vnf within constituent-vnfds";
1147           type uint64;
1148         }
1149       }
1150     }
1151   }
1152
1153
1154   augment "/rw-project:project" {
1155     container nsd-catalog {
1156
1157       list nsd {
1158         key "id";
1159
1160         uses nsd-descriptor-common;
1161
1162         uses nsd-vld;
1163
1164         uses nsd-constituent-vnfd;
1165
1166         uses nsd-placement-groups;
1167
1168         uses nsd-vnf-dependency;
1169
1170         uses nsd-monitoring-param;
1171       }
1172     }
1173   }
1174 }