edc93f416bf9f2d73455f4382bfe035bcb049424
[osm/IM.git] / augments / kdu.yang
1 /*
2   Copyright 2020 Whitestack LLC
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13   implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16 */
17
18 module kdu {
19     yang-version 1.1;
20     namespace "urn:etsi:osm:yang:augments:kdu";
21     prefix "kdu";
22
23     import etsi-nfv-vnfd {
24         prefix vnfd;
25     }
26
27     import common-augments {
28         prefix common;
29     }
30
31     grouping extended-ext-cpd {
32         leaf k8s-cluster-net {
33             description
34               "Reference to the K8s cluster network
35                to which CPs instantiated from this external CP
36                Descriptor (CPD) connect.";
37             type leafref {
38                 path "/vnfd:vnfd/kdu:k8s-cluster/kdu:nets/kdu:id";
39             }
40         }
41     }
42
43     grouping extended-kdu-configuration {
44         list kdu-configuration {
45             key "id";
46             leaf id {
47                 description
48                   "Internal identifier for the KDU configuration";
49                 type string;
50             }
51             uses common:vnfc-configuration;
52             uses common:vdu-config-access;
53
54             leaf-list blacklist-config-primitive {
55                 description
56                   "List of blacklisted config primitives from the list of
57                    default kdu config primitives";
58
59                 type enumeration {
60                     enum upgrade;
61                     enum rollback;
62                 }
63             }
64         }
65     }
66
67     grouping extended-kdu {
68         list kdu {
69             description
70               "List of K8s Deployment Units";
71             key "name";
72
73             leaf name {
74                 description
75                   "Unique name for the KDU";
76                 type string;
77             }
78
79             leaf description {
80                 description
81                   "Description of the KDU.";
82                 type string;
83             }
84
85             container kdu-model {
86                 leaf kdu-model-type {
87                     description
88                       "Indicates the KDU model, either as a helm-chart or as a juju-bundle.";
89
90                     type enumeration {
91                         enum helm-chart;
92                         enum juju-bundle;
93                     }
94                 }
95
96                 leaf kdu-model-locator {
97                     description
98                       "Indicates the KDU model location, either as a path to a folder in the 
99                        package or as a URL where to fetch the model.";
100
101                     type string;
102                 }
103             }
104         }
105
106         container k8s-cluster {
107             leaf-list version {
108                 description
109                   "List of supported K8s versions.
110                    The cluster where the KDUs will be deployed will have to match
111                    one of these versions.";
112
113                 type string;
114             }
115
116             leaf-list cni {
117                 description
118                   "List of supported CNI plugins.
119                    The cluster where the KDUs will be deployed will have to use
120                    one of these CNI plugins.";
121
122                 type enumeration {
123                     enum calico;
124                     enum flannel;
125                     enum multus;
126                 }
127             }
128
129             list nets {
130                 description
131                   "List of required networks in the K8s cluster.
132                    The cluster where the KDUs will be deployed will have to use
133                    one of these CNI plugins.";
134
135                 key "id";
136
137                 leaf id {
138                     description
139                       "Internal identifier for the K8s cluster network in this VNF";
140                     type string;
141                 }
142             }
143         }
144     }
145
146     augment "/vnfd:vnfd" {
147         uses extended-kdu;
148         uses extended-kdu-configuration;
149     }
150
151     augment "/vnfd:vnfd/vnfd:ext-cpd/vnfd:cp-connection" {
152         uses extended-ext-cpd;
153     }
154 }