...
Policy Tosca Json
Code Block | ||||
---|---|---|---|---|
| ||||
{
"tosca_definitions_version": "tosca_simple_yaml_1_1_0",
"topology_template": {
"policies": [
{
"onap.policies.native.apex.MDONS": {
"type": "onap.policies.native.Apex",
"type_version": "1.0.0",
"name": "onap.policies.native.apex.MDONS",
"version": "1.0.0",
"properties": {
"engineServiceParameters": {
"name": "MDONSApexEngine",
"version": "0.0.1",
"id": 45,
"instanceCount": 1,
"deploymentPort": 12561,
"engineParameters": {
"executorParameters": {
"MVEL": {
"parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters"
},
"JAVASCRIPT": {
"parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
}
},
"contextParameters": {
"parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters",
"schemaParameters": {
"Avro": {
"parameterClassName": "org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters"
},
"Java": {
"parameterClassName": "org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters",
"jsonAdapters": {
"Instant": {
"adaptedClass": "java.time.Instant",
"adaptorClass": "org.onap.policy.controlloop.util.Serialization$GsonInstantAdapter"
}
}
}
}
}
},
"policy_type_impl": {
"apexPolicyModel": {
"key": {
"name": "ApexMDONSPolicy",
"version": "0.0.1"
},
"keyInformation": {
"key": {
"name": "ApexMDONSPolicy_KeyInfo",
"version": "0.0.1"
},
"keyInfoMap": {
"entry": [
{
"key": {
"name": "ApexMDONSPolicy",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ApexMDONSPolicy",
"version": "0.0.1"
},
"UUID": "10bde69d-ec18-3588-8d3a-466ffffc171d",
"description": "Generated description for concept referred to by key \"ApexMDONSPolicy:0.0.1\""
}
},
{
"key": {
"name": "ApexMDONSPolicy_Events",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ApexMDONSPolicy_Events",
"version": "0.0.1"
},
"UUID": "11878f1e-c494-3a47-9d3b-82546509bd27",
"description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Events:0.0.1\""
}
},
{
"key": {
"name": "ApexMDONSPolicy_KeyInfo",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ApexMDONSPolicy_KeyInfo",
"version": "0.0.1"
},
"UUID": "27aa4d87-3bb9-398a-ac0c-18a42dde984d",
"description": "Generated description for concept referred to by key \"ApexMDONSPolicy_KeyInfo:0.0.1\""
}
},
{
"key": {
"name": "ApexMDONSPolicy_Policies",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ApexMDONSPolicy_Policies",
"version": "0.0.1"
},
"UUID": "29c20a92-695a-3d0d-bd4c-477b9e89f442",
"description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Policies:0.0.1\""
}
},
{
"key": {
"name": "ApexMDONSPolicy_Schemas",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ApexMDONSPolicy_Schemas",
"version": "0.0.1"
},
"UUID": "df5e3e94-8581-375c-ae7c-53836351db1d",
"description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Schemas:0.0.1\""
}
},
{
"key": {
"name": "ApexMDONSPolicy_Tasks",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ApexMDONSPolicy_Tasks",
"version": "0.0.1"
},
"UUID": "8b6d3c45-73f6-3337-886f-31105e11868a",
"description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Tasks:0.0.1\""
}
},
{
"key": {
"name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b",
"version": "0.0.1"
},
"UUID": "e1cbb2de-320d-31d5-91c5-1dc3e5434a64",
"description": "Generated description for concept referred to by key \"ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b:0.0.1\""
}
},
{
"key": {
"name": "CreateEventPolicy",
"version": "0.0.1"
},
"value": {
"key": {
"name": "CreateEventPolicy",
"version": "0.0.1"
},
"UUID": "0105451b-d7b5-3bab-99cb-afdd29c02d98",
"description": "Generated description for concept referred to by key \"CreateEventPolicy:0.0.1\""
}
},
{
"key": {
"name": "CreateSDNCRequestPayloadTask",
"version": "0.0.1"
},
"value": {
"key": {
"name": "CreateSDNCRequestPayloadTask",
"version": "0.0.1"
},
"UUID": "8f2c3cbb-a190-3783-96c4-1ebce78d1fa4",
"description": "Generated description for concept referred to by key \"CreateSDNCRequestPayloadTask:0.0.1\""
}
},
{
"key": {
"name": "SDNCInput",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SDNCInput",
"version": "0.0.1"
},
"UUID": "1a7709ce-55fe-340a-90f9-dbb73a5cbcbf",
"description": "Generated description for concept referred to by key \"SDNCInput:0.0.1\""
}
},
{
"key": {
"name": "SDNCRequestEvent",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SDNCRequestEvent",
"version": "0.0.1"
},
"UUID": "ae1d3c7c-37e0-30d9-8af8-1a7ae8407c86",
"description": "Generated description for concept referred to by key \"SDNCRequestEvent:0.0.1\""
}
},
{
"key": {
"name": "SimpleIntType",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SimpleIntType",
"version": "0.0.1"
},
"UUID": "153791fd-ae0a-36a7-88a5-309a7936415d",
"description": "Generated description for concept referred to by key \"SimpleIntType:0.0.1\""
}
},
{
"key": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"UUID": "8a4957cf-9493-3a76-8c22-a208e23259af",
"description": "Generated description for concept referred to by key \"SimpleStringType:0.0.1\""
}
},
{
"key": {
"name": "UUIDType",
"version": "0.0.1"
},
"value": {
"key": {
"name": "UUIDType",
"version": "0.0.1"
},
"UUID": "6a8cc68e-dfc8-3403-9c6d-071c886b319c",
"description": "Generated description for concept referred to by key \"UUIDType:0.0.1\""
}
},
{
"key": {
"name": "VirtualControlLoopEvent",
"version": "0.0.1"
},
"value": {
"key": {
"name": "VirtualControlLoopEvent",
"version": "0.0.1"
},
"UUID": "600699f3-da4e-3d91-846c-c79953487679",
"description": "Generated description for concept referred to by key \"VirtualControlLoopEvent:0.0.1\""
}
}
]
}
},
"policies": {
"key": {
"name": "ApexMDONSPolicy_Policies",
"version": "0.0.1"
},
"policyMap": {
"entry": [
{
"key": {
"name": "CreateEventPolicy",
"version": "0.0.1"
},
"value": {
"policyKey": {
"name": "CreateEventPolicy",
"version": "0.0.1"
},
"template": "Freestyle",
"state": {
"entry": [
{
"key": "CreateService",
"value": {
"stateKey": {
"parentKeyName": "CreateEventPolicy",
"parentKeyVersion": "0.0.1",
"parentLocalName": "NULL",
"localName": "CreateService"
},
"trigger": {
"name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b",
"version": "0.0.1"
},
"stateOutputs": {
"entry": [
{
"key": "SDNCRequestOutput",
"value": {
"key": {
"parentKeyName": "CreateEventPolicy",
"parentKeyVersion": "0.0.1",
"parentLocalName": "CreateService",
"localName": "SDNCRequestOutput"
},
"outgoingEvent": {
"name": "SDNCRequestEvent",
"version": "0.0.1"
},
"nextState": {
"parentKeyName": "NULL",
"parentKeyVersion": "0.0.0",
"parentLocalName": "NULL",
"localName": "NULL"
}
}
}
]
},
"contextAlbumReference": [],
"taskSelectionLogic": {
"key": "NULL",
"logicFlavour": "UNDEFINED",
"logic": ""
},
"stateFinalizerLogicMap": {
"entry": []
},
"defaultTask": {
"name": "CreateSDNCRequestPayloadTask",
"version": "0.0.1"
},
"taskReferences": {
"entry": [
{
"key": {
"name": "CreateSDNCRequestPayloadTask",
"version": "0.0.1"
},
"value": {
"key": {
"parentKeyName": "CreateEventPolicy",
"parentKeyVersion": "0.0.1",
"parentLocalName": "CreateService",
"localName": "CreateEventPolicy"
},
"outputType": "DIRECT",
"output": {
"parentKeyName": "CreateEventPolicy",
"parentKeyVersion": "0.0.1",
"parentLocalName": "CreateService",
"localName": "SDNCRequestOutput"
}
}
}
]
}
}
}
]
},
"firstState": "CreateService"
}
}
]
}
},
"tasks": {
"key": {
"name": "ApexMDONSPolicy_Tasks",
"version": "0.0.1"
},
"taskMap": {
"entry": [
{
"key": {
"name": "CreateSDNCRequestPayloadTask",
"version": "0.0.1"
},
"value": {
"key": {
"name": "CreateSDNCRequestPayloadTask",
"version": "0.0.1"
},
"inputFields": {
"entry": [
{
"key": "AAI",
"value": {
"key": "AAI",
"fieldSchemaKey": {
"name": "VirtualControlLoopEvent",
"version": "0.0.1"
},
"optional": false
}
}
]
},
"outputFields": {
"entry": [
{
"key": "SDNCInput",
"value": {
"key": "SDNCInput",
"fieldSchemaKey": {
"name": "SDNCInput",
"version": "0.0.1"
},
"optional": false
}
}
]
},
"taskParameters": {
"entry": []
},
"contextAlbumReference": [],
"taskLogic": {
"key": "TaskLogic",
"logicFlavour": "JAVASCRIPT",
"logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2020 Fujitsu. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nvar SDNCInput = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewInstance();\nvar input = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewSubInstance(\"input\");\n \nvar clEvent = executor.inFields.get(\"AAI\");\nexecutor.logger.info(clEvent.toString());\n\ninput.put(\"module_DasH_name\",\"optical-service\");\ninput.put(\"rpc_DasH_name\",\"mdons-closed-loop\");\ninput.put(\"mode\",\"sync\");\n\nvar sliParam1 = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewSubInstance(\"sli_DasH_parameter_record\");\nsliParam1.put(\"parameter_DasH_name\",\"service-name\");\nsliParam1.put(\"string_DasH_value\",clEvent.get(\"service_DasH_name\"));\n\nvar sliParam2 = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewSubInstance(\"sli_DasH_parameter_record\");\nsliParam2.put(\"parameter_DasH_name\",\"access-service-id\");\nsliParam2.put(\"string_DasH_value\",clEvent.get(\"request_DasH_id\"));\n\nvar sliParamArray = [];\nsliParamArray.push(sliParam1);\nsliParamArray.push(sliParam2);\n\ninput.put(\"sli_DasH_parameter\",sliParamArray);\nSDNCInput.put(\"input\",input);\n\nexecutor.outFields.put(\"SDNCInput\", SDNCInput);\n\nexecutor.logger.info(SDNCInput.toString());\n\ntrue;"
}
}
}
]
}
},
"events": {
"key": {
"name": "ApexMDONSPolicy_Events",
"version": "0.0.1"
},
"eventMap": {
"entry": [
{
"key": {
"name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b",
"version": "0.0.1"
},
"value": {
"key": {
"name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b",
"version": "0.0.1"
},
"nameSpace": "org.onap.policy.apex.onap.pmcontrol",
"source": "DCAE",
"target": "APEX",
"parameter": {
"entry": [
{
"key": "AAI",
"value": {
"key": "AAI",
"fieldSchemaKey": {
"name": "VirtualControlLoopEvent",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "closedLoopAlarmStart",
"value": {
"key": "closedLoopAlarmStart",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "closedLoopControlName",
"value": {
"key": "closedLoopControlName",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "closedLoopEventClient",
"value": {
"key": "closedLoopEventClient",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "closedLoopEventStatus",
"value": {
"key": "closedLoopEventStatus",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "from",
"value": {
"key": "from",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "policyName",
"value": {
"key": "policyName",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "policyScope",
"value": {
"key": "policyScope",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "policyVersion",
"value": {
"key": "policyVersion",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "requestID",
"value": {
"key": "requestID",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "target",
"value": {
"key": "target",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "target_type",
"value": {
"key": "target_type",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
},
{
"key": "version",
"value": {
"key": "version",
"fieldSchemaKey": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"optional": false
}
}
]
}
}
},
{
"key": {
"name": "SDNCRequestEvent",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SDNCRequestEvent",
"version": "0.0.1"
},
"nameSpace": "org.onap.policy.apex.onap.pmcontrol",
"source": "APEX",
"target": "SDNC",
"parameter": {
"entry": [
{
"key": "SDNCInput",
"value": {
"key": "SDNCInput",
"fieldSchemaKey": {
"name": "SDNCInput",
"version": "0.0.1"
},
"optional": false
}
}
]
}
}
}
]
}
},
"schemas": {
"key": {
"name": "ApexMDONSPolicy_Schemas",
"version": "0.0.1"
},
"schemas": {
"entry": [
{
"key": {
"name": "SDNCInput",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SDNCInput",
"version": "0.0.1"
},
"schemaFlavour": "Avro",
"schemaDefinition": "{\n \"name\": \"SDNCInput\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"input\",\n \"type\": {\n \"name\": \"input\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"module_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"rpc_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"mode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"sli_DasH_parameter\",\n \"type\": {\n \"type\": \"array\",\n \"items\": {\n \"name\": \"sli_DasH_parameter_record\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"parameter_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"string_DasH_value\",\n \"type\": \"string\"\n }\n ]\n }\n }\n }\n ]\n }\n }\n ]\n}"
}
},
{
"key": {
"name": "SimpleIntType",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SimpleIntType",
"version": "0.0.1"
},
"schemaFlavour": "Java",
"schemaDefinition": "java.lang.Integer"
}
},
{
"key": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"value": {
"key": {
"name": "SimpleStringType",
"version": "0.0.1"
},
"schemaFlavour": "Java",
"schemaDefinition": "java.lang.String"
}
},
{
"key": {
"name": "UUIDType",
"version": "0.0.1"
},
"value": {
"key": {
"name": "UUIDType",
"version": "0.0.1"
},
"schemaFlavour": "Java",
"schemaDefinition": "java.util.UUID"
}
},
{
"key": {
"name": "VirtualControlLoopEvent",
"version": "0.0.1"
},
"value": {
"key": {
"name": "VirtualControlLoopEvent",
"version": "0.0.1"
},
"schemaFlavour": "Avro",
"schemaDefinition": "{\n \"name\": \"AAI\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"request_DasH_id\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service_DasH_type\",\n \"type\": \"string\"\n }\n ]\n}"
}
}
]
}
}
}
}
},
"eventInputParameters": {
"DCAEConsumer": {
"carrierTechnologyParameters": {
"carrierTechnology": "RESTCLIENT",
"parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
"parameters": {
"url": "https://message-router:3905/events/unauthenticated.DCAE_Output_Event/g1/c1?timeout=60000"
}
},
"eventProtocolParameters": {
"eventProtocol": "JSON",
"parameters": {
"nameAlias": "closedLoopControlName",
"versionAlias": "version",
"sourceAlias": "from"
}
}
}
},
"eventOutputParameters": {
"logOutputter": {
"carrierTechnologyParameters": {
"carrierTechnology": "FILE",
"parameters": {
"fileName": "outputevents.log"
}
},
"eventProtocolParameters": {
"eventProtocol": "JSON"
}
},
"SDNCRequestProducer": {
"carrierTechnologyParameters": {
"carrierTechnology": "RESTCLIENT",
"parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters",
"parameters": {
"url": "http://sdnc-oam:8282/restconf/operations/SLI-API:execute-graph",
"httpMethod": "POST",
"httpHeaders": [
[
"Authorization",
"Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="
],
[
"Accept",
"application/json"
],
[
"Content-Type",
"application/json"
]
]
}
},
"eventProtocolParameters": {
"eventProtocol": "JSON",
"parameters": {
"pojoField": "SDNCInput"
}
}
}
}
}
}
}
]
}
}
|
...