diff options
Diffstat (limited to 'operations/a1-pe-sim-packages/resources/oran-sim-cba')
22 files changed, 2760 insertions, 0 deletions
diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/artifact_types.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/artifact_types.json new file mode 100644 index 0000000..224e7b6 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/artifact_types.json @@ -0,0 +1,20 @@ +{ + "artifact_types": { + "artifact-mapping-resource": { + "description": "Resource Mapping File used along with Configuration template", + "version": "1.0.0", + "derived_from": "tosca.artifacts.Implementation", + "file_ext": [ + "json" + ] + }, + "artifact-template-velocity": { + "description": " Velocity Template used for Configuration", + "version": "1.0.0", + "derived_from": "tosca.artifacts.Implementation", + "file_ext": [ + "vtl" + ] + } + } +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/data_types.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/data_types.json new file mode 100644 index 0000000..b64e404 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/data_types.json @@ -0,0 +1,174 @@ +{ + "data_types": { + "dt-config-assign-properties": { + "description": "Dynamic DataType definition for workflow(config-assign).", + "version": "1.0.0", + "properties": { + "vnf-id": { + "type": "string" + }, + "cells-payload": { + "type": "string", + "default": "" + }, + "ves-port": { + "type": "string", + "default": "30417" + }, + "ues-payload": { + "type": "string", + "default": "" + }, + "ves-user": { + "type": "string", + "default": "sample1" + }, + "externalNodeIp": { + "type": "string" + }, + "vnf-name": { + "type": "string", + "default": "oran-sim-name" + }, + "vnf-type": { + "type": "string", + "default": "oran-sim-type" + }, + "ves-password": { + "type": "string", + "default": "sample1" + } + }, + "derived_from": "tosca.datatypes.Dynamic" + }, + "dt-config-deploy-properties": { + "description": "Dynamic DataType definition for workflow(config-deploy).", + "version": "1.0.0", + "properties": { + "vnf-id": { + "type": "string" + }, + "service-instance-id": { + "type": "string" + } + }, + "derived_from": "tosca.datatypes.Dynamic" + }, + "dt-resource-assignment-properties": { + "description": "Dynamic DataType definition for workflow(resource-assignment).", + "version": "1.0.0", + "properties": { + "vnf-ip-address": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "default": "${vnf-ip-address}", + "entry_schema": { + "type": "" + } + }, + "vnf-id": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "service-instance-id": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "vnf_name": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "vf-module-id": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "aic-cloud-region": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "oran_name": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "default": "${oran_name}", + "entry_schema": { + "type": "" + } + }, + "vf-module-label": { + "description": "", + "required": false, + "type": "string" + }, + "vf-naming-policy": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "default": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP", + "entry_schema": { + "type": "" + } + }, + "vf-module-model-customization-uuid": { + "description": "", + "required": false, + "type": "string" + } + }, + "derived_from": "tosca.datatypes.Dynamic" + } + } +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/node_types.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/node_types.json new file mode 100644 index 0000000..3d7d15b --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/node_types.json @@ -0,0 +1,372 @@ +{ + "node_types": { + "component-resource-resolution": { + "description": "This is Resource Assignment Component API", + "version": "1.0.0", + "attributes": { + "assignment-params": { + "description": "Holds resolved template, resolution-summary or key-value", + "required": true, + "type": "string" + }, + "assignment-map": { + "description": "Holds resolved values for each artifact prefix eg. { vdns: { vnf-id: 123 } }", + "required": true, + "type": "map" + } + }, + "capabilities": { + "component-node": { + "type": "tosca.capabilities.Node" + } + }, + "interfaces": { + "ResourceResolutionComponent": { + "operations": { + "process": { + "inputs": { + "resolution-key": { + "description": "Key for service instance related correlation.", + "required": false, + "type": "string" + }, + "occurrence": { + "description": "Number of time to perform the resolution.", + "required": false, + "type": "integer", + "default": 1 + }, + "store-result": { + "description": "Whether or not to store the output.", + "required": false, + "type": "boolean" + }, + "resource-type": { + "description": "Request type.", + "required": false, + "type": "string" + }, + "resolution-summary": { + "description": "Enable resolution-summary output", + "required": false, + "type": "boolean" + }, + "artifact-prefix-names": { + "description": "Template , Resource Assignment Artifact Prefix names", + "required": true, + "type": "list", + "entry_schema": { + "type": "string" + } + }, + "request-id": { + "description": "Request Id, Unique Id for the request.", + "required": true, + "type": "string" + }, + "resource-id": { + "description": "Resource Id.", + "required": false, + "type": "string" + }, + "action-name": { + "description": "Action Name of the process", + "required": false, + "type": "string" + }, + "dynamic-properties": { + "description": "Dynamic Json Content or DSL Json reference.", + "required": false, + "type": "json" + } + }, + "outputs": { + "resource-assignment-params": { + "required": true, + "type": "string" + }, + "resource-assignment-map": { + "required": true, + "type": "string" + }, + "status": { + "required": true, + "type": "string" + } + } + } + } + } + }, + "derived_from": "tosca.nodes.Component" + }, + "component-script-executor": { + "description": "This is CLI Transaction Configuration Component API", + "version": "1.0.0", + "attributes": { + "response-data": { + "required": false, + "type": "json" + } + }, + "capabilities": { + "component-node": { + "type": "tosca.capabilities.Node" + } + }, + "interfaces": { + "ComponentScriptExecutor": { + "operations": { + "process": { + "inputs": { + "script-type": { + "description": "Script type, kotlin type is supported", + "required": true, + "type": "string", + "constraints": [ + { + "valid_values": [ + "kotlin", + "jython", + "internal" + ] + } + ], + "default": "internal" + }, + "script-class-reference": { + "description": "Kotlin Script class name or jython script name.", + "required": true, + "type": "string" + }, + "dynamic-properties": { + "description": "Dynamic Json Content or DSL Json reference.", + "required": false, + "type": "json" + } + }, + "outputs": { + "response-data": { + "description": "Execution Response Data.", + "required": false, + "type": "string" + }, + "status": { + "description": "Status of the Component Execution ( success or failure )", + "required": true, + "type": "string" + } + } + } + } + } + }, + "derived_from": "tosca.nodes.Component" + }, + "source-capability": { + "description": "This is Component Resource Source Node Type", + "version": "1.0.0", + "properties": { + "script-type": { + "required": true, + "type": "string", + "constraints": [ + { + "valid_values": [ + "kotlin", + "internal", + "jython" + ] + } + ], + "default": "kotlin" + }, + "script-class-reference": { + "description": "Capability reference name for internal and kotlin, for jython script file path", + "required": true, + "type": "string" + }, + "instance-dependencies": { + "description": "Instance dependency Names to Inject to Kotlin / Jython Script.", + "required": false, + "type": "list", + "entry_schema": { + "type": "string" + } + }, + "key-dependencies": { + "description": "Resource Resolution dependency dictionary names.", + "required": true, + "type": "list", + "entry_schema": { + "type": "string" + } + } + }, + "derived_from": "tosca.nodes.ResourceSource" + }, + "source-db": { + "description": "This is Database Resource Source Node Type", + "version": "1.0.0", + "properties": { + "type": { + "required": true, + "type": "string", + "constraints": [ + { + "valid_values": [ + "SQL", + "PLSQL" + ] + } + ], + "default": "SQL" + }, + "endpoint-selector": { + "required": false, + "type": "string" + }, + "query": { + "required": true, + "type": "string" + }, + "input-key-mapping": { + "required": false, + "type": "map", + "entry_schema": { + "type": "string" + } + }, + "output-key-mapping": { + "required": false, + "type": "map", + "entry_schema": { + "type": "string" + } + }, + "key-dependencies": { + "required": true, + "type": "list", + "entry_schema": { + "type": "string" + } + } + }, + "derived_from": "tosca.nodes.ResourceSource" + }, + "source-default": { + "description": "This is Default Resource Source Node Type", + "version": "1.0.0", + "properties": {}, + "derived_from": "tosca.nodes.ResourceSource" + }, + "source-input": { + "description": "This is Input Resource Source Node Type", + "version": "1.0.0", + "properties": {}, + "derived_from": "tosca.nodes.ResourceSource" + }, + "source-rest": { + "description": "This is Rest Resource Source Node Type", + "version": "1.0.0", + "properties": { + "type": { + "required": true, + "type": "string", + "constraints": [ + { + "valid_values": [ + "JSON" + ] + } + ], + "default": "JSON" + }, + "headers": { + "required": false, + "type": "map", + "entry_schema": { + "type": "string" + } + }, + "verb": { + "required": true, + "type": "string", + "constraints": [ + { + "valid_values": [ + "GET", + "POST", + "DELETE", + "PUT" + ] + } + ], + "default": "GET" + }, + "payload": { + "required": false, + "type": "string", + "default": "" + }, + "endpoint-selector": { + "required": false, + "type": "string" + }, + "url-path": { + "required": true, + "type": "string" + }, + "path": { + "required": true, + "type": "string" + }, + "expression-type": { + "required": false, + "type": "string", + "constraints": [ + { + "valid_values": [ + "JSON_PATH", + "JSON_POINTER" + ] + } + ], + "default": "JSON_PATH" + }, + "input-key-mapping": { + "required": false, + "type": "map", + "entry_schema": { + "type": "string" + } + }, + "output-key-mapping": { + "required": false, + "type": "map", + "entry_schema": { + "type": "string" + } + }, + "key-dependencies": { + "required": true, + "type": "list", + "entry_schema": { + "type": "string" + } + } + }, + "derived_from": "tosca.nodes.ResourceSource" + }, + "tosca.nodes.Component": { + "description": "This is default Component Node", + "version": "1.0.0", + "derived_from": "tosca.nodes.Root" + }, + "tosca.nodes.ResourceSource": { + "description": "TOSCA base type for Resource Sources", + "version": "1.0.0", + "derived_from": "tosca.nodes.Root" + } + } +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/oran-sim-blueprint.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/oran-sim-blueprint.json new file mode 100644 index 0000000..9ad633e --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/oran-sim-blueprint.json @@ -0,0 +1,296 @@ +{ + "tosca_definitions_version": "controller_blueprint_1_0_0", + "metadata": { + "template_author": "Lasse Kaihlavirta", + "author-email": "l.kaihlavirt@partner.samsung.com", + "user-groups": "ADMIN, OPERATION", + "template_name": "a1_pe_simulator", + "template_version": "1.3.2", + "template_tags": "samsung, oran", + "template_type": "DEFAULT" + }, + "imports": [ + { + "file": "Definitions/data_types.json" + }, + { + "file": "Definitions/relationship_types.json" + }, + { + "file": "Definitions/artifact_types.json" + }, + { + "file": "Definitions/node_types.json" + }, + { + "file": "Definitions/policy_types.json" + } + ], + "dsl_definitions": { + "multicloud-k8s-api": { + "type": "basic-auth", + "username": "admin", + "password": "admin", + "url": "http://multicloud-k8s:9015" + }, + "aai-api": { + "type": "basic-auth", + "username": "AAI", + "password": "AAI", + "url": "https://aai.onap:8443" + }, + "config-deploy-properties": { + "resolution-key": { + "get_input": "resolution-key" + }, + "vnf-id-value": { + "get_input": "vnf-id" + }, + "api-access": "*multicloud-k8s-api", + "aai-access": "*aai-api" + } + }, + "topology_template": { + "workflows": { + "resource-assignment": { + "steps": { + "resource-assignment": { + "description": "Parameters resolution phase", + "target": "resource-assignment", + "activities": [ + { + "call_operation": "" + } + ] + } + }, + "inputs": { + "template-prefix": { + "required": true, + "type": "list", + "entry_schema": { + "type": "string" + } + }, + "resource-assignment-properties": { + "description": "Dynamic PropertyDefinition for workflow(resource-assignment).", + "required": true, + "type": "dt-resource-assignment-properties" + } + }, + "outputs": { + "meshed-template": { + "type": "json", + "value": { + "get_attribute": [ + "resource-assignment", + "assignment-params" + ] + } + } + } + }, + "config-assign": { + "steps": { + "config-assign": { + "description": "Config Assign Workflow", + "target": "config-assign", + "activities": [ + { + "call_operation": "" + } + ] + } + }, + "inputs": { + "resolution-key": { + "required": true, + "type": "string" + }, + "config-assign-properties": { + "description": "Dynamic PropertyDefinition for workflow(config-assign).", + "required": true, + "type": "dt-config-assign-properties" + } + }, + "outputs": { + "dry-run": { + "type": "json", + "value": { + "get_attribute": [ + "config-assign", + "assignment-params" + ] + } + } + } + }, + "config-deploy": { + "steps": { + "resolve-netconfaccount": { + "description": "Resolve VNF Management Ip Address and Netconf username/password for the Netconf operation.", + "target": "resolve-netconfaccount", + "activities": [ + { + "call_operation": "" + } + ], + "on_success": [ + "imperative-workflow-step-1" + ] + }, + "imperative-workflow-step-1": { + "description": "Config Deploy workflow", + "target": "execute-post", + "activities": [ + { + "call_operation": "ComponentScriptExecutor.process" + } + ] + } + }, + "inputs": { + "resolution-key": { + "required": false, + "type": "string" + }, + "config-deploy-properties": { + "description": "Dynamic PropertyDefinition for workflow(config-deploy).", + "required": true, + "type": "dt-config-deploy-properties" + } + } + } + }, + "node_templates": { + "resource-assignment": { + "type": "component-resource-resolution", + "interfaces": { + "ResourceResolutionComponent": { + "operations": { + "process": { + "inputs": { + "artifact-prefix-names": { + "get_input": "template-prefix" + } + } + } + } + } + }, + "artifacts": { + "vnf-template": { + "type": "artifact-template-velocity", + "file": "Templates/vnf-template.vtl" + }, + "vnf-mapping": { + "type": "artifact-mapping-resource", + "file": "Templates/vnf-mapping.json" + }, + "o-ran-simulator-template": { + "type": "artifact-template-velocity", + "file": "Templates/o-ran-simulator-template.vtl" + }, + "o-ran-simulator-mapping": { + "type": "artifact-mapping-resource", + "file": "Templates/o-ran-simulator-mapping.json" + } + } + }, + "config-assign": { + "type": "component-resource-resolution", + "interfaces": { + "ResourceResolutionComponent": { + "operations": { + "process": { + "inputs": { + "resolution-key": { + "get_input": "resolution-key" + }, + "store-result": true, + "artifact-prefix-names": [ + "ves", + "ues", + "cells" + ] + } + } + } + } + }, + "artifacts": { + "ves-template": { + "type": "artifact-template-velocity", + "file": "Templates/ves-template.vtl" + }, + "ves-mapping": { + "type": "artifact-mapping-resource", + "file": "Templates/ves-mapping.json" + }, + "ues-template": { + "type": "artifact-template-velocity", + "file": "Templates/ues-template.vtl" + }, + "ues-mapping": { + "type": "artifact-mapping-resource", + "file": "Templates/ues-mapping.json" + }, + "cells-template": { + "type": "artifact-template-velocity", + "file": "Templates/cells-template.vtl" + }, + "cells-mapping": { + "type": "artifact-mapping-resource", + "file": "Templates/cells-mapping.json" + } + } + }, + "resolve-netconfaccount": { + "type": "component-resource-resolution", + "interfaces": { + "ResourceResolutionComponent": { + "operations": { + "process": { + "inputs": { + "resolution-key": { + "get_input": "resolution-key" + }, + "store-result": true, + "artifact-prefix-names": [ + "req-input" + ] + } + } + } + } + }, + "artifacts": { + "req-input-template": { + "type": "artifact-template-velocity", + "file": "Templates/req-input-template.vtl" + }, + "req-input-mapping": { + "type": "artifact-mapping-resource", + "file": "Templates/req-input-mapping.json" + } + } + }, + "execute-post": { + "type": "component-script-executor", + "interfaces": { + "ComponentScriptExecutor": { + "operations": { + "process": { + "inputs": { + "script-type": "kotlin", + "script-class-reference": "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.DayOneConfig", + "dynamic-properties": "*config-deploy-properties" + } + } + } + } + } + } + } + } +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/policy_types.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/policy_types.json new file mode 100644 index 0000000..ff6420e --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/policy_types.json @@ -0,0 +1,3 @@ +{ + "policy_types": {} +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/relationship_types.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/relationship_types.json new file mode 100644 index 0000000..5000ce5 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/relationship_types.json @@ -0,0 +1,3 @@ +{ + "relationship_types": {} +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/resources_definition_types.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/resources_definition_types.json new file mode 100644 index 0000000..5885e0f --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Definitions/resources_definition_types.json @@ -0,0 +1,548 @@ +{ + "aic-cloud-region": { + "tags": "aic-cloud-region", + "name": "aic-cloud-region", + "property": { + "description": "aic-cloud-region", + "type": "string" + }, + "group": "default", + "updated-by": "Singal, Kapil <ks220y@att.com>", + "sources": { + "input": { + "type": "source-input", + "properties": {} + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-request-input", + "path": "/vnf-request-input/aic-cloud-region", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "aic-cloud-region": "aic-cloud-region" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + } + } + }, + "cells-payload": { + "tags": "cells-payload", + "name": "cells-payload", + "property": { + "description": "Cells topology json config", + "type": "string" + }, + "group": "default", + "updated-by": "Konrad Banka <k.banka@samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "externalNodeIp": { + "tags": "externalNodeIp", + "name": "externalNodeIp", + "property": { + "description": "Host name or IP address for VNF Event Stream (VES) collector in ONAP DCAE", + "type": "string" + }, + "group": "default", + "updated-by": "Samuli, Silvius <s.silvius@partner.samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "oran_name": { + "tags": "oran_name", + "name": "oran_name", + "property": { + "description": "ORAN name", + "type": "string" + }, + "group": "default", + "updated-by": "L.K.", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "service-instance-id": { + "tags": "service-instance-id, tosca.datatypes.Root, data_type", + "name": "service-instance-id", + "property": { + "description": "To be provided", + "type": "string" + }, + "group": "default", + "updated-by": "Singal, Kapil <ks220y@att.com>", + "sources": { + "input": { + "type": "source-input", + "properties": {} + }, + "any-db": { + "type": "source-db", + "properties": { + "query": "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"", + "input-key-mapping": {}, + "output-key-mapping": { + "service-instance-id": "artifact_name" + } + } + }, + "processor-db": { + "type": "source-db", + "properties": { + "query": "SELECT artifact_name FROM BLUEPRINT_RUNTIME where artifact_version=\"1.0.0\"", + "input-key-mapping": {}, + "output-key-mapping": { + "service-instance-id": "artifact_name" + } + } + }, + "capability": { + "type": "source-capability", + "properties": { + "script-type": "jython", + "script-class-reference": "SampleRAProcessor", + "instance-dependencies": [] + } + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id", + "path": "/service/0/service-instance-id", + "input-key-mapping": { + "service-instance-id": "service-instance.service-instance-id" + }, + "output-key-mapping": { + "service-instance-id": "service-instance-id" + }, + "key-dependencies": [ + "service-instance.service-instance-id" + ] + } + } + } + }, + "ues-payload": { + "tags": "ues-payload", + "name": "ues-payload", + "property": { + "description": "User Equipment json config", + "type": "string" + }, + "group": "default", + "updated-by": "Konrad Banka <k.banka@samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "ves-password": { + "tags": "ves, dcae", + "name": "ves-password", + "property": { + "description": "Ves password", + "type": "string" + }, + "group": "default", + "updated-by": "Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "ves-port": { + "tags": "ves-port", + "name": "ves-port", + "property": { + "description": "Port for VNF Event Stream (VES) collector in ONAP DCAE.", + "type": "string" + }, + "group": "default", + "updated-by": "Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "ves-user": { + "tags": "ves, dcae", + "name": "ves-user", + "property": { + "description": "Username for VNF Event Stream (VES) collector in ONAP DCAE.", + "type": "string" + }, + "group": "default", + "updated-by": "Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "vf-module-id": { + "tags": "vf-module-id", + "name": "vf-module-id", + "property": { + "description": "vf-module-id", + "type": "string" + }, + "group": "default", + "updated-by": "Singal, Kapil <ks220y@att.com>", + "sources": { + "input": { + "type": "source-input", + "properties": {} + } + } + }, + "vf-module-label": { + "tags": "vf-module-label", + "name": "vf-module-label", + "property": { + "description": "vf-module-label", + "type": "string" + }, + "group": "default", + "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + }, + "processor-db": { + "type": "source-db", + "properties": { + "type": "SQL", + "query": "select sdnctl.VF_MODULE_MODEL.vf_module_label as vf_module_label from sdnctl.VF_MODULE_MODEL where sdnctl.VF_MODULE_MODEL.customization_uuid=:customizationid", + "input-key-mapping": { + "customizationid": "vf-module-model-customization-uuid" + }, + "output-key-mapping": { + "vf-module-label": "vf_module_label" + }, + "key-dependencies": [ + "vf-module-model-customization-uuid" + ] + } + } + } + }, + "vf-module-model-customization-uuid": { + "tags": "vf-module-model-customization-uuid", + "name": "vf-module-model-customization-uuid", + "property": { + "description": "vf-module-model-customization-uuid", + "type": "string" + }, + "group": "default", + "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "vf-naming-policy": { + "tags": "vf-naming-policy", + "name": "vf-naming-policy", + "property": { + "description": "vf-naming-policy", + "type": "string" + }, + "group": "default", + "updated-by": "Robert Bogacki <r.bogacki@samsung.com>", + "sources": { + "default": { + "type": "source-default", + "properties": {} + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vf-naming-policy", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "vf-naming-policy": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + }, + "processor-db": { + "type": "source-db", + "properties": { + "type": "SQL", + "query": "select sdnctl.VF_MODEL.naming_policy as vf_naming_policy from sdnctl.VF_MODEL where sdnctl.VF_MODEL.customization_uuid=:vnf_model_customization_uuid", + "input-key-mapping": { + "vnf_model_customization_uuid": "vnf-model-customization-uuid" + }, + "output-key-mapping": { + "vf-naming-policy": "vf_naming_policy" + }, + "key-dependencies": [ + "vnf-model-customization-uuid" + ] + } + } + } + }, + "vnf-id": { + "tags": "vnf-id", + "name": "vnf-id", + "property": { + "description": "vnf-id", + "type": "string" + }, + "group": "default", + "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/", + "path": "/vnf/0/vnf-id", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "generic-vnf.vnf-id" + }, + "output-key-mapping": { + "vnf-id": "vnf-id" + }, + "key-dependencies": [ + "service-instance-id", + "generic-vnf.vnf-id" + ] + } + } + } + }, + "vnf-ip-address": { + "tags": "vnf-ip-address", + "name": "vnf-ip-address", + "property": { + "description": "vnf-ip-address", + "type": "string" + }, + "group": "default", + "updated-by": "Robert Bogacki <r.bogacki@samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf-ip-address", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "vnf-ip-address": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + }, + "aai-data": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/aai/v19/network/generic-vnfs/generic-vnf/$vnf-id", + "path": "", + "input-key-mapping": { + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "ipv4-oam-address": "ipv4-oam-address" + }, + "key-dependencies": [ + "vnf-id" + ] + } + } + } + }, + "vnf-name": { + "tags": "vnf-name", + "name": "vnf-name", + "property": { + "description": "vnf-name", + "type": "string" + }, + "group": "default", + "updated-by": "Robert Bogacki <r.bogacki@samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "vnf_name": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + } + } + }, + "vnf-type": { + "tags": "vnf-type", + "name": "vnf-type", + "property": { + "description": "vnf-type", + "type": "string" + }, + "group": "default", + "updated-by": "Robert Bogacki <r.bogacki@samsung.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + }, + "vnf_name": { + "tags": "vnf_name", + "name": "vnf_name", + "property": { + "description": "vnf_name", + "type": "string" + }, + "group": "default", + "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "vnf_name": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + } + } + } +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Scripts/kotlin/DayOneConfig.kt b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Scripts/kotlin/DayOneConfig.kt new file mode 100644 index 0000000..28628dc --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Scripts/kotlin/DayOneConfig.kt @@ -0,0 +1,682 @@ +package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts + +/* +* Copyright © 2019 TechMahindra +* Author: Malinconico Aniello Paolo, Vamshi Namilikonda, Thamlur Raju +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + + +import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.node.ObjectNode +import java.io.File +import java.nio.file.Path +import java.nio.file.Paths +import org.apache.commons.io.FileUtils +import org.apache.commons.io.IOUtils +import org.apache.http.client.ClientProtocolException +import org.apache.http.client.entity.EntityBuilder +import org.apache.http.client.methods.HttpPost +import org.apache.http.client.methods.HttpUriRequest +import org.apache.http.message.BasicHeader +import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput +import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService +import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.RestLoggerService +import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction +import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException +import org.onap.ccsdk.cds.controllerblueprints.core.utils.ArchiveType +import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils +import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils +import org.slf4j.LoggerFactory +import org.springframework.http.HttpHeaders +import org.springframework.http.HttpMethod +import org.springframework.http.MediaType +import org.yaml.snakeyaml.Yaml +import java.io.IOException +import java.util.Base64 +import java.nio.charset.Charset +import java.nio.file.Files +import com.google.gson.Gson +import com.google.gson.reflect.TypeToken +import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifactNB +import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService + +open class DayOneConfig : AbstractScriptComponentFunction() { + + private val log = LoggerFactory.getLogger(DayOneConfig::class.java)!! + + override fun getName(): String { + return "DayOneConfig" + } + + override suspend fun processNB(executionRequest: ExecutionServiceInput) { + log.info("DAY-1 Script execution started") + + val baseK8sApiUrl = getDynamicProperties("api-access").get("url").asText() + val k8sApiUsername = getDynamicProperties("api-access").get("username").asText() + val k8sApiPassword = getDynamicProperties("api-access").get("password").asText() + + log.info("Multi-cloud params $baseK8sApiUrl") + + val aaiApiUrl = getDynamicProperties("aai-access").get("url").asText() + val aaiApiUsername = getDynamicProperties("aai-access").get("username").asText() + val aaiApiPassword = getDynamicProperties("aai-access").get("password").asText() + + log.info("AAI params $aaiApiUrl") + + val vnfID: String = getDynamicProperties("vnf-id-value").asText() + + log.info("Get vnfID $vnfID") + + val vnfUrl = aaiApiUrl + "/aai/v19/network/generic-vnfs/generic-vnf/" + vnfID + "/vf-modules"; + + val mapOfHeaders = hashMapOf<String, String>() + mapOfHeaders.put("Accept", "application/json") + mapOfHeaders.put("Content-Type", "application/json") + mapOfHeaders.put("x-FromAppId", "SO") + mapOfHeaders.put("X-TransactionId", "get_aai_subscr") + val basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties() + basicAuthRestClientProperties.username = aaiApiUsername + basicAuthRestClientProperties.password = aaiApiPassword + basicAuthRestClientProperties.url = vnfUrl + basicAuthRestClientProperties.additionalHeaders = mapOfHeaders + val basicAuthRestClientService: BasicAuthRestClientService = BasicAuthRestClientService(basicAuthRestClientProperties) + try { + val resultOfGet: BlueprintWebClientService.WebClientResponse<String> = basicAuthRestClientService.exchangeResource(HttpMethod.GET.name, "", "") + + val aaiBody = resultOfGet.body + val aaiPayloadObject = JacksonUtils.jsonNode(aaiBody) as ObjectNode + + for (item in aaiPayloadObject.get("vf-module")) { + + log.info("item payload Deatils : $item") + + val vfModuleID: String = item.get("vf-module-id").asText() + log.info("AAI Vf-module ID is : $vfModuleID") + + val vfModuleInvariantID: String = item.get("model-invariant-id").asText() + log.info("AAI Vf-module Invariant ID is : $vfModuleInvariantID") + + val vfModuleUUID: String = item.get("model-version-id").asText() + log.info("AAI Vf-module UUID is : $vfModuleUUID") + + val vfModuleInstance: String = item.get("heat-stack-id").asText() + log.info("AAI Vf-module Heat Stack ID : $vfModuleInstance") + + var delimiter = "/" + + val Instance = vfModuleInstance.split(delimiter) + val instanceName = Instance[0] + val instanceID = Instance[1] + log.info("instance name is : $instanceName") + log.info("K8S instance ID is : $instanceID") + + val typOfVfmodule = "cnf" + log.info("Type of vf-module: $typOfVfmodule") + + val k8sRbProfileName = "default" + + val k8sConfigTemplateName = "template_$vfModuleID" + + val api = K8sConfigTemplateApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleInvariantID, vfModuleUUID, k8sConfigTemplateName) + + // Check if definition exists + if (!api.hasDefinition()) { + throw BluePrintProcessorException("K8s Config Template ($vfModuleInvariantID/$vfModuleUUID) - $k8sConfigTemplateName not found ") + } + + log.info("Config Template name: $k8sConfigTemplateName") + + val configmapName = "res-default-a1-pe-simulator-app-cm" + log.info("configmap retrieved " + typOfVfmodule + " vfmodule -> " + configmapName) + modifyTemplate(configmapName, typOfVfmodule) + + + var configTemplate = K8sConfigTemplate() + configTemplate.templateName = k8sConfigTemplateName + configTemplate.description = " " + configTemplate.ChartName = typOfVfmodule + log.info("Chart name: ${configTemplate.ChartName}") + + if (!api.hasConfigTemplate(configTemplate)) { + log.info("K8s Config Template Upload Started") + api.createConfigTemplate(configTemplate) + val configTemplateFile: Path = prepareConfigTemplateJson() + api.uploadConfigTemplateContent(configTemplate, configTemplateFile) + log.info("K8s Config Template Upload Completed") + val configName = "config_1" + val config = K8sConfigPayloadJson() + config.configName = configName + config.templateName = k8sConfigTemplateName + log.info("Get ves, ues, cells from CDS") + config.values.topic.ves = getVes() + config.values.topic.ues = getUes() + config.values.topic.cells = getCells() + + log.info("config $config.values.topic") + + api.createOrUpdateConfig(config, k8sRbProfileName) + } + } + log.info("DAY-1 Script execution completed") + } catch (e: Exception) { + log.info("Caught exception executing day one operation: ") + log.info("${e}") + // throw BluePrintProcessorException("${e.message}") + } + } + + suspend fun getUes(): String { + val resolutionKey = getDynamicProperties("resolution-key").asText() + + val ues = storedContentFromResolvedArtifactNB(resolutionKey, "ues") + log.info("ues: $ues") + + return ues + } + + suspend fun getVes(): String{ + val resolutionKey = getDynamicProperties("resolution-key").asText() + + val ves = storedContentFromResolvedArtifactNB(resolutionKey, "ves") + log.info("ves: $ves") + + return ves + } + + suspend fun getCells(): String { + val resolutionKey = getDynamicProperties("resolution-key").asText() + + val cells = storedContentFromResolvedArtifactNB(resolutionKey, "cells") + log.info("cells: $cells") + + return cells + } + + fun prepareConfigTemplateJson(): Path { + val bluePrintContext = bluePrintRuntimeService.bluePrintContext() + val bluePrintBasePath: String = bluePrintContext.rootPath + + var profileFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus("cnf-config-template.tar.gz")) + log.info("Reading K8s Config Template file: $profileFilePath") + + val profileFile = profileFilePath.toFile() + + if (!profileFile.exists()) + throw BluePrintProcessorException("K8s Profile template file $profileFilePath does not exists") + + return profileFilePath + } + + override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { + log.info("Executing Recovery") + bluePrintRuntimeService.getBluePrintError().addError("${runtimeException.message}") + } + + fun modifyTemplate(configmapName: String, typOfVfmodule: String): String { + + log.info("Executing modifyTemplate ->") + + val bluePrintContext = bluePrintRuntimeService.bluePrintContext() + val bluePrintBasePath: String = bluePrintContext.rootPath + + val destPath: String = "/tmp/config-template-" + typOfVfmodule + + var templateFilePath: Path = Paths.get(bluePrintBasePath.plus(File.separator).plus("Templates").plus(File.separator).plus("k8s-profiles").plus(File.separator).plus("cnf-config-template.tar.gz")) + + log.info("Reading config template file: ${templateFilePath}") + val templateFile = templateFilePath.toFile() + + if (!templateFile.exists()) + throw BluePrintProcessorException("K8s Profile template file ${templateFilePath} does not exists") + + log.info("Purging ${destPath} before decompression") + + FileUtils.deleteQuietly(File(destPath)) + + log.info("Decompressing config template to ${destPath}") + + val decompressedProfile: File = BluePrintArchiveUtils.deCompress(templateFilePath.toFile(), + "${destPath}", ArchiveType.TarGz) + + log.info("${templateFilePath.toString()} decompression completed") + + //Here we update override.yaml file + + val manifestFileName = destPath.plus(File.separator).plus(typOfVfmodule).plus(File.separator).plus("templates").plus(File.separator).plus("configmap.yaml") + log.info("Modification of configmap.yaml file at ${manifestFileName.toString()}") + var finalManifest = "" + File(manifestFileName).bufferedReader().use { inr -> + try { + val manifestYaml = Yaml() + val manifestObject: Map<String, Any> = manifestYaml.load(inr) + + for ((k, v) in manifestObject) { + log.info("manifestObject: ${k}, ${v}") + } + + log.info("Uploaded YAML object") + + val metadata: MutableMap<String, Any> = manifestObject.get("metadata") as MutableMap<String, Any> + log.info("Uploaded config YAML object") + + for ((k, v) in metadata) { + metadata.put(k, configmapName) + } + + finalManifest = manifestYaml.dump(manifestObject) + } catch (e: Exception) { + log.info("Error during parsing the configmap.yaml: ${e}") + } + } + + File(manifestFileName).bufferedWriter().use { out -> out.write(finalManifest) } + + log.info(finalManifest) + + log.info("Reading config template file: ${templateFilePath}") + + if (!templateFile.exists()) + throw BluePrintProcessorException("config template file ${templateFilePath} does not exists") + + val tempMainPath: File = createTempDir("config-template-", "") + val tempConfigTemplatePath: File = createTempDir("conftemplate-", "", tempMainPath) + log.info("Decompressing profile to ${tempConfigTemplatePath.toString()}") + + val decompressedProfile2: File = BluePrintArchiveUtils.deCompress(templateFilePath.toFile(), + "${tempConfigTemplatePath.toString()}", ArchiveType.TarGz) + + log.info("${templateFilePath.toString()} decompression completed") + + //Here we update configmap.yaml file + + log.info("Modification of configmap.yaml file ") + val manifestFileName2 = destPath.toString().plus(File.separator).plus(typOfVfmodule).plus(File.separator).plus("templates").plus(File.separator).plus("configmap.yaml") + val destOverrideFile = tempConfigTemplatePath.toString().plus(File.separator).plus(typOfVfmodule).plus(File.separator).plus("templates").plus(File.separator).plus("configmap.yaml") + log.info("destination override file ${destOverrideFile}") + + File(manifestFileName2).copyTo(File(destOverrideFile), true) + + if (!BluePrintArchiveUtils.compress(decompressedProfile2, templateFilePath.toFile(), + ArchiveType.TarGz)) { + throw BluePrintProcessorException("Profile compression has failed") + } + + log.info("${templateFilePath.toString()} compression completed") + + return "" + } + + inner class K8sInstanceApi( + val username: String, + val password: String, + val baseUrl: String, + val definition: String, + val definitionVersion: String + ) { + private val service: UploadConfigTemplateRestClientService // BasicAuthRestClientService + + init { + var mapOfHeaders = hashMapOf<String, String>() + mapOfHeaders.put("Accept", "application/json") + mapOfHeaders.put("Content-Type", "application/json") + mapOfHeaders.put("cache-control", " no-cache") + mapOfHeaders.put("Accept", "application/json") + var basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties() + basicAuthRestClientProperties.username = username + basicAuthRestClientProperties.password = password + basicAuthRestClientProperties.url = "$baseUrl/v1/instance" + basicAuthRestClientProperties.additionalHeaders = mapOfHeaders + + this.service = UploadConfigTemplateRestClientService(basicAuthRestClientProperties) + } + + fun getInstanceDetails(instanceId: String): String { + log.info("Executing K8sInstanceApi.getInstanceDetails") + try { + val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource(HttpMethod.GET.name, "/${instanceId}", "") + print(result) + if (result.status >= 200 && result.status < 300) { + log.info("K8s instance details retrieved, processing it for configmap details") + log.info("response body -> " + result.body.toString()) + val cmName: String = processInstanceResponse(result.body) + return cmName + } else + return "" + } catch (e: Exception) { + log.info("Caught exception trying to get k8s instance details") + throw BluePrintProcessorException("${e.message}") + } + } + + fun processInstanceResponse(response: String): String { + + log.info("K8s instance details retrieved, processing it for configmap details") + + val gson = Gson() + + val startInd = response.indexOf('[') + val endInd = response.indexOf(']') + + val subStr = response.substring(startInd, endInd + 1) + + val resourceType = object : TypeToken<Array<K8sResources>>() {}.type + + var resources: Array<K8sResources> = gson.fromJson(subStr, resourceType) + + for (resource in resources) { + + if (resource.GVK?.Kind == "ConfigMap") { + + return resource.Name + + } + + } + return "" + + } + + } + + inner class K8sConfigTemplateApi( + val username: String, + val password: String, + val baseUrl: String, + val definition: String, + val definitionVersion: String, + val configTemplateName: String + ) { + private val service: UploadConfigTemplateRestClientService // BasicAuthRestClientService + + init { + var mapOfHeaders = hashMapOf<String, String>() + mapOfHeaders.put("Accept", "application/json") + mapOfHeaders.put("Content-Type", "application/json") + mapOfHeaders.put("cache-control", " no-cache") + mapOfHeaders.put("Accept", "application/json") + var basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties() + basicAuthRestClientProperties.username = username + basicAuthRestClientProperties.password = password + basicAuthRestClientProperties.url = "$baseUrl/v1/rb/definition/$definition/$definitionVersion" + basicAuthRestClientProperties.additionalHeaders = mapOfHeaders + + this.service = UploadConfigTemplateRestClientService(basicAuthRestClientProperties) + } + + fun hasDefinition(): Boolean { + try { + val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource(HttpMethod.GET.name, "", "") + print(result) + return result.status >= 200 && result.status < 300 + } catch (e: Exception) { + log.info("Caught exception trying to get k8s config template definition") + throw BluePrintProcessorException("${e.message}") + } + } + + fun hasConfigTemplate(profile: K8sConfigTemplate): Boolean { + try { + val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource(HttpMethod.GET.name, "/config-template/${profile.templateName}", "") + print(result) + if (result.status >= 200 && result.status < 300) { + log.info("ConfigTemplate already exists") + return true + } else + return false + } catch (e: Exception) { + log.info("Caught exception trying to get k8s config trmplate definition") + throw BluePrintProcessorException("${e.message}") + } + } + + fun createOrUpdateConfig(configJson: K8sConfigPayloadJson, profileName: String) { + val objectMapper = ObjectMapper() + + val configJsonString: String = objectMapper.writeValueAsString(configJson) + + log.info("payload generated -> " + configJsonString) + + try { + val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource(HttpMethod.POST.name, + "/profile/${profileName}/config", configJsonString) + if (result.status < 200 || result.status >= 300) { + throw Exception(result.body) + } + } catch (e: Exception) { + log.info("Caught exception trying to create or update configuration ") + throw BluePrintProcessorException("${e.message}") + } + } + + fun createConfigTemplate(profile: K8sConfigTemplate) { + val objectMapper = ObjectMapper() + val profileJsonString: String = objectMapper.writeValueAsString(profile) + try { + val result: BlueprintWebClientService.WebClientResponse<String> = service.exchangeResource( + HttpMethod.POST.name, + "/config-template", + profileJsonString + ) + + if (result.status >= 200 && result.status < 300) { + log.info("Config template json info uploaded correctly") + } else if (result.status < 200 || result.status >= 300) { + log.info("Config template already exists") + } + } catch (e: Exception) { + log.info("Caught exception trying to create k8s config template ${profile.templateName} - updated") +// throw BluePrintProcessorException("${e.message}") + } + } + + fun uploadConfigTemplateContent(profile: K8sConfigTemplate, filePath: Path) { + try { + val result: BlueprintWebClientService.WebClientResponse<String> = service.uploadBinaryFile( + "/config-template/${profile.templateName}/content", + filePath + ) + if (result.status < 200 || result.status >= 300) { + throw Exception(result.body) + } + } catch (e: Exception) { + log.info("Caught exception trying to upload k8s config template ${profile.templateName}") + throw BluePrintProcessorException("${e.message}") + } + } + + + } +} + +class UploadConfigTemplateRestClientService( + private val restClientProperties: BasicAuthRestClientProperties +) : BlueprintWebClientService { + + override fun defaultHeaders(): Map<String, String> { + + val encodedCredentials = setBasicAuth( + restClientProperties.username, + restClientProperties.password + ) + return mapOf( + HttpHeaders.CONTENT_TYPE to MediaType.APPLICATION_JSON_VALUE, + HttpHeaders.ACCEPT to MediaType.APPLICATION_JSON_VALUE, + HttpHeaders.AUTHORIZATION to "Basic $encodedCredentials" + ) + } + + override fun host(uri: String): String { + return restClientProperties.url + uri + } + + override fun convertToBasicHeaders(headers: Map<String, String>): + Array<BasicHeader> { + val customHeaders: MutableMap<String, String> = headers.toMutableMap() + // inject additionalHeaders + customHeaders.putAll(verifyAdditionalHeaders(restClientProperties)) + + if (!headers.containsKey(HttpHeaders.AUTHORIZATION)) { + val encodedCredentials = setBasicAuth( + restClientProperties.username, + restClientProperties.password + ) + customHeaders[HttpHeaders.AUTHORIZATION] = + "Basic $encodedCredentials" + } + return super.convertToBasicHeaders(customHeaders) + } + + private fun setBasicAuth(username: String, password: String): String { + val credentialsString = "$username:$password" + return Base64.getEncoder().encodeToString( + credentialsString.toByteArray(Charset.defaultCharset()) + ) + } + + @Throws(IOException::class, ClientProtocolException::class) + private fun performHttpCall(httpUriRequest: HttpUriRequest): BlueprintWebClientService.WebClientResponse<String> { + val httpResponse = httpClient().execute(httpUriRequest) + val statusCode = httpResponse.statusLine.statusCode + httpResponse.entity.content.use { + val body = IOUtils.toString(it, Charset.defaultCharset()) + return BlueprintWebClientService.WebClientResponse(statusCode, body) + } + } + + fun uploadBinaryFile(path: String, filePath: Path): BlueprintWebClientService.WebClientResponse<String> { + val convertedHeaders: Array<BasicHeader> = convertToBasicHeaders(defaultHeaders()) + val httpPost = HttpPost(host(path)) + val entity = EntityBuilder.create().setBinary(Files.readAllBytes(filePath)).build() + httpPost.setEntity(entity) + RestLoggerService.httpInvoking(convertedHeaders) + httpPost.setHeaders(convertedHeaders) + return performHttpCall(httpPost) + } +} + +class K8sConfigTemplate { + @get:JsonProperty("template-name") + var templateName: String? = null + + @get:JsonProperty("description") + var description: String? = null + + @get:JsonProperty("ChartName") + var ChartName: String? = null + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + return true + } + + override fun hashCode(): Int { + return javaClass.hashCode() + } +} + +class K8sConfigPayloadJson { + @get:JsonProperty("template-name") + var templateName: String? = null + + @get:JsonProperty("config-name") + var configName: String? = null + + @get:JsonProperty("values") + var values: Values = Values() + + override fun toString(): String { + return "$templateName:$configName:$values" + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + return true + } + + override fun hashCode(): Int { + return javaClass.hashCode() + } + +} + +class Values { + @get:JsonProperty("namespace") + var namespace = "default" + + @get:JsonProperty("topic") + var topic = Topic() + + override fun toString(): String { + return "$namespace:$topic" + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + return true + } + + override fun hashCode(): Int { + return javaClass.hashCode() + } + +} + +class Topic { + @get:JsonProperty("ves") + var ves: String? = null + + @get:JsonProperty("cells") + var cells: String? = null + + @get:JsonProperty("ues") + var ues: String? = null + + override fun toString(): String { + return "$ves:$cells:$ues" + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + return true + } + + override fun hashCode(): Int { + return javaClass.hashCode() + } + +} + +class K8sResources { + + var GVK: GVK? = null + lateinit var Name: String + +} + +class GVK { + + var Group: String? = null + var Version: String? = null + var Kind: String? = null + +} + diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/TOSCA-Metadata/TOSCA.meta b/operations/a1-pe-sim-packages/resources/oran-sim-cba/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 0000000..f5b072c --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,8 @@ +TOSCA-Meta-File-Version: 0.0.1 +CSAR-Version: 1.0 +Created-By: Lasse Kaihlavirta +Entry-Definitions: Definitions/oran-sim-blueprint.json +Template-Name: a1_pe_simulator +Template-Version: 1.3.2 +Template-Tags: samsung, oran +Content-Type: application/vnd.oasis.bpmn diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/cells-mapping.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/cells-mapping.json new file mode 100644 index 0000000..d75c4f3 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/cells-mapping.json @@ -0,0 +1,13 @@ +[ + { + "name": "cells-payload", + "input-param": true, + "property": { + "type": "string", + "default": "" + }, + "dictionary-name": "cells-payload", + "dictionary-source": "default", + "dependencies": [] + } +] diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/cells-template.vtl b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/cells-template.vtl new file mode 100644 index 0000000..9ab26ca --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/cells-template.vtl @@ -0,0 +1,129 @@ +#if( $cells-payload != "") +$cells-payload +#else +{ + "cellList": [ + { + "Cell": { + "networkId": "RAN001", + "nodeId": "Cell1", + "physicalCellId": 0, + "pnfName": "ncserver1", + "sectorNumber": 0, + "latitude": "50.11", + "longitude": "19.98" + }, + "neighbor": [ + { + "nodeId": "Cell3", + "blacklisted": "false" + }, + { + "nodeId": "Cell4", + "blacklisted": "false" + }, + { + "nodeId": "Cell2", + "blacklisted": "false" + } + ] + }, + { + "Cell": { + "networkId": "RAN001", + "nodeId": "Cell2", + "physicalCellId": 1, + "pnfName": "ncserver1", + "sectorNumber": 0, + "latitude": "50.06", + "longitude": "20.03" + }, + "neighbor": [ + { + "nodeId": "Cell5", + "blacklisted": "false" + }, + { + "nodeId": "Cell1", + "blacklisted": "false" + }, + { + "nodeId": "Cell3", + "blacklisted": "false" + } + ] + }, + { + "Cell": { + "networkId": "RAN001", + "nodeId": "Cell3", + "physicalCellId": 3, + "pnfName": "ncserver1", + "sectorNumber": 0, + "latitude": "50.06", + "longitude": "19.94" + }, + "neighbor": [ + { + "nodeId": "Cell5", + "blacklisted": "false" + }, + { + "nodeId": "Cell1", + "blacklisted": "false" + }, + { + "nodeId": "Cell4", + "blacklisted": "false" + }, + { + "nodeId": "Cell2", + "blacklisted": "false" + } + ] + }, + { + "Cell": { + "networkId": "RAN001", + "nodeId": "Cell4", + "physicalCellId": 4, + "pnfName": "ncserver1", + "sectorNumber": 0, + "latitude": "50.11", + "longitude": "19.88" + }, + "neighbor": [ + { + "nodeId": "Cell3", + "blacklisted": "false" + }, + { + "nodeId": "Cell1", + "blacklisted": "false" + } + ] + }, + { + "Cell": { + "networkId": "RAN001", + "nodeId": "Cell5", + "physicalCellId": 6, + "pnfName": "ncserver1", + "sectorNumber": 0, + "latitude": "50.01", + "longitude": "19.99" + }, + "neighbor": [ + { + "nodeId": "Cell3", + "blacklisted": "false" + }, + { + "nodeId": "Cell2", + "blacklisted": "false" + } + ] + } + ] +} +#end diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/k8s-profiles/cnf-config-template.tar.gz b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/k8s-profiles/cnf-config-template.tar.gz Binary files differnew file mode 100644 index 0000000..d5bcef4 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/k8s-profiles/cnf-config-template.tar.gz diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/o-ran-simulator-mapping.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/o-ran-simulator-mapping.json new file mode 100644 index 0000000..b8b779c --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/o-ran-simulator-mapping.json @@ -0,0 +1,155 @@ +[ + { + "name": "vnf_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vnf_name", + "dictionary-source": "sdnc", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "oran_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + }, + "default": "${oran_name}" + }, + "input-param": false, + "dictionary-name": "oran_name", + "dictionary-source": "default", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-naming-policy", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + }, + "default": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP" + }, + "input-param": false, + "dictionary-name": "vf-naming-policy", + "dictionary-source": "default", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-id", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vf-module-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vf-module-label", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-label", + "dictionary-source": "processor-db", + "dependencies": [ + "vf-module-model-customization-uuid" + ], + "version": 0 + }, + { + "name": "vf-module-model-customization-uuid", + "property": { + "description": "", + "required": false, + "type": "string" + }, + "input-param": false, + "dictionary-name": "vf-module-model-customization-uuid", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "service-instance-id", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vnf-id", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + } +] diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/o-ran-simulator-template.vtl b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/o-ran-simulator-template.vtl new file mode 100644 index 0000000..014d074 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/o-ran-simulator-template.vtl @@ -0,0 +1,61 @@ +{ + "resource-accumulator-resolved-data": [ + { + "param-name": "k8s-rb-instance-release-name", + "param-value": "default" + } + ], + "capability-data": [ + { + "capability-name": "generate-name", + "key-mapping": [ + { + "payload": [ + { + "param-name": "VF_MODULE_TYPE", + "param-value": "vfmt" + }, + { + "param-name": "resource-name", + "param-value": "oran_name" + }, + { + "param-name": "resource-value", + "param-value": "${oran_name}" + }, + { + "param-name": "external-key", + "param-value": "${vf-module-id}_oran_name" + }, + { + "param-name": "policy-instance-name", + "param-value": "${vf-naming-policy}" + }, + { + "param-name": "naming-type", + "param-value": "VF-MODULE" + }, + { + "param-name": "VNF_NAME", + "param-value": "${vnf_name}" + }, + { + "param-name": "VF_MODULE_LABEL", + "param-value": "${vf-module-label}" + }, + { + "param-name": "NFC_NAMING_CODE", + "param-value": "ORAN" + } + ], + "output-key-mapping": [ + { + "resource-name": "oran_name", + "resource-value": "${oran_name}" + } + ] + } + ] + } + ] +} diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/req-input-mapping.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/req-input-mapping.json new file mode 100644 index 0000000..77326e8 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/req-input-mapping.json @@ -0,0 +1,22 @@ +[ + { + "name": "vnf-id", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [] + }, + { + "name": "service-instance-id", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "dependencies": [] + } +] diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/req-input-template.vtl b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/req-input-template.vtl new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/req-input-template.vtl diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ues-mapping.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ues-mapping.json new file mode 100644 index 0000000..23e82dc --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ues-mapping.json @@ -0,0 +1,13 @@ +[ + { + "name": "ues-payload", + "input-param": true, + "property": { + "type": "string", + "default": "" + }, + "dictionary-name": "ues-payload", + "dictionary-source": "default", + "dependencies": [] + } +] diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ues-template.vtl b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ues-template.vtl new file mode 100644 index 0000000..954478c --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ues-template.vtl @@ -0,0 +1,24 @@ +#if( $ues-payload != "") +${ues-payload} +#else +[ + { + "id": "emergency_samsung_s10_01", + "latitude": "50.09", + "longitude": "19.94", + "cellId": "Cell1" + }, + { + "id": "mobile_samsung_s20_02", + "latitude": "50.05", + "longitude": "19.95", + "cellId": "Cell3" + }, + { + "id": "emergency_police_01", + "latitude": "50.035", + "longitude": "19.97", + "cellId": "Cell3" + } +] +#end diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ves-mapping.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ves-mapping.json new file mode 100644 index 0000000..596bae2 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ves-mapping.json @@ -0,0 +1,77 @@ +[ + { + "name": "vnf-id", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [] + }, + { + "name": "vnf-name", + "input-param": true, + "property": { + "type": "string", + "default": "oran-sim-name" + }, + "dictionary-name": "vnf-name", + "dictionary-source": "default", + "dependencies": [] + }, + { + "name": "vnf-type", + "input-param": true, + "property": { + "type": "string", + "default": "oran-sim-type" + }, + "dictionary-name": "vnf-type", + "dictionary-source": "default", + "dependencies": [] + }, + { + "name": "externalNodeIp", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "externalNodeIp", + "dictionary-source": "input", + "dependencies": [] + }, + { + "name": "ves-port", + "input-param": true, + "property": { + "type": "string", + "default": "30417" + }, + "dictionary-name": "ves-port", + "dictionary-source": "default", + "dependencies": [] + }, + { + "name": "ves-user", + "input-param": true, + "property": { + "type": "string", + "default": "sample1" + }, + "dictionary-name": "ves-user", + "dictionary-source": "default", + "dependencies": [] + }, + { + "name": "ves-password", + "input-param": true, + "property": { + "type": "string", + "default": "sample1" + }, + "dictionary-name": "ves-password", + "dictionary-source": "default", + "dependencies": [] + } +] diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ves-template.vtl b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ves-template.vtl new file mode 100644 index 0000000..af7669e --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/ves-template.vtl @@ -0,0 +1,7 @@ +vnfType=$vnf-type +vnfId=$vnf-id +vnfName=$vnf-name +vesHost=$externalNodeIp +vesPort=$ves-port +vesPassword=$ves-user +vesUser=$ves-password diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/vnf-mapping.json b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/vnf-mapping.json new file mode 100644 index 0000000..cba47d9 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/vnf-mapping.json @@ -0,0 +1,104 @@ +[ + { + "name": "vf-naming-policy", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + }, + "default": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP" + }, + "input-param": false, + "dictionary-name": "vf-naming-policy", + "dictionary-source": "default", + "dependencies": [], + "version": 0 + }, + { + "name": "aic-cloud-region", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "aic-cloud-region", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vnf-id", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vnf-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + }, + { + "name": "vnf-ip-address", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + }, + "default": "${vnf-ip-address}" + }, + "input-param": false, + "dictionary-name": "vnf-ip-address", + "dictionary-source": "aai-data", + "dependencies": [], + "version": 0 + }, + { + "name": "service-instance-id", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "dependencies": [], + "version": 0 + } +] diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/vnf-template.vtl b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/vnf-template.vtl new file mode 100644 index 0000000..cc7d0d6 --- /dev/null +++ b/operations/a1-pe-sim-packages/resources/oran-sim-cba/Templates/vnf-template.vtl @@ -0,0 +1,49 @@ +{ + "resource-accumulator-resolved-data": [ + { + "param-name": "vnf-ip-address", + "param-value": "${vnf-ip-address}" + } + ], + "capability-data": [ + { + "capability-name": "generate-name", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vnf_name", + "resource-value": "${vnf_name}" + } + ], + "payload": [ + { + "param-name": "resource-name", + "param-value": "vnf_name" + }, + { + "param-name": "resource-value", + "param-value": "${vnf_name}" + }, + { + "param-name": "external-key", + "param-value": "${vnf-id}_vnf_name" + }, + { + "param-name": "policy-instance-name", + "param-value": "${vf-naming-policy}" + }, + { + "param-name": "naming-type", + "param-value": "VNF" + }, + { + "param-name": "AIC_CLOUD_REGION", + "param-value": "${aic-cloud-region}" + } + ] + } + ] + } + ] +} |