Make Network Slicing usecase more user friendly 48/127148/9
authorMaciej Lisowski <m.lisowski2@partner.samsung.com>
Wed, 16 Feb 2022 14:37:35 +0000 (15:37 +0100)
committerMaciej Lisowski <m.lisowski2@partner.samsung.com>
Mon, 21 Feb 2022 11:45:16 +0000 (12:45 +0100)
It was required to create a directory containing all files related to Network Slicing in order to make the usecase more user friendly. This change contains policies with already made automated scripts.

Issue-ID: INT-2069
Signed-off-by: Maciej Lisowski <m.lisowski2@partner.samsung.com>
Change-Id: Ia6f003a2dbff53f32a2fc0614bb646302b6d080b

59 files changed:
tutorials/5GE2ENetworkSlicing/Option1/README.md [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/Option2/README.md [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/README.md [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/README.md [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/autocreateO1.sh [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/autocreateO2.sh [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_create_new.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_non_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_reuse.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/query_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/threshold_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/vnf_nsi_nonshared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/vnf_nsi_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/optimization_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/query_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/threshold_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/vnf_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/bak_vnf_nsi_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_create_new.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_non_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_reuse.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/query_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/threshold_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_nonshared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_notshared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/optimization_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/query_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/threshold_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/vnf_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_create_new.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_non_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_reuse.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/query_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/threshold_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_nonshared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_notshared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/optimization_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/query_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/threshold_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/vnf_nssi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/attribute_policy_nst.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/optimization_policy_nst.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/query_policy_nst.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/vnf_policy_nst.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/policy_types/optimization_v2.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/policy_types/threshold.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/policy_utils.py [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/requirements.txt [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/bak_vnf_nsi_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_create_new.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_non_shared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_reuse.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/query_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/threshold_nsi.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_nonshared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_notshared.json [new file with mode: 0644]
tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_shared.json [new file with mode: 0644]

diff --git a/tutorials/5GE2ENetworkSlicing/Option1/README.md b/tutorials/5GE2ENetworkSlicing/Option1/README.md
new file mode 100644 (file)
index 0000000..8093fa2
--- /dev/null
@@ -0,0 +1 @@
+# In this directory put files/scripts related to Option1
diff --git a/tutorials/5GE2ENetworkSlicing/Option2/README.md b/tutorials/5GE2ENetworkSlicing/Option2/README.md
new file mode 100644 (file)
index 0000000..6f9ec3f
--- /dev/null
@@ -0,0 +1 @@
+# In this directory put files/scripts related to Option2
diff --git a/tutorials/5GE2ENetworkSlicing/README.md b/tutorials/5GE2ENetworkSlicing/README.md
new file mode 100644 (file)
index 0000000..9a697a7
--- /dev/null
@@ -0,0 +1,44 @@
+# 5G SLicing tutorial
+
+## Introduction
+
+The goal of this folder is to centralize all the resources
+needed to automate the 5G slicing use case.
+
+Several sources are available in the wiki [1] [2], an official documentation is
+also available but this documentation [3] usually redirects to the wiki.
+It may therefore be confusing.
+Integration team created a page to collect the existing different resources [4].
+
+Referencing all the resources in the demo repositories allow to version
+properly the different resources.
+
+## Automation
+
+TBD
+
+## JIRA tracking
+
+- Manual configuration step 1 - SDC: https://jira.onap.org/browse/INT-2064
+- Manual configuration step 2 - UUI Configuration:
+  https://jira.onap.org/browse/INT-2065
+- Manual configuration step 3 - MSB Configuration:
+  https://jira.onap.org/browse/INT-2066
+- Manual configuration step 4 - SO: https://jira.onap.org/browse/INT-2067
+- Manual configuration step 5 - OOF Configuration:
+  https://jira.onap.org/browse/INT-2068
+- Manual configuration step 6 - Policy Configuration:
+  https://jira.onap.org/browse/INT-2069
+- Manual configuration step 7 - AAI Configuration:
+  https://jira.onap.org/browse/INT-2070
+- Manual configuration step 8 - ConfigDB: https://jira.onap.org/browse/INT-2071
+- Manual configuration step 9 - SDN: https://jira.onap.org/browse/INT-2072
+- prepare a demo repo section: https://jira.onap.org/browse/INT-2073
+- Automate 5G Slicing use case in CI: https://jira.onap.org/browse/INT-2021
+
+## References
+
+- [1]: https://wiki.onap.org/display/DW/User+Operation+Guide+for+Honolulu+release
+- [2]: https://wiki.onap.org/display/DW/Manual+Configurations
+- [3]: https://docs.onap.org/projects/onap-integration/en/latest/docs_E2E_network_slicing.html#docs-e2e-network-slicing
+- [4]: https://wiki.onap.org/display/DW/Automate+use+case+5G+Slicing+in+CI
\ No newline at end of file
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/README.md b/tutorials/5GE2ENetworkSlicing/common/policies/README.md
new file mode 100644 (file)
index 0000000..becc980
--- /dev/null
@@ -0,0 +1,4 @@
+# Prerequisites
+Before running any automated script, check if names of services defined in them match the names of your created services.
+After you check them and they match, just run one of the automated scripts of the option you are recreating.
+## Enjoy!
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/autocreateO1.sh b/tutorials/5GE2ENetworkSlicing/common/policies/autocreateO1.sh
new file mode 100644 (file)
index 0000000..8b221f7
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+echo "Generating and pushing policies..."
+python3 policy_utils.py create_policy_types policy_types
+python3 policy_utils.py create_and_push_policies nst_policies
+python3 policy_utils.py generate_nsi_policies NSTO1
+python3 policy_utils.py create_and_push_policies gen_nsi_policies
+cp -TR trtnsst nsi_policies
+python3 policy_utils.py generate_nsi_policies TESTRANTOPNSST
+python3 policy_utils.py create_and_push_policies gen_nsi_policies
+cp -TR bak_nsi_policies nsi_policies
+python3 policy_utils.py generate_nssi_policies RAN_NF_NSST minimize latency
+python3 policy_utils.py create_and_push_policies gen_nssi_policies
+python3 policy_utils.py generate_nssi_policies TN_BH_NSST minimize latency
+python3 policy_utils.py create_and_push_policies gen_nssi_policies
+python3 policy_utils.py generate_nssi_policies CN_NSST minimize latency
+python3 policy_utils.py create_and_push_policies gen_nssi_policies
+echo "Done."
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/autocreateO2.sh b/tutorials/5GE2ENetworkSlicing/common/policies/autocreateO2.sh
new file mode 100644 (file)
index 0000000..ebc9bca
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+echo "Generating and pushing policies..."
+python3 policy_utils.py create_policy_types policy_types
+python3 policy_utils.py create_and_push_policies nst_policies
+python3 policy_utils.py generate_nsi_policies EmbbNst_O2
+python3 policy_utils.py create_and_push_policies gen_nsi_policies
+python3 policy_utils.py generate_nssi_policies EmbbAn_NF minimize latency
+python3 policy_utils.py create_and_push_policies gen_nssi_policies
+python3 policy_utils.py generate_nssi_policies TN_ONAP_internal_BH minimize latency
+python3 policy_utils.py create_and_push_policies gen_nssi_policies
+python3 policy_utils.py generate_nssi_policies EmbbCn_External minimize latency
+python3 policy_utils.py create_and_push_policies gen_nssi_policies
+echo "Done."
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_create_new.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_create_new.json
new file mode 100644 (file)
index 0000000..af79be2
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "maximizeCost_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "maximizeCost_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "maximize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "creation_cost",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,create_new"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_non_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_non_shared.json
new file mode 100644 (file)
index 0000000..12d7d24
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "minimizeLatency_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "minimizeLatency_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "minimize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "latency",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_reuse.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/optimization_nsi_reuse.json
new file mode 100644 (file)
index 0000000..459cf33
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "minimizeCost_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "minimizeCost_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "minimize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "creation_cost",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/query_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/query_nsi.json
new file mode 100644 (file)
index 0000000..785bff7
--- /dev/null
@@ -0,0 +1,73 @@
+{
+    "queryPolicy_{{ service_name }}": {
+        "type": "onap.policies.optimization.service.QueryPolicy",
+        "version": "1.0.0",
+        "type_version": "1.0.0",
+        "metadata": {
+            "policy-id": "queryPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "scope": [
+                "shared,reuse",
+                "shared,create_new",
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "identity": "queryPolicy_{{ service_name }}",
+            "queryProperties": [
+                {
+                    "attribute": "latency",
+                    "attribute_location": "latency"
+                },
+                {
+                    "attribute": "max_number_of_ues",
+                    "attribute_location": "max_number_of_ues"
+                },
+                {
+                    "attribute": "s_nssai",
+                    "attribute_location": "s_nssai"
+                },
+                {
+                    "attribute": "activity_factor",
+                    "attribute_location": "activity_factor"
+                },
+                {
+                    "attribute": "resource_sharing_level",
+                    "attribute_location": "resource_sharing_level"
+                },
+                {
+                    "attribute": "ue_mobility_level",
+                    "attribute_location": "ue_mobility_level"
+                },
+                {
+                    "attribute": "sst",
+                    "attribute_location": "sst"
+                },
+                {
+                    "attribute": "AN_latency",
+                    "attribute_location": "AN_latency"
+                },
+                {
+                    "attribute": "CN_latency",
+                    "attribute_location": "CN_latency"
+                },
+                {
+                    "attribute": "TN_BH_latency",
+                    "attribute_location": "TN_BH_latency"
+                },
+                {
+                    "attribute": "model_invariant_id",
+                    "attribute_location": "invariantUUID"
+                },
+                {
+                    "attribute": "model_version_id",
+                    "attribute_location": "UUID"
+                }
+            ]
+        }
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/threshold_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/threshold_nsi.json
new file mode 100644 (file)
index 0000000..5b99b7f
--- /dev/null
@@ -0,0 +1,36 @@
+{
+    "Threshold_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "Threshold_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "Threshold_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse",
+                "shared,create_new",
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "thresholdProperties": [
+                {
+                    "attribute": "latency",
+                    "operator": "lte",
+                    "threshold": {
+                        "get_param": "latency"
+                    },
+                    "unit": "ms"
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.ThresholdPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/vnf_nsi_nonshared.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/vnf_nsi_nonshared.json
new file mode 100644 (file)
index 0000000..9eb091f
--- /dev/null
@@ -0,0 +1,243 @@
+{
+    "vnfPolicy_{{ service_name }}_non_shared": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}_non_shared",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "s_nssai": {
+                                "value": {
+                                    "get_param": "s_nssai"
+                                },
+                                "operator": "eq"
+                            },
+                            "resource_sharing_level": {
+                                "value": {
+                                    "get_param": "resource_sharing_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "ue_mobility_level": {
+                                "value": {
+                                    "get_param": "ue_mobility_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "sst": {
+                                "value": {
+                                    "get_param": "sst"
+                                },
+                                "operator": "eq"
+                            },
+                            "activity_factor": {
+                                "value": {
+                                    "get_param": "activity_factor"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "CN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "CN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "AN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "AN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN-BH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_BH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/vnf_nsi_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nsi_policies/vnf_nsi_shared.json
new file mode 100644 (file)
index 0000000..2e93ae7
--- /dev/null
@@ -0,0 +1,261 @@
+{
+    "vnfPolicy_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse",
+                "shared,create_new"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "modelInvariantId": {
+                            "get_param": "model_invariant_id"
+                        },
+                        "modelVersionId": {
+                            "get_param": "model_version_id"
+                        },
+                        "service-role": "nsi"
+                    },
+                    "inventoryProvider": "aai",
+                    "inventoryType": "nsi",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.1
+                    }
+                },
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "s_nssai": {
+                                "value": {
+                                    "get_param": "s_nssai"
+                                },
+                                "operator": "eq"
+                            },
+                            "resource_sharing_level": {
+                                "value": {
+                                    "get_param": "resource_sharing_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "ue_mobility_level": {
+                                "value": {
+                                    "get_param": "ue_mobility_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "sst": {
+                                "value": {
+                                    "get_param": "sst"
+                                },
+                                "operator": "eq"
+                            },
+                            "activity_factor": {
+                                "value": {
+                                    "get_param": "activity_factor"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "CN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "CN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "AN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "AN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN-BH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_BH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/optimization_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/optimization_nssi.json
new file mode 100644 (file)
index 0000000..9d744e9
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "{{ goal }}_{{ attribute }}_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "{{ goal }}_{{ attribute }}_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "{{ goal }}",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "{{ attribute }}",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/query_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/query_nssi.json
new file mode 100644 (file)
index 0000000..5de6b58
--- /dev/null
@@ -0,0 +1,39 @@
+{
+    "queryPolicy_{{ service_name }}": {
+        "type": "onap.policies.optimization.service.QueryPolicy",
+        "version": "1.0.0",
+        "type_version": "1.0.0",
+        "metadata": {
+            "policy-id": "queryPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "identity": "queryPolicy_{{ service_name }}",
+            "queryProperties": [
+                {
+                    "attribute": "latency",
+                    "attribute_location": "latency"
+                },
+                {
+                    "attribute": "reliability",
+                    "attribute_location": "reliability"
+                },
+                {
+                    "attribute": "model_invariant_id",
+                    "attribute_location": "invariantUUID"
+                },
+                {
+                    "attribute": "model_version_id",
+                    "attribute_location": "UUID"
+                }
+            ]
+        }
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/threshold_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/threshold_nssi.json
new file mode 100644 (file)
index 0000000..63bd3ad
--- /dev/null
@@ -0,0 +1,42 @@
+{
+    "Threshold_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "Threshold_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "Threshold_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "thresholdProperties": [
+                {
+                    "attribute": "latency",
+                    "operator": "lte",
+                    "threshold": {
+                        "get_param": "latency"
+                    },
+                    "unit": "ms"
+                },
+                {
+                    "attribute": "reliability",
+                    "operator": "gte",
+                    "threshold": {
+                        "get_param": "reliability"
+                    },
+                    "unit": ""
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.ThresholdPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/vnf_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/bak_nssi_policies/vnf_nssi.json
new file mode 100644 (file)
index 0000000..73388a3
--- /dev/null
@@ -0,0 +1,41 @@
+{
+    "vnfPolicy_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "modelInvariantId": {
+                            "get_param": "model_invariant_id"
+                        },
+                        "modelVersionId": {
+                            "get_param": "model_version_id"
+                        },
+                        "service-function": "shared",
+                        "service-role": "nssi"
+                    },
+                    "inventoryProvider": "aai",
+                    "inventoryType": "nssi",
+                    "unique": "true"
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/bak_vnf_nsi_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/bak_vnf_nsi_shared.json
new file mode 100644 (file)
index 0000000..91d1fe7
--- /dev/null
@@ -0,0 +1,325 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "vnfPolicy_EmbbNst_O2": {
+                    "metadata": {
+                        "policy-id": "vnfPolicy_EmbbNst_O2",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "identity": "vnf_EmbbNst_O2",
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "shared,reuse",
+                            "shared,create_new"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ],
+                        "geography": [],
+                        "vnfProperties": [
+                            {
+                                "attributes": {
+                                    "modelInvariantId": {
+                                        "get_param": "model_invariant_id"
+                                    },
+                                    "modelVersionId": {
+                                        "get_param": "model_version_id"
+                                    },
+                                    "service-function": "shared",
+                                    "service-role": "nssi",
+                                    "workload-context": "AN"
+                                },
+                                "inventoryProvider": "aai",
+                                "inventoryType": "nssi",
+                                "unique": "true",
+                                "defaultAttributes": {
+                                    "creation_cost": 0.1
+                                }
+                            },
+                            {
+                                "attributes": {
+                                    "service_profile": {
+                                        "latency": {
+                                            "value": {
+                                                "get_param": "latency"
+                                            },
+                                            "operator": "lte"
+                                        },
+                                        "s_nssai_list": {
+                                            "value": {
+                                                "get_param": "s_nssai_list"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "plmn_id_list": {
+                                            "value": {
+                                                "get_param": "plmn_id_list"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "max_number_of_pdu_session": {
+                                            "value": [
+                                                {
+                                                    "get_param": "max_number_of_pdu_session"
+                                                }
+                                            ],
+                                            "operator": "eq"
+                                        },
+                                        "coverage_area_ta_list": {
+                                            "value": [
+                                                101,
+                                                202,
+                                                303
+                                            ],
+                                            "operator": "eq"
+                                        },
+                                        "resource_sharing_level": {
+                                            "value": {
+                                                "get_param": "resource_sharing_level"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "ue_mobility_level": {
+                                            "value": {
+                                                "get_param": "ue_mobility_level"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "sst": {
+                                            "value": {
+                                                "get_param": "sst"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "max_number_of_ues": {
+                                            "value": {
+                                                "get_param": "max_number_of_ues"
+                                            },
+                                            "operator": "eq"
+                                        }
+                                    },
+                                    "subnets": {
+                                        "AN_NF": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "AN_NF_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "max_throughput": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "AN_NF_max_throughput"
+                                                    }
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            },
+                                            "s_nssai_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai_list"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "plmn_id_list"
+                                                    }
+                                                ]
+                                            },
+                                            "max_number_of_pdu_session": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "max_number_of_pdu_session"
+                                                    }
+                                                ]
+                                            },
+                                            "survival_time": {
+                                                "values": [
+                                                    "10"
+                                                ]
+                                            },
+                                            "exp_data_rate_ul": {
+                                                "values": {
+                                                    "get_param": "exp_data_rate_ul"
+                                                }
+                                            },
+                                            "exp_data_rate_dl": {
+                                                "values": {
+                                                    "get_param": "exp_data_rate_dl"
+                                                }
+                                            },
+                                            "coverage_area_ta_list": {
+                                                "values": [
+                                                    [
+                                                        101,
+                                                        202,
+                                                        303
+                                                    ]
+                                                ]
+                                            },
+                                            "terminal_density": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "AN_NF_terminal_density"
+                                                    }
+                                                ]
+                                            },
+                                            "max_number_of_ues": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "AN_NF_max_number_of_ues"
+                                                    }
+                                                ]
+                                            },
+                                            "resource_sharing_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "resource_sharing_level"
+                                                    }
+                                                ]
+                                            },
+                                            "ue_mobility_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "ue_mobility_level"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "TN_FH": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "TN_FH_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "max_bandwidth": {
+                                                "values": [
+                                                    1000
+                                                ]
+                                            },
+                                            "s_nssai_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai_list"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "plmn_id_list"
+                                                    }
+                                                ]
+                                            },
+                                            "resource_sharing_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "resource_sharing_level"
+                                                    }
+                                                ]
+                                            },
+                                            "max_throughput": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "TN_FH_max_throughput"
+                                                    }
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "TN_MH": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "TN_MH_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "max_bandwidth": {
+                                                "values": [
+                                                    1000
+                                                ]
+                                            },
+                                            "s_nssai_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai_list"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "plmn_id_list"
+                                                    }
+                                                ]
+                                            },
+                                            "resource_sharing_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "resource_sharing_level"
+                                                    }
+                                                ]
+                                            },
+                                            "max_throughput": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "TN_MH_max_throughput"
+                                                    }
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            }
+                                        }
+                                    }
+                                },
+                                "inventoryProvider": "generator",
+                                "inventoryType": "slice_profiles",
+                                "unique": "true",
+                                "defaultAttributes": {
+                                    "creation_cost": 0.9
+                                }
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.VnfPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_create_new.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_create_new.json
new file mode 100644 (file)
index 0000000..0ce1482
--- /dev/null
@@ -0,0 +1,44 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "maximizeCost_EmbbNst_O2": {
+                    "metadata": {
+                        "policy-id": "maximizeCost_EmbbNst_O2",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "optimization",
+                        "goal": "maximize",
+                        "operation_function": {
+                            "operator": "sum",
+                            "operands": [
+                                {
+                                    "function": "attribute",
+                                    "params": {
+                                        "attribute": "creation_cost",
+                                        "demand": "EmbbNst_O2"
+                                    }
+                                }
+                            ]
+                        },
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "shared,create_new"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.OptimizationPolicy",
+                    "type_version": "2.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_non_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_non_shared.json
new file mode 100644 (file)
index 0000000..b7b9339
--- /dev/null
@@ -0,0 +1,44 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "minimizeLatency_EmbbNst_O2": {
+                    "metadata": {
+                        "policy-id": "minimizeLatency_EmbbNst_O2",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "optimization",
+                        "goal": "minimize",
+                        "operation_function": {
+                            "operator": "sum",
+                            "operands": [
+                                {
+                                    "function": "attribute",
+                                    "params": {
+                                        "attribute": "latency",
+                                        "demand": "EmbbNst_O2"
+                                    }
+                                }
+                            ]
+                        },
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "non-shared"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.OptimizationPolicy",
+                    "type_version": "2.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_reuse.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/optimization_nsi_reuse.json
new file mode 100644 (file)
index 0000000..a6e2b17
--- /dev/null
@@ -0,0 +1,44 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "minimizeCost_EmbbNst_O2": {
+                    "metadata": {
+                        "policy-id": "minimizeCost_EmbbNst_O2",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "optimization",
+                        "goal": "minimize",
+                        "operation_function": {
+                            "operator": "sum",
+                            "operands": [
+                                {
+                                    "function": "attribute",
+                                    "params": {
+                                        "attribute": "creation_cost",
+                                        "demand": "EmbbNst_O2"
+                                    }
+                                }
+                            ]
+                        },
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "shared,reuse"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.OptimizationPolicy",
+                    "type_version": "2.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/query_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/query_nsi.json
new file mode 100644 (file)
index 0000000..902e786
--- /dev/null
@@ -0,0 +1,80 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "queryPolicy_EmbbNst_O2": {
+                    "type": "onap.policies.optimization.service.QueryPolicy",
+                    "version": "1.0.0",
+                    "type_version": "1.0.0",
+                    "metadata": {
+                        "policy-id": "queryPolicy_EmbbNst_O2",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "scope": [
+                            "shared,reuse",
+                            "shared,create_new",
+                            "non-shared"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ],
+                        "geography": [],
+                        "identity": "queryPolicy_EmbbNst_O2",
+                        "queryProperties": [
+                            {
+                                "attribute": "latency",
+                                "attribute_location": "latency"
+                            },
+                            {
+                                "attribute": "max_number_of_ues",
+                                "attribute_location": "max_number_of_ues"
+                            },
+                            {
+                                "attribute": "s_nssai",
+                                "attribute_location": "s_nssai"
+                            },
+                            {
+                                "attribute": "activity_factor",
+                                "attribute_location": "activity_factor"
+                            },
+                            {
+                                "attribute": "resource_sharing_level",
+                                "attribute_location": "resource_sharing_level"
+                            },
+                            {
+                                "attribute": "ue_mobility_level",
+                                "attribute_location": "ue_mobility_level"
+                            },
+                            {
+                                "attribute": "sst",
+                                "attribute_location": "sst"
+                            },
+                            {
+                                "attribute": "AN_latency",
+                                "attribute_location": "AN_latency"
+                            },
+                            {
+                                "attribute": "CN_latency",
+                                "attribute_location": "CN_latency"
+                            },
+                            {
+                                "attribute": "TN_BH_latency",
+                                "attribute_location": "TN_BH_latency"
+                            },
+                            {
+                                "attribute": "model_invariant_id",
+                                "attribute_location": "invariantUUID"
+                            },
+                            {
+                                "attribute": "model_version_id",
+                                "attribute_location": "UUID"
+                            }
+                        ]
+                    }
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/threshold_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/threshold_nsi.json
new file mode 100644 (file)
index 0000000..c5d1962
--- /dev/null
@@ -0,0 +1,43 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "Threshold_EmbbNst_O2": {
+                    "metadata": {
+                        "policy-id": "Threshold_EmbbNst_O2",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "Threshold_EmbbNst_O2",
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "shared,reuse",
+                            "shared,create_new",
+                            "non-shared"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ],
+                        "thresholdProperties": [
+                            {
+                                "attribute": "latency",
+                                "operator": "lte",
+                                "threshold": {
+                                    "get_param": "latency"
+                                },
+                                "unit": "ms"
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.ThresholdPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_nonshared.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_nonshared.json
new file mode 100644 (file)
index 0000000..bfb3059
--- /dev/null
@@ -0,0 +1,250 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "vnfPolicy_EmbbNst_O2_non_shared": {
+                    "metadata": {
+                        "policy-id": "vnfPolicy_EmbbNst_O2_non_shared",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "identity": "vnf_EmbbNst_O2",
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "non-shared"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ],
+                        "geography": [],
+                        "vnfProperties": [
+                            {
+                                "attributes": {
+                                    "service_profile": {
+                                        "latency": {
+                                            "value": {
+                                                "get_param": "latency"
+                                            },
+                                            "operator": "lte"
+                                        },
+                                        "s_nssai": {
+                                            "value": {
+                                                "get_param": "s_nssai"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "resource_sharing_level": {
+                                            "value": {
+                                                "get_param": "resource_sharing_level"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "ue_mobility_level": {
+                                            "value": {
+                                                "get_param": "ue_mobility_level"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "sst": {
+                                            "value": {
+                                                "get_param": "sst"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "activity_factor": {
+                                            "value": {
+                                                "get_param": "activity_factor"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "max_number_of_ues": {
+                                            "value": {
+                                                "get_param": "max_number_of_ues"
+                                            },
+                                            "operator": "eq"
+                                        }
+                                    },
+                                    "subnets": {
+                                        "CN": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "CN_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "s_nssai": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai"
+                                                    }
+                                                ]
+                                            },
+                                            "max_number_of_ues": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "max_number_of_ues"
+                                                    }
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            },
+                                            "activity_factor": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "activity_factor"
+                                                    }
+                                                ]
+                                            },
+                                            "resource_sharing_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "resource_sharing_level"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    "39-00"
+                                                ]
+                                            },
+                                            "survival_time": {
+                                                "values": [
+                                                    "10"
+                                                ]
+                                            },
+                                            "ue_mobility_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "ue_mobility_level"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "AN": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "AN_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "s_nssai": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai"
+                                                    }
+                                                ]
+                                            },
+                                            "max_number_of_ues": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "max_number_of_ues"
+                                                    }
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            },
+                                            "activity_factor": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "activity_factor"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    "39-00"
+                                                ]
+                                            },
+                                            "survival_time": {
+                                                "values": [
+                                                    "10"
+                                                ]
+                                            },
+                                            "resource_sharing_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "resource_sharing_level"
+                                                    }
+                                                ]
+                                            },
+                                            "ue_mobility_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "ue_mobility_level"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "TN-BH": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "TN_BH_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "s_nssai": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    "39-00"
+                                                ]
+                                            },
+                                            "max_bandwidth": {
+                                                "values": [
+                                                    1000
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            }
+                                        }
+                                    }
+                                },
+                                "inventoryProvider": "generator",
+                                "inventoryType": "slice_profiles",
+                                "unique": "true",
+                                "defaultAttributes": {
+                                    "creation_cost": 0.9
+                                }
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.VnfPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_notshared.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_notshared.json
new file mode 100644 (file)
index 0000000..1ec3bc1
--- /dev/null
@@ -0,0 +1,178 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "vnfPolicy_EmbbNst_O2_not_shared": {
+                    "metadata": {
+                        "policy-id": "vnfPolicy_EmbbNst_O2_not_shared",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "identity": "vnf_EmbbNst_O2",
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "non-shared"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ],
+                        "geography": [],
+                        "vnfProperties": [
+                            {
+                                "attributes": {
+                                    "service_profile": {
+                                        "latency": {
+                                            "value": {
+                                                "get_param": "latency"
+                                            },
+                                            "operator": "lte"
+                                        },
+                                        "max_throughput": {
+                                            "value": {
+                                                "get_param": "max_throughput"
+                                            },
+                                            "operator": "gte"
+                                        },
+                                        "max_number_of_ues": {
+                                            "value": {
+                                                "get_param": "max_number_of_ues"
+                                            },
+                                            "operator": "gte"
+                                        },
+                                        "terminal_density": {
+                                            "value": {
+                                                "get_param": "terminal_density"
+                                            },
+                                            "operator": "gte"
+                                        },
+                                        "plmn_id_list": {
+                                            "value": {
+                                                "get_param": "plmn_id_list"
+                                            },
+                                            "operator": "eq"
+                                        }
+                                    },
+                                    "subnets": {
+                                        "AN_NF": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "max_throughput": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "AN_NF_max_throughput"
+                                                    }
+                                                ]
+                                            },
+                                            "max_number_of_ues": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "AN_NF_max_number_of_ues"
+                                                    }
+                                                ]
+                                            },
+                                            "terminal_density": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "AN_NF_terminal_density"
+                                                    }
+                                                ]
+                                            },
+                                            "s_nssai_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai_list"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "plmn_id_list"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "TN_FH": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "max_throughput": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "TN_FH_max_throughput"
+                                                    }
+                                                ]
+                                            },
+                                            "s_nssai_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai_list"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "plmn_id_list"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "TN_MH": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "max_throughput": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "TN_MH_max_throughput"
+                                                    }
+                                                ]
+                                            },
+                                            "s_nssai_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai_list"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "plmn_id_list"
+                                                    }
+                                                ]
+                                            }
+                                        }
+                                    }
+                                },
+                                "inventoryProvider": "generator",
+                                "inventoryType": "slice_profiles",
+                                "unique": "true",
+                                "defaultAttributes": {
+                                    "creation_cost": 0.9
+                                }
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.VnfPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nsi_policies/vnf_nsi_shared.json
new file mode 100644 (file)
index 0000000..6182440
--- /dev/null
@@ -0,0 +1,268 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "vnfPolicy_EmbbNst_O2": {
+                    "metadata": {
+                        "policy-id": "vnfPolicy_EmbbNst_O2",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "identity": "vnf_EmbbNst_O2",
+                        "resources": [
+                            "EmbbNst_O2"
+                        ],
+                        "scope": [
+                            "shared,reuse",
+                            "shared,create_new"
+                        ],
+                        "services": [
+                            "EmbbNst_O2"
+                        ],
+                        "geography": [],
+                        "vnfProperties": [
+                            {
+                                "attributes": {
+                                    "modelInvariantId": {
+                                        "get_param": "model_invariant_id"
+                                    },
+                                    "modelVersionId": {
+                                        "get_param": "model_version_id"
+                                    },
+                                    "service-role": "nsi"
+                                },
+                                "inventoryProvider": "aai",
+                                "inventoryType": "nsi",
+                                "unique": "true",
+                                "defaultAttributes": {
+                                    "creation_cost": 0.1
+                                }
+                            },
+                            {
+                                "attributes": {
+                                    "service_profile": {
+                                        "latency": {
+                                            "value": {
+                                                "get_param": "latency"
+                                            },
+                                            "operator": "lte"
+                                        },
+                                        "s_nssai": {
+                                            "value": {
+                                                "get_param": "s_nssai"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "resource_sharing_level": {
+                                            "value": {
+                                                "get_param": "resource_sharing_level"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "ue_mobility_level": {
+                                            "value": {
+                                                "get_param": "ue_mobility_level"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "sst": {
+                                            "value": {
+                                                "get_param": "sst"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "activity_factor": {
+                                            "value": {
+                                                "get_param": "activity_factor"
+                                            },
+                                            "operator": "eq"
+                                        },
+                                        "max_number_of_ues": {
+                                            "value": {
+                                                "get_param": "max_number_of_ues"
+                                            },
+                                            "operator": "eq"
+                                        }
+                                    },
+                                    "subnets": {
+                                        "CN": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "CN_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "s_nssai": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai"
+                                                    }
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            },
+                                            "activity_factor": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "activity_factor"
+                                                    }
+                                                ]
+                                            },
+                                            "resource_sharing_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "resource_sharing_level"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    "39-00"
+                                                ]
+                                            },
+                                            "survival_time": {
+                                                "values": [
+                                                    "10"
+                                                ]
+                                            },
+                                            "max_number_of_ues": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "max_number_of_ues"
+                                                    }
+                                                ]
+                                            },
+                                            "ue_mobility_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "ue_mobility_level"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "AN": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "AN_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "s_nssai": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai"
+                                                    }
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            },
+                                            "activity_factor": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "activity_factor"
+                                                    }
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    "39-00"
+                                                ]
+                                            },
+                                            "survival_time": {
+                                                "values": [
+                                                    "10"
+                                                ]
+                                            },
+                                            "max_number_of_ues": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "max_number_of_ues"
+                                                    }
+                                                ]
+                                            },
+                                            "resource_sharing_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "resource_sharing_level"
+                                                    }
+                                                ]
+                                            },
+                                            "ue_mobility_level": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "ue_mobility_level"
+                                                    }
+                                                ]
+                                            }
+                                        },
+                                        "TN-BH": {
+                                            "latency": {
+                                                "max": {
+                                                    "get_param": "latency"
+                                                },
+                                                "min": {
+                                                    "get_param": "TN_BH_latency"
+                                                },
+                                                "steps": 1
+                                            },
+                                            "s_nssai": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "s_nssai"
+                                                    }
+                                                ]
+                                            },
+                                            "max_bandwidth": {
+                                                "values": [
+                                                    1000
+                                                ]
+                                            },
+                                            "plmn_id_list": {
+                                                "values": [
+                                                    "39-00"
+                                                ]
+                                            },
+                                            "sst": {
+                                                "values": [
+                                                    {
+                                                        "get_param": "sst"
+                                                    }
+                                                ]
+                                            }
+                                        }
+                                    }
+                                },
+                                "inventoryProvider": "generator",
+                                "inventoryType": "slice_profiles",
+                                "unique": "true",
+                                "defaultAttributes": {
+                                    "creation_cost": 0.9
+                                }
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.VnfPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/optimization_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/optimization_nssi.json
new file mode 100644 (file)
index 0000000..79e4f2b
--- /dev/null
@@ -0,0 +1,44 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "minimize_latency_EmbbCn_External": {
+                    "metadata": {
+                        "policy-id": "minimize_latency_EmbbCn_External",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "optimization",
+                        "goal": "minimize",
+                        "operation_function": {
+                            "operator": "sum",
+                            "operands": [
+                                {
+                                    "function": "attribute",
+                                    "params": {
+                                        "attribute": "latency",
+                                        "demand": "EmbbCn_External"
+                                    }
+                                }
+                            ]
+                        },
+                        "resources": [
+                            "EmbbCn_External"
+                        ],
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "services": [
+                            "EmbbCn_External"
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.OptimizationPolicy",
+                    "type_version": "2.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/query_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/query_nssi.json
new file mode 100644 (file)
index 0000000..ea45724
--- /dev/null
@@ -0,0 +1,46 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "queryPolicy_EmbbCn_External": {
+                    "type": "onap.policies.optimization.service.QueryPolicy",
+                    "version": "1.0.0",
+                    "type_version": "1.0.0",
+                    "metadata": {
+                        "policy-id": "queryPolicy_EmbbCn_External",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "services": [
+                            "EmbbCn_External"
+                        ],
+                        "geography": [],
+                        "identity": "queryPolicy_EmbbCn_External",
+                        "queryProperties": [
+                            {
+                                "attribute": "latency",
+                                "attribute_location": "latency"
+                            },
+                            {
+                                "attribute": "reliability",
+                                "attribute_location": "reliability"
+                            },
+                            {
+                                "attribute": "model_invariant_id",
+                                "attribute_location": "invariantUUID"
+                            },
+                            {
+                                "attribute": "model_version_id",
+                                "attribute_location": "UUID"
+                            }
+                        ]
+                    }
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/threshold_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/threshold_nssi.json
new file mode 100644 (file)
index 0000000..e56540d
--- /dev/null
@@ -0,0 +1,41 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "Threshold_EmbbCn_External": {
+                    "metadata": {
+                        "policy-id": "Threshold_EmbbCn_External",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "Threshold_EmbbCn_External",
+                        "resources": [
+                            "EmbbCn_External"
+                        ],
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "services": [
+                            "EmbbCn_External"
+                        ],
+                        "thresholdProperties": [
+                            {
+                                "attribute": "latency",
+                                "operator": "lte",
+                                "threshold": {
+                                    "get_param": "latency"
+                                },
+                                "unit": "ms"
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.ThresholdPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/vnf_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/gen_nssi_policies/vnf_nssi.json
new file mode 100644 (file)
index 0000000..255085d
--- /dev/null
@@ -0,0 +1,48 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "vnfPolicy_EmbbCn_External": {
+                    "metadata": {
+                        "policy-id": "vnfPolicy_EmbbCn_External",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "identity": "vnf_EmbbCn_External",
+                        "resources": [
+                            "EmbbCn_External"
+                        ],
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "services": [
+                            "EmbbCn_External"
+                        ],
+                        "geography": [],
+                        "vnfProperties": [
+                            {
+                                "attributes": {
+                                    "modelInvariantId": {
+                                        "get_param": "model_invariant_id"
+                                    },
+                                    "modelVersionId": {
+                                        "get_param": "model_version_id"
+                                    },
+                                    "service-function": "shared",
+                                    "service-role": "nssi"
+                                },
+                                "inventoryProvider": "aai",
+                                "inventoryType": "nssi",
+                                "unique": "true"
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.VnfPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_create_new.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_create_new.json
new file mode 100644 (file)
index 0000000..af79be2
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "maximizeCost_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "maximizeCost_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "maximize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "creation_cost",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,create_new"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_non_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_non_shared.json
new file mode 100644 (file)
index 0000000..12d7d24
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "minimizeLatency_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "minimizeLatency_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "minimize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "latency",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_reuse.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/optimization_nsi_reuse.json
new file mode 100644 (file)
index 0000000..459cf33
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "minimizeCost_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "minimizeCost_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "minimize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "creation_cost",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/query_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/query_nsi.json
new file mode 100644 (file)
index 0000000..785bff7
--- /dev/null
@@ -0,0 +1,73 @@
+{
+    "queryPolicy_{{ service_name }}": {
+        "type": "onap.policies.optimization.service.QueryPolicy",
+        "version": "1.0.0",
+        "type_version": "1.0.0",
+        "metadata": {
+            "policy-id": "queryPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "scope": [
+                "shared,reuse",
+                "shared,create_new",
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "identity": "queryPolicy_{{ service_name }}",
+            "queryProperties": [
+                {
+                    "attribute": "latency",
+                    "attribute_location": "latency"
+                },
+                {
+                    "attribute": "max_number_of_ues",
+                    "attribute_location": "max_number_of_ues"
+                },
+                {
+                    "attribute": "s_nssai",
+                    "attribute_location": "s_nssai"
+                },
+                {
+                    "attribute": "activity_factor",
+                    "attribute_location": "activity_factor"
+                },
+                {
+                    "attribute": "resource_sharing_level",
+                    "attribute_location": "resource_sharing_level"
+                },
+                {
+                    "attribute": "ue_mobility_level",
+                    "attribute_location": "ue_mobility_level"
+                },
+                {
+                    "attribute": "sst",
+                    "attribute_location": "sst"
+                },
+                {
+                    "attribute": "AN_latency",
+                    "attribute_location": "AN_latency"
+                },
+                {
+                    "attribute": "CN_latency",
+                    "attribute_location": "CN_latency"
+                },
+                {
+                    "attribute": "TN_BH_latency",
+                    "attribute_location": "TN_BH_latency"
+                },
+                {
+                    "attribute": "model_invariant_id",
+                    "attribute_location": "invariantUUID"
+                },
+                {
+                    "attribute": "model_version_id",
+                    "attribute_location": "UUID"
+                }
+            ]
+        }
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/threshold_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/threshold_nsi.json
new file mode 100644 (file)
index 0000000..5b99b7f
--- /dev/null
@@ -0,0 +1,36 @@
+{
+    "Threshold_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "Threshold_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "Threshold_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse",
+                "shared,create_new",
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "thresholdProperties": [
+                {
+                    "attribute": "latency",
+                    "operator": "lte",
+                    "threshold": {
+                        "get_param": "latency"
+                    },
+                    "unit": "ms"
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.ThresholdPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_nonshared.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_nonshared.json
new file mode 100644 (file)
index 0000000..9eb091f
--- /dev/null
@@ -0,0 +1,243 @@
+{
+    "vnfPolicy_{{ service_name }}_non_shared": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}_non_shared",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "s_nssai": {
+                                "value": {
+                                    "get_param": "s_nssai"
+                                },
+                                "operator": "eq"
+                            },
+                            "resource_sharing_level": {
+                                "value": {
+                                    "get_param": "resource_sharing_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "ue_mobility_level": {
+                                "value": {
+                                    "get_param": "ue_mobility_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "sst": {
+                                "value": {
+                                    "get_param": "sst"
+                                },
+                                "operator": "eq"
+                            },
+                            "activity_factor": {
+                                "value": {
+                                    "get_param": "activity_factor"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "CN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "CN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "AN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "AN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN-BH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_BH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_notshared.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_notshared.json
new file mode 100644 (file)
index 0000000..89aff68
--- /dev/null
@@ -0,0 +1,171 @@
+{
+    "vnfPolicy_{{ service_name }}_not_shared": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}_not_shared",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "max_throughput": {
+                                "value": {
+                                    "get_param": "max_throughput"
+                                },
+                                "operator": "gte"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "gte"
+                            },
+                            "terminal_density": {
+                                "value": {
+                                    "get_param": "terminal_density"
+                                },
+                                "operator": "gte"
+                            },
+                            "plmn_id_list": {
+                                "value": {
+                                    "get_param": "plmn_id_list"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "AN_NF": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "terminal_density": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_terminal_density"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_FH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_FH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_MH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_MH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/nsi_policies/vnf_nsi_shared.json
new file mode 100644 (file)
index 0000000..2e93ae7
--- /dev/null
@@ -0,0 +1,261 @@
+{
+    "vnfPolicy_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse",
+                "shared,create_new"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "modelInvariantId": {
+                            "get_param": "model_invariant_id"
+                        },
+                        "modelVersionId": {
+                            "get_param": "model_version_id"
+                        },
+                        "service-role": "nsi"
+                    },
+                    "inventoryProvider": "aai",
+                    "inventoryType": "nsi",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.1
+                    }
+                },
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "s_nssai": {
+                                "value": {
+                                    "get_param": "s_nssai"
+                                },
+                                "operator": "eq"
+                            },
+                            "resource_sharing_level": {
+                                "value": {
+                                    "get_param": "resource_sharing_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "ue_mobility_level": {
+                                "value": {
+                                    "get_param": "ue_mobility_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "sst": {
+                                "value": {
+                                    "get_param": "sst"
+                                },
+                                "operator": "eq"
+                            },
+                            "activity_factor": {
+                                "value": {
+                                    "get_param": "activity_factor"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "CN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "CN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "AN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "AN_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "activity_factor": {
+                                    "values": [
+                                        {
+                                            "get_param": "activity_factor"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN-BH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_BH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "s_nssai": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai"
+                                        }
+                                    ]
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/optimization_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/optimization_nssi.json
new file mode 100644 (file)
index 0000000..9d744e9
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "{{ goal }}_{{ attribute }}_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "{{ goal }}_{{ attribute }}_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "{{ goal }}",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "{{ attribute }}",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/query_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/query_nssi.json
new file mode 100644 (file)
index 0000000..5de6b58
--- /dev/null
@@ -0,0 +1,39 @@
+{
+    "queryPolicy_{{ service_name }}": {
+        "type": "onap.policies.optimization.service.QueryPolicy",
+        "version": "1.0.0",
+        "type_version": "1.0.0",
+        "metadata": {
+            "policy-id": "queryPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "identity": "queryPolicy_{{ service_name }}",
+            "queryProperties": [
+                {
+                    "attribute": "latency",
+                    "attribute_location": "latency"
+                },
+                {
+                    "attribute": "reliability",
+                    "attribute_location": "reliability"
+                },
+                {
+                    "attribute": "model_invariant_id",
+                    "attribute_location": "invariantUUID"
+                },
+                {
+                    "attribute": "model_version_id",
+                    "attribute_location": "UUID"
+                }
+            ]
+        }
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/threshold_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/threshold_nssi.json
new file mode 100644 (file)
index 0000000..53a5977
--- /dev/null
@@ -0,0 +1,34 @@
+{
+    "Threshold_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "Threshold_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "Threshold_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "thresholdProperties": [
+                {
+                    "attribute": "latency",
+                    "operator": "lte",
+                    "threshold": {
+                        "get_param": "latency"
+                    },
+                    "unit": "ms"
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.ThresholdPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/vnf_nssi.json b/tutorials/5GE2ENetworkSlicing/common/policies/nssi_policies/vnf_nssi.json
new file mode 100644 (file)
index 0000000..73388a3
--- /dev/null
@@ -0,0 +1,41 @@
+{
+    "vnfPolicy_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "OSDF_GUILIN"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "modelInvariantId": {
+                            "get_param": "model_invariant_id"
+                        },
+                        "modelVersionId": {
+                            "get_param": "model_version_id"
+                        },
+                        "service-function": "shared",
+                        "service-role": "nssi"
+                    },
+                    "inventoryProvider": "aai",
+                    "inventoryType": "nssi",
+                    "unique": "true"
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/attribute_policy_nst.json b/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/attribute_policy_nst.json
new file mode 100644 (file)
index 0000000..f9b1099
--- /dev/null
@@ -0,0 +1,41 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "Threshold_nst": {
+                    "metadata": {
+                        "policy-id": "Threshold_nst",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "nst_Threshold",
+                        "resources": [
+                            "nst"
+                        ],
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "services": [
+                            "nst"
+                        ],
+                        "thresholdProperties": [
+                            {
+                                "attribute": "latency",
+                                "operator": "lte",
+                                "threshold": {
+                                    "get_param": "latency"
+                                },
+                                "unit": "ms"
+                            }
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.ThresholdPolicy",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/optimization_policy_nst.json b/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/optimization_policy_nst.json
new file mode 100644 (file)
index 0000000..534d139
--- /dev/null
@@ -0,0 +1,44 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "nst_minimize_latency": {
+                    "metadata": {
+                        "policy-id": "nst_minimize_latency",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "geography": [],
+                        "identity": "optimization",
+                        "goal": "minimize",
+                        "operation_function": {
+                            "operator": "sum",
+                            "operands": [
+                                {
+                                    "function": "attribute",
+                                    "params": {
+                                        "attribute": "latency",
+                                        "demand": "nst"
+                                    }
+                                }
+                            ]
+                        },
+                        "resources": [
+                            "nst"
+                        ],
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "services": [
+                            "nst"
+                        ]
+                    },
+                    "type": "onap.policies.optimization.resource.OptimizationPolicy",
+                    "type_version": "2.0.0",
+                    "version": "1.0.0"
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/query_policy_nst.json b/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/query_policy_nst.json
new file mode 100644 (file)
index 0000000..4e10d2d
--- /dev/null
@@ -0,0 +1,34 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "queryPolicy_nst": {
+                    "type": "onap.policies.optimization.service.QueryPolicy",
+                    "version": "1.0.0",
+                    "type_version": "1.0.0",
+                    "metadata": {
+                        "policy-id": "queryPolicy_nst",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "services": [
+                            "nst"
+                        ],
+                        "geography": [],
+                        "identity": "queryPolicy_nst",
+                        "queryProperties": [
+                            {
+                                "attribute": "latency",
+                                "attribute_location": "latency"
+                            }
+                        ]
+                    }
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/vnf_policy_nst.json b/tutorials/5GE2ENetworkSlicing/common/policies/nst_policies/vnf_policy_nst.json
new file mode 100644 (file)
index 0000000..67c0f80
--- /dev/null
@@ -0,0 +1,41 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "vnfPolicy_nst": {
+                    "type": "onap.policies.optimization.resource.VnfPolicy",
+                    "version": "1.0.0",
+                    "type_version": "1.0.0",
+                    "metadata": {
+                        "policy-id": "vnfPolicy_nst",
+                        "policy-version": 1
+                    },
+                    "properties": {
+                        "scope": [
+                            "OSDF_GUILIN"
+                        ],
+                        "resources": [
+                            "nst"
+                        ],
+                        "services": [
+                            "nst"
+                        ],
+                        "identity": "vnf_nst",
+                        "applicableResources": "any",
+                        "vnfProperties": [
+                            {
+                                "inventoryProvider": "aai",
+                                "inventoryType": "nst",
+                                "unique": "true",
+                                "attributes": {
+                                    "model-role": "NST"
+                                }
+                            }
+                        ]
+                    }
+                }
+            }
+        ]
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/policy_types/optimization_v2.json b/tutorials/5GE2ENetworkSlicing/common/policies/policy_types/optimization_v2.json
new file mode 100644 (file)
index 0000000..a3e83da
--- /dev/null
@@ -0,0 +1,61 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "policy_types": {
+        "onap.policies.optimization.resource.OptimizationPolicy": {
+            "derived_from": "onap.policies.optimization.Resource",
+            "version": "2.0.0",
+            "name": "onap.policies.optimization.resource.OptimizationPolicy",
+            "properties": {
+                "goal": {
+                    "type": "list",
+                    "required": true,
+                    "entry_schema": {
+                        "type": "string",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "minimize",
+                                    "maximize"
+                                ]
+                            }
+                        ]
+                    }
+                },
+                "operation_function": {
+                    "type": "policy.data.operation_function_properties",
+                    "required": true
+                }
+            }
+        }
+    },
+    "data_types": {
+        "policy.data.operation_function_properties": {
+            "derived_from": "tosca.nodes.Root",
+            "properties": {
+                "operands": {
+                    "type": "list",
+                    "required": true,
+                    "entry_schema": {
+                        "type": "map"
+                    }
+                },
+                "operator": {
+                    "type": "string",
+                    "required": true,
+                    "entry_schema": {
+                        "type": "string",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "sum",
+                                    "min",
+                                    "max"
+                                ]
+                            }
+                        ]
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/policy_types/threshold.json b/tutorials/5GE2ENetworkSlicing/common/policies/policy_types/threshold.json
new file mode 100644 (file)
index 0000000..49a2906
--- /dev/null
@@ -0,0 +1,56 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "policy_types": {
+        "onap.policies.optimization.resource.ThresholdPolicy": {
+            "derived_from": "onap.policies.optimization.Resource",
+            "version": "1.0.0",
+            "properties": {
+                "applicableResources": {
+                    "type": "list",
+                    "required": true,
+                    "entry_schema": {
+                        "type": "string",
+                        "constraints": [
+                            {
+                                "valid_values": [
+                                    "any",
+                                    "all"
+                                ]
+                            }
+                        ]
+                    }
+                },
+                "thresholdProperties": {
+                    "type": "list",
+                    "required": true,
+                    "entry_schema": {
+                        "type": "policy.data.thresholdProperties_properties"
+                    }
+                }
+            }
+        }
+    },
+    "data_types": {
+        "policy.data.thresholdProperties_properties": {
+            "derived_from": "tosca.nodes.Root",
+            "properties": {
+                "attribute": {
+                    "type": "string",
+                    "required": true
+                },
+                "operator": {
+                    "type": "string",
+                    "required": true
+                },
+                "threshold": {
+                    "type": "float",
+                    "required": true
+                },
+                "unit": {
+                    "type": "string",
+                    "required": false
+                }
+            }
+        }
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/policy_utils.py b/tutorials/5GE2ENetworkSlicing/common/policies/policy_utils.py
new file mode 100644 (file)
index 0000000..adb5e09
--- /dev/null
@@ -0,0 +1,192 @@
+from jinja2 import Template
+import json
+import os
+import requests
+import sys
+
+BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + "/policies/"
+
+HEADERS = {'Content-Type': 'application/json'}
+AUTH = requests.auth.HTTPBasicAuth('healthcheck', 'zb!XztG34')
+
+
+def get_tosca_policy(policy):
+    pol = json.loads(policy)
+    tosca_policy = {
+            'tosca_definitions_version': 'tosca_simple_yaml_1_1_0',
+            'topology_template': {
+                    'policies': [pol]
+                }
+            }
+    return json.dumps(tosca_policy)
+
+def gen_policy(template_dir, gen_dir, filename, jinja_args):
+    with open(os.path.join(template_dir, filename), 'r') as file:
+        contents = file.read()
+    tm = Template(contents)
+    gen = tm.render(jinja_args)
+    tosca_policy = get_tosca_policy(gen)
+    with open(os.path.join(gen_dir, filename), 'w') as file:
+        file.write(tosca_policy)
+
+def create_and_push_policies(policy_dir):
+    for filename in os.listdir(policy_dir):
+        if filename.endswith('.json'):
+            with open(os.path.join(policy_dir, filename), 'r') as file:
+                data = json.loads(file.read())
+                metadata = create_policy(data)
+                if metadata:
+                    push_policy(metadata)
+
+def delete_policies(policy_dir):
+    for filename in os.listdir(policy_dir):
+        if filename.endswith('.json'):
+            with open(os.path.join(policy_dir, filename), 'r') as file:
+                data = json.loads(file.read())
+                policy_id = list(data['topology_template']['policies'][0].keys())[0]
+                undeploy_policy(policy_id)
+                delete_policy(data)
+
+def create_policy(data):
+    policy = data['topology_template']['policies'][0]
+    content = policy[list(policy.keys())[0]]
+    policy_type = content['type']
+    type_version = content['type_version']
+    policy_url = "https://policy-api:6969"
+    path = '/policy/api/v1/policytypes/{}/versions/{}/policies'.format(policy_type, type_version)
+    url = policy_url + path
+    try:
+        response = requests.post(url, headers=HEADERS, auth=AUTH, data=json.dumps(data), verify=False)
+    except Exception as e:
+        print(str(e))
+        return None
+    if response.status_code == 200:
+        print('Policy {} created'.format(content['metadata']['policy-id']))
+        return content['metadata']
+    else:
+        print(response.content)
+        return None
+
+def push_policy(metadata):
+    data = {'policies': [metadata]}
+    policy_url = "https://policy-pap:6969"
+    path = '/policy/pap/v1/pdps/policies'
+    url = policy_url + path
+    try:
+        response = requests.post(url, headers=HEADERS, auth=AUTH, data=json.dumps(data), verify=False)
+    except Exception as e:
+        print(str(e))
+        print("Cannot push policy {}".format(metadata['policy-id']))
+    if response.status_code == 200:
+        print("Policy {} pushed".format(metadata['policy-id']))
+    else:
+        print(response.content)
+
+def undeploy_policy(policy_id):
+    policy_url = "https://policy-pap:6969"
+    path = '/policy/pap/v1/pdps/policies/{}'.format(policy_id)
+    url = policy_url + path
+    try:
+        response = requests.delete(url, headers=HEADERS, auth=AUTH, verify=False)
+    except Exception as e:
+        print(str(e))
+        print("Cannot undeploy policy {}".format(policy_id))
+    if response.status_code == 200:
+        print("Policy {} undeployed".format(policy_id))
+    else:
+        print(response.content)
+
+def delete_policy(data):
+    policy = data['topology_template']['policies'][0]
+    content = policy[list(policy.keys())[0]]
+    policy_type = content['type']
+    type_version = content['type_version']
+    policy_id = content['metadata']['policy-id']
+    version = content['version']
+    policy_url = "https://policy-api:6969"
+    path = '/policy/api/v1/policytypes/{}/versions/{}/policies/{}/versions/{}'.format(policy_type, type_version, policy_id, version)
+    url = policy_url + path
+    try:
+        response = requests.delete(url, headers=HEADERS, auth=AUTH, data=json.dumps(data), verify=False)
+    except Exception as e:
+        print(str(e))
+        return None
+    if response.status_code == 200:
+        print('Policy {} deleted'.format(content['metadata']['policy-id']))
+        return content['metadata']
+    else:
+        print(response.content)
+        return None
+
+def generate_nssi_policies(jinja_args):
+    template_dir = BASE_DIR + 'nssi_policies'
+    gen_dir = BASE_DIR + 'gen_nssi_policies'
+
+    if not os.path.exists(gen_dir):
+        os.mkdir(gen_dir)
+
+    for filename in os.listdir(template_dir):
+        if filename.endswith('.json'):
+            gen_policy(template_dir, gen_dir, filename, jinja_args)
+
+def generate_nsi_policies(jinja_args):
+    template_dir = BASE_DIR + 'nsi_policies'
+    gen_dir = BASE_DIR + 'gen_nsi_policies'
+
+    if not os.path.exists(gen_dir):
+        os.mkdir(gen_dir)
+
+    for filename in os.listdir(template_dir):
+        if filename.endswith('.json'):
+            gen_policy(template_dir, gen_dir, filename, jinja_args)
+
+def create_policy_types(policy_dir):
+    for filename in os.listdir(policy_dir):
+        if filename.endswith('.json'):
+            with open(os.path.join(policy_dir, filename), 'r') as file:
+                data = json.loads(file.read())
+                create_policy_type(data)
+
+def create_policy_type(data):
+    policy_url = "https://policy-api:6969"
+    path = '/policy/api/v1/policytypes'
+    url = policy_url + path
+    try:
+        response = requests.post(url, headers=HEADERS, auth=AUTH, data=json.dumps(data), verify=False)
+    except Exception as e:
+        print(str(e))
+        return None
+    if response.status_code == 200:
+        print('Policy type created')
+    else:
+        print(response.content)
+        return None
+
+
+action = sys.argv[1]
+
+if action == "generate_nssi_policies":
+    jinja_args = {
+      'service_name': sys.argv[2],
+      'goal': sys.argv[3],
+      'attribute': sys.argv[4]
+    }
+    generate_nssi_policies(jinja_args)
+
+elif action == "create_and_push_policies":
+    policy_dir = sys.argv[2]
+    create_and_push_policies(policy_dir)
+
+elif action == "delete_policies":
+    policy_dir = sys.argv[2]
+    delete_policies(policy_dir)
+
+elif action == "generate_nsi_policies":
+    jinja_args = {
+      'service_name': sys.argv[2]
+    }
+    generate_nsi_policies(jinja_args)
+
+elif action == "create_policy_types":
+    policy_dir = sys.argv[2]
+    create_policy_types(policy_dir)
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/requirements.txt b/tutorials/5GE2ENetworkSlicing/common/policies/requirements.txt
new file mode 100644 (file)
index 0000000..1c579e7
--- /dev/null
@@ -0,0 +1 @@
+jinja2
\ No newline at end of file
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/bak_vnf_nsi_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/bak_vnf_nsi_shared.json
new file mode 100644 (file)
index 0000000..14e74d5
--- /dev/null
@@ -0,0 +1,318 @@
+{
+    "vnfPolicy_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse",
+                "shared,create_new"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "modelInvariantId": {
+                            "get_param": "model_invariant_id"
+                        },
+                        "modelVersionId": {
+                            "get_param": "model_version_id"
+                        },
+                        "service-function": "shared",
+                        "service-role": "nssi",
+                        "workload-context": "AN"
+                    },
+                    "inventoryProvider": "aai",
+                    "inventoryType": "nssi",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.1
+                    }
+                },
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "s_nssai_list": {
+                                "value": {
+                                    "get_param": "s_nssai_list"
+                                },
+                                "operator": "eq"
+                            },
+                            "plmn_id_list": {
+                                "value": {
+                                    "get_param": "plmn_id_list"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_pdu_session": {
+                                "value": [
+                                    {
+                                        "get_param": "max_number_of_pdu_session"
+                                    }
+                                ],
+                                "operator": "eq"
+                            },
+                            "coverage_area_ta_list": {
+                                "value": [
+                                    101,
+                                    202,
+                                    303
+                                ],
+                                "operator": "eq"
+                            },
+                            "resource_sharing_level": {
+                                "value": {
+                                    "get_param": "resource_sharing_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "ue_mobility_level": {
+                                "value": {
+                                    "get_param": "ue_mobility_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "sst": {
+                                "value": {
+                                    "get_param": "sst"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "AN_NF": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "AN_NF_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_pdu_session": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_pdu_session"
+                                        }
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "exp_data_rate_ul": {
+                                    "values": {
+                                        "get_param": "exp_data_rate_ul"
+                                    }
+                                },
+                                "exp_data_rate_dl": {
+                                    "values": {
+                                        "get_param": "exp_data_rate_dl"
+                                    }
+                                },
+                                "coverage_area_ta_list": {
+                                    "values": [
+                                        [
+                                            101,
+                                            202,
+                                            303
+                                        ]
+                                    ]
+                                },
+                                "terminal_density": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_terminal_density"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_FH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_FH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_FH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_MH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_MH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_MH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_create_new.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_create_new.json
new file mode 100644 (file)
index 0000000..af79be2
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "maximizeCost_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "maximizeCost_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "maximize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "creation_cost",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,create_new"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_non_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_non_shared.json
new file mode 100644 (file)
index 0000000..12d7d24
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "minimizeLatency_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "minimizeLatency_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "minimize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "latency",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_reuse.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/optimization_nsi_reuse.json
new file mode 100644 (file)
index 0000000..459cf33
--- /dev/null
@@ -0,0 +1,37 @@
+{
+    "minimizeCost_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "minimizeCost_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "optimization",
+            "goal": "minimize",
+            "operation_function": {
+                "operator": "sum",
+                "operands": [
+                    {
+                        "function": "attribute",
+                        "params": {
+                            "attribute": "creation_cost",
+                            "demand": "{{ service_name }}"
+                        }
+                    }
+                ]
+            },
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ]
+        },
+        "type": "onap.policies.optimization.resource.OptimizationPolicy",
+        "type_version": "2.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/query_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/query_nsi.json
new file mode 100644 (file)
index 0000000..0db2c80
--- /dev/null
@@ -0,0 +1,117 @@
+{
+    "queryPolicy_{{ service_name }}": {
+        "type": "onap.policies.optimization.service.QueryPolicy",
+        "version": "1.0.0",
+        "type_version": "1.0.0",
+        "metadata": {
+            "policy-id": "queryPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "scope": [
+                "shared,reuse",
+                "shared,create_new",
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "identity": "queryPolicy_{{ service_name }}",
+            "queryProperties": [
+                {
+                    "attribute": "latency",
+                    "attribute_location": "latency"
+                },
+                {
+                    "attribute": "max_number_of_ues",
+                    "attribute_location": "max_number_of_ues"
+                },
+                {
+                    "attribute": "AN_NF_max_throughput",
+                    "attribute_location": "AN_NF_max_throughput"
+                },
+                {
+                    "attribute": "AN_NF_max_number_of_ues",
+                    "attribute_location": "AN_NF_max_number_of_ues"
+                },
+                {
+                    "attribute": "AN_NF_terminal_density",
+                    "attribute_location": "AN_NF_terminal_density"
+                },
+                {
+                    "attribute": "AN_NF_latency",
+                    "attribute_location": "AN_NF_latency"
+                },
+                {
+                    "attribute": "TN_FH_latency",
+                    "attribute_location": "TN_FH_latency"
+                },
+                {
+                    "attribute": "TN_MH_latency",
+                    "attribute_location": "TN_MH_latency"
+                },
+                {
+                    "attribute": "TN_FH_max_throughput",
+                    "attribute_location": "TN_FH_max_throughput"
+                },
+                {
+                    "attribute": "TN_MH_max_throughput",
+                    "attribute_location": "TN_MH_max_throughput"
+                },
+                {
+                    "attribute": "s_nssai_list",
+                    "attribute_location": "s_nssai_list"
+                },
+                {
+                    "attribute": "plmn_id_list",
+                    "attribute_location": "plmn_id_list"
+                },
+                {
+                    "attribute": "coverage_area_ta_list",
+                    "attribute_location": "coverage_area_ta_list"
+                },
+                {
+                    "attribute": "resource_sharing_level",
+                    "attribute_location": "resource_sharing_level"
+                },
+                {
+                    "attribute": "ue_mobility_level",
+                    "attribute_location": "ue_mobility_level"
+                },
+                {
+                    "attribute": "sst",
+                    "attribute_location": "sst"
+                },
+                {
+                    "attribute": "max_number_of_pdu_session",
+                    "attribute_location": "max_number_of_pdu_session"
+                },
+                {
+                    "attribute": "perf_req",
+                    "attribute_location": "perf_req"
+                },
+                {
+                    "attribute": "exp_data_rate_dl",
+                    "attribute_location": "perf_req.perfReqEmbbList.expDataRateDL"
+                },
+                {
+                    "attribute": "exp_data_rate_ul",
+                    "attribute_location": "perf_req.perfReqEmbbList.expDataRateUL"
+                },
+                {
+                    "attribute": "model_invariant_id",
+                    "attribute_location": "invariantUUID"
+                },
+                {
+                    "attribute": "model_version_id",
+                    "attribute_location": "UUID"
+                },
+                {
+                    "attribute": "activity_factor",
+                    "attribute_location": "perf_req.perfReqEmbbList.activityFactor"
+                }
+            ]
+        }
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/threshold_nsi.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/threshold_nsi.json
new file mode 100644 (file)
index 0000000..5b99b7f
--- /dev/null
@@ -0,0 +1,36 @@
+{
+    "Threshold_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "Threshold_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "geography": [],
+            "identity": "Threshold_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse",
+                "shared,create_new",
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "thresholdProperties": [
+                {
+                    "attribute": "latency",
+                    "operator": "lte",
+                    "threshold": {
+                        "get_param": "latency"
+                    },
+                    "unit": "ms"
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.ThresholdPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_nonshared.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_nonshared.json
new file mode 100644 (file)
index 0000000..23ed9fa
--- /dev/null
@@ -0,0 +1,141 @@
+{
+    "vnfPolicy_{{ service_name }}_non_shared": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}_non_shared",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "resource_sharing_level": {
+                                "value": {
+                                    "get_param": "resource_sharing_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "ue_mobility_level": {
+                                "value": {
+                                    "get_param": "ue_mobility_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "sst": {
+                                "value": {
+                                    "get_param": "sst"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "AN": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 5
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_BH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 5
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        "39-00"
+                                    ]
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_notshared.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_notshared.json
new file mode 100644 (file)
index 0000000..89aff68
--- /dev/null
@@ -0,0 +1,171 @@
+{
+    "vnfPolicy_{{ service_name }}_not_shared": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}_not_shared",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "non-shared"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "max_throughput": {
+                                "value": {
+                                    "get_param": "max_throughput"
+                                },
+                                "operator": "gte"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "gte"
+                            },
+                            "terminal_density": {
+                                "value": {
+                                    "get_param": "terminal_density"
+                                },
+                                "operator": "gte"
+                            },
+                            "plmn_id_list": {
+                                "value": {
+                                    "get_param": "plmn_id_list"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "AN_NF": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "terminal_density": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_terminal_density"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_FH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_FH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_MH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_MH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}
diff --git a/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_shared.json b/tutorials/5GE2ENetworkSlicing/common/policies/trtnsst/vnf_nsi_shared.json
new file mode 100644 (file)
index 0000000..5795d58
--- /dev/null
@@ -0,0 +1,316 @@
+{
+    "vnfPolicy_{{ service_name }}": {
+        "metadata": {
+            "policy-id": "vnfPolicy_{{ service_name }}",
+            "policy-version": 1
+        },
+        "properties": {
+            "identity": "vnf_{{ service_name }}",
+            "resources": [
+                "{{ service_name }}"
+            ],
+            "scope": [
+                "shared,reuse",
+                "shared,create_new"
+            ],
+            "services": [
+                "{{ service_name }}"
+            ],
+            "geography": [],
+            "vnfProperties": [
+                {
+                    "attributes": {
+                        "modelInvariantId": {
+                            "get_param": "model_invariant_id"
+                        },
+                        "modelVersionId": {
+                            "get_param": "model_version_id"
+                        },
+                        "service-function": "shared",
+                        "service-role": "nssi",
+                        "workload-context": "AN"
+                    },
+                    "inventoryProvider": "aai",
+                    "inventoryType": "nssi",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.1
+                    }
+                },
+                {
+                    "attributes": {
+                        "service_profile": {
+                            "latency": {
+                                "value": {
+                                    "get_param": "latency"
+                                },
+                                "operator": "lte"
+                            },
+                            "s_nssai_list": {
+                                "value": {
+                                    "get_param": "s_nssai_list"
+                                },
+                                "operator": "eq"
+                            },
+                            "plmn_id_list": {
+                                "value": {
+                                    "get_param": "plmn_id_list"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_pdu_session": {
+                                "value": {
+                                    "get_param": "max_number_of_pdu_session"
+                                },
+                                "operator": "eq"
+                            },
+                            "coverage_area_ta_list": {
+                                "value": [
+                                    101,
+                                    202,
+                                    303
+                                ],
+                                "operator": "eq"
+                            },
+                            "resource_sharing_level": {
+                                "value": {
+                                    "get_param": "resource_sharing_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "ue_mobility_level": {
+                                "value": {
+                                    "get_param": "ue_mobility_level"
+                                },
+                                "operator": "eq"
+                            },
+                            "sst": {
+                                "value": {
+                                    "get_param": "sst"
+                                },
+                                "operator": "eq"
+                            },
+                            "max_number_of_ues": {
+                                "value": {
+                                    "get_param": "max_number_of_ues"
+                                },
+                                "operator": "eq"
+                            }
+                        },
+                        "subnets": {
+                            "AN_NF": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "AN_NF_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_pdu_session": {
+                                    "values": [
+                                        {
+                                            "get_param": "max_number_of_pdu_session"
+                                        }
+                                    ]
+                                },
+                                "survival_time": {
+                                    "values": [
+                                        "10"
+                                    ]
+                                },
+                                "exp_data_rate_ul": {
+                                    "values": {
+                                        "get_param": "exp_data_rate_ul"
+                                    }
+                                },
+                                "exp_data_rate_dl": {
+                                    "values": {
+                                        "get_param": "exp_data_rate_dl"
+                                    }
+                                },
+                                "coverage_area_ta_list": {
+                                    "values": [
+                                        [
+                                            101,
+                                            202,
+                                            303
+                                        ]
+                                    ]
+                                },
+                                "terminal_density": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_terminal_density"
+                                        }
+                                    ]
+                                },
+                                "max_number_of_ues": {
+                                    "values": [
+                                        {
+                                            "get_param": "AN_NF_max_number_of_ues"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "ue_mobility_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "ue_mobility_level"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_FH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_FH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_FH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            },
+                            "TN_MH": {
+                                "latency": {
+                                    "max": {
+                                        "get_param": "latency"
+                                    },
+                                    "min": {
+                                        "get_param": "TN_MH_latency"
+                                    },
+                                    "steps": 1
+                                },
+                                "max_bandwidth": {
+                                    "values": [
+                                        1000
+                                    ]
+                                },
+                                "s_nssai_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "s_nssai_list"
+                                        }
+                                    ]
+                                },
+                                "plmn_id_list": {
+                                    "values": [
+                                        {
+                                            "get_param": "plmn_id_list"
+                                        }
+                                    ]
+                                },
+                                "resource_sharing_level": {
+                                    "values": [
+                                        {
+                                            "get_param": "resource_sharing_level"
+                                        }
+                                    ]
+                                },
+                                "max_throughput": {
+                                    "values": [
+                                        {
+                                            "get_param": "TN_MH_max_throughput"
+                                        }
+                                    ]
+                                },
+                                "sst": {
+                                    "values": [
+                                        {
+                                            "get_param": "sst"
+                                        }
+                                    ]
+                                }
+                            }
+                        }
+                    },
+                    "inventoryProvider": "generator",
+                    "inventoryType": "slice_profiles",
+                    "unique": "true",
+                    "defaultAttributes": {
+                        "creation_cost": 0.9
+                    }
+                }
+            ]
+        },
+        "type": "onap.policies.optimization.resource.VnfPolicy",
+        "type_version": "1.0.0",
+        "version": "1.0.0"
+    }
+}