_add_im_kdus_to_sol006_vnfd(im_vnfd, sol006_vnfd)
_add_im_k8s_clusters_to_sol006_vnfd(im_vnfd, sol006_vnfd)
_add_im_placement_groups_to_sol006_vnfd(im_vnfd, sol006_vnfd)
+ _cleanup_juju_in_configurations(sol006_vnfd)
return {"vnfd": sol006_vnfd}
}
}
+def _cleanup_juju_in_configurations(sol006_vnfd):
+ configs = sol006_vnfd["df"][0].get("lcm-operations-configuration")
+ if configs:
+ for day12_config in configs["operate-vnf-op-config"]["day1-2"]:
+ if "juju" in day12_config:
+ ee_name = _create_execution_environment_for_juju(day12_config, day12_config["juju"]["charm"])
+ for primitive in day12_config.get("config-primitive", []):
+ primitive["execution-environment-ref"] = ee_name
+ for primitive in day12_config.get("initial-config-primitive", []):
+ primitive["execution-environment-ref"] = ee_name
+ for primitive in day12_config.get("terminate-config-primitive", []):
+ primitive["execution-environment-ref"] = ee_name
+ day12_config.pop("juju", None)
+
+def _create_execution_environment_for_juju(day12_config, charm_name):
+ if not "execution-environment-list" in day12_config:
+ day12_config["execution-environment-list"] = []
+
+ day12_config["execution-environment-list"].append(
+ {
+ "id": charm_name + "-ee",
+ "juju": {
+ "charm": charm_name
+ }
+ }
+ )
+
+ return charm_name + "-ee"
+
def _add_im_vnf_configuration_to_sol006_vnfd(im_vnfd, sol006_vnfd):
vnf_configuration = im_vnfd.get("vnf-configuration")
if not vnf_configuration:
operate-vnf-op-config:
day1-2:
- id: hackfest3charmed-vnf
+ execution-environment-list:
+ - id: simple-ee
+ juju:
+ charm: simple
initial-config-primitive:
- seq: "1"
+ execution-environment-ref: simple-ee
name: config
parameter:
- name: ssh-hostname
- name: ssh-password
value: osm4u
- seq: "2"
+ execution-environment-ref: simple-ee
name: touch
parameter:
- name: filename
value: <touch_filename>
config-primitive:
- name: touch
+ execution-environment-ref: simple-ee
parameter:
- data-type: STRING
default-value: <touch_filename2>
- name: filename
- juju:
- charm: simple
\ No newline at end of file
+ name: filename
\ No newline at end of file
operate-vnf-op-config:
day1-2:
- id: vEPC_vnfd
+ execution-environment-list:
+ - id: spgwcharm-ee
+ juju:
+ charm: spgwcharm
initial-config-primitive:
- seq: "1"
name: config
value: ubuntu
- name: ssh-password
value: <password>
+ execution-environment-ref: spgwcharm-ee
- seq: "2"
name: configure-spgw
parameter:
- name: hss-ip
data-type: STRING
value: <hss_ip>
+ execution-environment-ref: spgwcharm-ee
- seq: "3"
name: restart-spgw
+ execution-environment-ref: spgwcharm-ee
config-primitive:
- name: add-route
parameter:
- name: next-hop
data-type: STRING
default-value: "192.168.2.1"
- juju:
- charm: spgwcharm
+ execution-environment-ref: spgwcharm-ee
- id: hss
+ execution-environment-list:
+ - id: hsscharm-ee
+ juju:
+ charm: hsscharm
initial-config-primitive:
- seq: "1"
+ execution-environment-ref: hsscharm-ee
name: config
parameter:
- name: ssh-hostname
- name: hss-ip
data-type: STRING
value: <hss_ip>
+ execution-environment-ref: hsscharm-ee
- seq: "3"
name: restart-hss
- juju:
- charm: hsscharm
+ execution-environment-ref: hsscharm-ee
int-virtual-link-desc:
- id: s6a
ext-cpd: