+++ /dev/null
-/*
- Copyright 2020 Whitestack LLC
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-module configuration {
- yang-version 1.1;
- namespace "urn:etsi:osm:yang:configuration";
- prefix "configuration";
-
- import etsi-nfv-vnfd {
- prefix vnfd;
- }
-
- import day1-2 {
- prefix day1-2;
- }
-
- grouping extended-vnf-configuration {
- leaf vnf-configuration-id {
- description
- "Reference for the VNF configuration to use in this DF";
- type leafref {
- path "/vnfd:vnfd/day1-2:vnf-configuration/day1-2:id";
- }
- }
- }
-
- grouping extended-vdu-configuration {
- leaf vdu-configuration-id {
- description
- "Reference for the VDU configuration to use in this DF";
- type leafref {
- path "/vnfd:vnfd/day1-2:vdu-configuration/day1-2:id";
- }
- }
- }
-
- augment "/vnfd:vnfd/vnfd:df" {
- uses extended-vnf-configuration;
- }
-
- augment "/vnfd:vnfd/vnfd:df/vnfd:vdu-profile" {
- uses extended-vdu-configuration;
- }
-}
}
grouping extended-vnf-configuration {
- list vnf-configuration {
+ list day1-2 {
key "id";
leaf id {
description
- "Internal identifier for the VNF configuration";
+ "Internal identifier for the VNF/VDU/KNF/KDU configuration";
type string;
}
uses common:vnfc-configuration;
uses common:vnfc-relations;
uses common:vdu-config-access;
- }
- }
- grouping extended-vdu-configuration {
- list vdu-configuration {
- key "id";
- leaf id {
+ leaf-list blacklist-config-primitive {
description
- "Internal identifier for the VDU configuration";
- type string;
+ "List of blacklisted config primitives from the list of
+ default kdu config primitives";
+
+ type enumeration {
+ enum upgrade;
+ enum rollback;
+ }
}
- uses common:vnfc-configuration;
- uses common:vdu-config-access;
}
}
- augment "/vnfd:vnfd" {
+ augment "/vnfd:vnfd/vnfd:df/vnfd:lcm-operations-configuration/vnfd:operate-vnf-op-config" {
uses extended-vnf-configuration;
}
-
- augment "/vnfd:vnfd" {
- uses extended-vdu-configuration;
- }
}
\ No newline at end of file
prefix vnfd;
}
- import common-augments {
- prefix common;
- }
-
grouping extended-ext-cpd {
leaf k8s-cluster-net {
description
}
}
- grouping extended-kdu-configuration {
- container kdu-configuration {
- uses common:vnfc-configuration;
- uses common:vdu-config-access;
-
- leaf-list blacklist-config-primitive {
- description
- "List of blacklisted config primitives from the list of
- default kdu config primitives";
-
- type enumeration {
- enum upgrade;
- enum rollback;
- }
- }
- }
- }
-
grouping extended-kdu {
list kdu {
description
}
}
}
-
- uses extended-kdu-configuration;
-
}
container k8s-cluster {
description
"Reference to the VNF config primitive";
type leafref {
- path "/vnfd:vnfd/day1-2:vnf-configuration/day1-2:config-primitive/day1-2:name";
+ path "/vnfd:vnfd/vnfd:df/vnfd:lcm-operations-configuration/vnfd:operate-vnf-op-config/day1-2:day1-2/day1-2:config-primitive/day1-2:name";
}
}
}
vdu_level = _get_instantiation_level_vdu_level_from_im_vdu(vdu)
if vdu.get("vdu-configuration"):
vdu_configuration = vdu["vdu-configuration"]
- vdu_configuration["id"] = "{}-vdu-configuration".format(vdu["id"])
+ vdu_configuration["id"] = vdu["id"]
vdu_configurations.append(vdu_configuration)
df["vdu-profile"].append(vdu_profile)
df["instantiation-level"][0]["vdu-level"].append(vdu_level)
if len(ext_cpds) > 0:
sol006_vnfd["ext-cpd"] = ext_cpds
if len(vdu_configurations) > 0:
- sol006_vnfd["vdu-configuration"] = vdu_configurations
+ _prepare_dict_entries_for_configurations(sol006_vnfd)
+ sol006_vnfd["df"][0]["lcm-operations-configuration"]["operate-vnf-op-config"]["day1-2"].extend(vdu_configurations)
def _add_im_vdu_images_to_sol006_vdu(im_vdu, sol006_vdu):
sgd_min_instances = int(scaling_group_descriptor.get("min-instance-count", 0))
vdu_profile["min-number-of-instances"] = sgd_min_instances + initial_instances
vdu_profile["max-number-of-instances"] = sgd_max_instances + initial_instances
- if im_vdu.get("vdu-configuration"):
- vdu_profile["vdu-configuration-id"] = "{}-vdu-configuration".format(im_vdu["id"])
return vdu_profile
if int_cpd["id"] == sol006_int_cpd_id:
int_cpd["int-virtual-link-desc"] = ivld["id"]
+def _prepare_dict_entries_for_configurations(sol006_vnfd):
+ sol006_vnfd["df"] = sol006_vnfd.get("df", [{}])
+ if not sol006_vnfd["df"][0].get("lcm-operations-configuration"):
+ sol006_vnfd["df"][0]["lcm-operations-configuration"] = {
+ "operate-vnf-op-config": {
+ "day1-2": []
+ }
+ }
def _add_im_vnf_configuration_to_sol006_vnfd(im_vnfd, sol006_vnfd):
vnf_configuration = im_vnfd.get("vnf-configuration")
if not vnf_configuration:
return
- vnf_configuration["id"] = "default-vnf-configuration"
- sol006_vnfd["vnf-configuration"] = [vnf_configuration]
- sol006_vnfd["df"][0]["vnf-configuration-id"] = vnf_configuration["id"]
+ vnf_configuration["id"] = im_vnfd.get("id")
+ _prepare_dict_entries_for_configurations(sol006_vnfd)
+ sol006_vnfd["df"][0]["lcm-operations-configuration"]["operate-vnf-op-config"]["day1-2"].append(vnf_configuration)
def _add_im_ip_profiles_to_sol006_vnfd(im_vnfd, sol006_vnfd):
def _add_im_kdus_to_sol006_vnfd(im_vnfd, sol006_vnfd):
if im_vnfd.get("kdu"):
sol006_vnfd["kdu"] = im_vnfd["kdu"]
+ kdu_configs = []
+ for a_kdu in sol006_vnfd["kdu"]:
+ if "kdu-configuration" in a_kdu:
+ kdu_config = a_kdu.pop("kdu-configuration")
+ kdu_config["id"] = a_kdu["name"]
+ kdu_configs.append(kdu_config)
if len(sol006_vnfd.get("df", ())) == 0:
sol006_vnfd["df"] = [{"id": "default-df"}]
+ if len(kdu_configs) > 0:
+ _prepare_dict_entries_for_configurations(sol006_vnfd)
+ sol006_vnfd["df"][0]["lcm-operations-configuration"]["operate-vnf-op-config"]["day1-2"].extend(kdu_configs)
+
def _add_im_k8s_clusters_to_sol006_vnfd(im_vnfd, sol006_vnfd):
df:
- id: default-df
- vnf-configuration-id: default-vnf-configuration
vdu-profile:
- id: mgmtVM
min-number-of-instances: 1
vnf-config-primitive-name-ref: touch
- trigger: pre-scale-in
vnf-config-primitive-name-ref: touch
-
- vnf-configuration:
- - id: default-vnf-configuration
- initial-config-primitive:
- - seq: "1"
- name: config
- parameter:
- - name: ssh-hostname
- value: <rw_mgmt_ip>
- - name: ssh-username
- value: ubuntu
- - name: ssh-password
- value: osm4u
- - seq: "2"
- name: touch
- parameter:
- - name: filename
- value: <touch_filename>
- config-primitive:
- - name: touch
- parameter:
- - data-type: STRING
- default-value: <touch_filename2>
- name: filename
- juju:
- charm: simple
+ lcm-operations-configuration:
+ operate-vnf-op-config:
+ day1-2:
+ - id: hackfest3charmed-vnf
+ initial-config-primitive:
+ - seq: "1"
+ name: config
+ parameter:
+ - name: ssh-hostname
+ value: <rw_mgmt_ip>
+ - name: ssh-username
+ value: ubuntu
+ - name: ssh-password
+ value: osm4u
+ - seq: "2"
+ name: touch
+ parameter:
+ - name: filename
+ value: <touch_filename>
+ config-primitive:
+ - name: touch
+ parameter:
+ - data-type: STRING
+ default-value: <touch_filename2>
+ name: filename
+ juju:
+ charm: simple
\ No newline at end of file
type: PARAVIRT
df:
- id: default-df
- vnf-configuration-id: default-vnf-configuration
vdu-profile:
- id: spgwmme
min-number-of-instances: 1
- id: hss
min-number-of-instances: 1
- vdu-configuration-id: hss-vdu-configuration
instantiation-level:
- id: default-instantiation-level
vdu-level:
ip-version: ipv4
cidr: 10.0.6.0/24
dhcp-enabled: true
- vdu-configuration:
- - id: hss-vdu-configuration
- initial-config-primitive:
- - seq: "1"
- name: config
- parameter:
- - name: ssh-hostname
- value: <rw_mgmt_ip>
- - name: ssh-username
- value: ubuntu
- - name: ssh-password
- value: <password>
- - seq: "2"
- name: configure-hss
- parameter:
- - name: spgw-ip
- data-type: STRING
- value: <spgw_ip>
- - name: hss-ip
- data-type: STRING
- value: <hss_ip>
- - seq: "3"
- name: restart-hss
- juju:
- charm: hsscharm
- vnf-configuration:
- - id: default-vnf-configuration
- initial-config-primitive:
- - seq: "1"
- name: config
- parameter:
- - name: ssh-hostname
- value: <rw_mgmt_ip>
- - name: ssh-username
- value: ubuntu
- - name: ssh-password
- value: <password>
- - seq: "2"
- name: configure-spgw
- parameter:
- - name: spgw-ip
- data-type: STRING
- value: <spgw_ip>
- - name: hss-ip
- data-type: STRING
- value: <hss_ip>
- - seq: "3"
- name: restart-spgw
- config-primitive:
- - name: add-route
- parameter:
- - name: external-prefix
- data-type: STRING
- default-value: "8.8.8.8/32"
- - name: next-hop
- data-type: STRING
- default-value: "192.168.2.1"
- juju:
- charm: spgwcharm
+ lcm-operations-configuration:
+ operate-vnf-op-config:
+ day1-2:
+ - id: vEPC_vnfd
+ initial-config-primitive:
+ - seq: "1"
+ name: config
+ parameter:
+ - name: ssh-hostname
+ value: <rw_mgmt_ip>
+ - name: ssh-username
+ value: ubuntu
+ - name: ssh-password
+ value: <password>
+ - seq: "2"
+ name: configure-spgw
+ parameter:
+ - name: spgw-ip
+ data-type: STRING
+ value: <spgw_ip>
+ - name: hss-ip
+ data-type: STRING
+ value: <hss_ip>
+ - seq: "3"
+ name: restart-spgw
+ config-primitive:
+ - name: add-route
+ parameter:
+ - name: external-prefix
+ data-type: STRING
+ default-value: "8.8.8.8/32"
+ - name: next-hop
+ data-type: STRING
+ default-value: "192.168.2.1"
+ juju:
+ charm: spgwcharm
+ - id: hss
+ initial-config-primitive:
+ - seq: "1"
+ name: config
+ parameter:
+ - name: ssh-hostname
+ value: <rw_mgmt_ip>
+ - name: ssh-username
+ value: ubuntu
+ - name: ssh-password
+ value: <password>
+ - seq: "2"
+ name: configure-hss
+ parameter:
+ - name: spgw-ip
+ data-type: STRING
+ value: <spgw_ip>
+ - name: hss-ip
+ data-type: STRING
+ value: <hss_ip>
+ - seq: "3"
+ name: restart-hss
+ juju:
+ charm: hsscharm
int-virtual-link-desc:
- id: s6a
ext-cpd: