diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-10-08 13:36:31 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2019-03-27 22:35:12 +0000 |
commit | f996ef829249c304550becb0cb57db3efd3baf6a (patch) | |
tree | ef2657cd8d44f80b02cfee8db0908a8f9ca7dbf1 /examples/examples-onap-vcpe/src/main | |
parent | cfcffbce70ddc3083e337f18377c0847f7233caa (diff) |
Change vCPE example to use POJOs
This review uses POJOs rather than Avro schema to unmarshal
and marshal events from and to DMaaP.
The POJO classes for interacting with DMaaP have been moved into
a common policy module.
This review is now ready for full review (finally!).
Issue-ID: POLICY-954
Change-Id: Ibb89d8af5b9006821e6a0a756e16bbe3815af15a
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Signed-off-by: liamfallon <liam.fallon@est.tech>
Signed-off-by: Liam Fallon <liam.fallon@est.tech>
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'examples/examples-onap-vcpe/src/main')
40 files changed, 2072 insertions, 804 deletions
diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig.json b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig.json index 4ea4c5633..862bba296 100644 --- a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig.json +++ b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig.json @@ -5,7 +5,7 @@ "id": 45, "instanceCount": 4, "deploymentPort": 12561, - "policyModelFileName": "policy/ONAPvCPEPolicyModel.json", + "policyModelFileName": "/home/apexuser/examples/models/ONAPvCPE/ONAPvCPEPolicyModel.json", "engineParameters": { "executorParameters": { "JAVASCRIPT": { @@ -17,45 +17,69 @@ "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" + }, + "APPC_LCM_REQUEST": { + "adaptedClass": "org.onap.policy.appclcm.LcmRequest", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$RequestAdapter" + }, + "APPC_LCM_RESPONSE": { + "adaptedClass": "org.onap.policy.appclcm.LcmResponse", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$ResponseAdapter" + } + } } } } } }, "eventInputParameters": { - "VCPEInitConsumer": { + "GuardRequestorConsumer": { "carrierTechnologyParameters": { - "carrierTechnology": "FILE", + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", "parameters": { - "fileName": "config/VCPEInitiationEvent.json" + "url": "http://172.18.0.6:8081/pdp/api/getDecision", + "httpMethod": "POST", + "restRequestTimeout": 2000, + "httpHeader": "Authorization:dGVzdHBkcDphbHBoYTEyMw== ClientAuth:cHl0aG9uOnRlc3Q=" } }, "eventProtocolParameters": { - "eventProtocol": "JSON", - "parameters": { - "nameAlias": "closedLoopControlName", - "versionAlias": "version", - "sourceAlias": "from" - } - } + "eventProtocol": "JSON" + }, + "eventName": "GuardResponseEvent", + "eventNameFilter": "GuardResponseEvent", + "requestorMode": true, + "requestorPeer": "GuardRequestorProducer", + "requestorTimeout": 500 }, - "GuardRequestorConsumer": { + "AAIRequestorConsumer": { "carrierTechnologyParameters": { "carrierTechnology": "RESTREQUESTOR", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", "parameters": { - "url": "http://192.168.144.235:54321/AAIAndGuardSim/sim/pdp/api/getDecision", + "url": "http://10.0.1.1:8443/aai/search/named-query", "httpMethod": "POST", "restRequestTimeout": 2000 } }, "eventProtocolParameters": { - "eventProtocol": "JSON" + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryResponse" + } }, - "eventName": "GuardResponseEvent", - "eventNameFilter": "GuardResponseEvent", + "eventName": "AAINamedQueryResponseEvent", + "eventNameFilter": "AAINamedQueryResponseEvent", "requestorMode": true, - "requestorPeer": "GuardRequestorProducer", + "requestorPeer": "AAIRequestorProducer", "requestorTimeout": 500 }, "DCAEConsumer": { @@ -63,7 +87,7 @@ "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { - "url": "http://192.168.144.235:3904/events/unauthenticated.DCAE_CL_OUTPUT/APEX/1?timeout=60000" + "url": "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT/APEX/1?timeout=60000" } }, "eventProtocolParameters": { @@ -71,20 +95,26 @@ "parameters": { "nameAlias": "closedLoopControlName", "versionAlias": "version", - "sourceAlias": "from" + "sourceAlias": "from", + "pojoField": "VirtualControlLoopEvent" } - } + }, + "eventName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e" }, "APPCConsumer": { "carrierTechnologyParameters": { "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { - "url": "http://192.168.144.235:3904/events/APPC_LCM_WRITE/APEX/1?timeout=60000" + "url": "http://10.0.11.1:3904/events/APPC-LCM-WRITE/APEX/1?timeout=60000" } }, "eventProtocolParameters": { - "eventProtocol": "JSON" + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "pojoField": "APPCLCMResponseEvent" + } }, "eventName": "APPCRestartVNFResponseEvent", "eventNameFilter": "APPCRestartVNFResponseEvent" @@ -115,16 +145,37 @@ "requestorPeer": "GuardRequestorConsumer", "requestorTimeout": 500 }, + "AAIRequestorProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryRequest" + } + }, + "eventNameFilter": "AAINamedQueryRequestEvent", + "requestorMode": true, + "requestorPeer": "AAIRequestorConsumer", + "requestorTimeout": 500 + }, "APPCProducer": { "carrierTechnologyParameters": { "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { - "url": "http://192.168.144.235:3904/events/APPC-LCM-READ" + "url": "http://10.0.11.1:3904/events/APPC-LCM-READ" } }, "eventProtocolParameters": { - "eventProtocol": "JSON" + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "APPCLCMRequestEvent" + } }, "eventNameFilter": "APPCRestartVNFRequestEvent" }, @@ -133,11 +184,16 @@ "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { - "url": "http://192.168.144.235:3904/events/POLICY_CL_MGT" + "url": "http://10.0.11.1:3904/events/POLICY-CL-MGT" } }, "eventProtocolParameters": { - "eventProtocol": "JSON" + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "VirtualControlLoopNotification" + } }, "eventNameFilter": "ControlLoopLogEvent" } diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfigStdin.json b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfigStdin.json new file mode 100644 index 000000000..12d72bccb --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfigStdin.json @@ -0,0 +1,215 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "/home/apexuser/examples/models/ONAPvCPE/ONAPvCPEPolicyModel.json", + "engineParameters": { + "executorParameters": { + "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" + }, + "APPC_LCM_REQUEST": { + "adaptedClass": "org.onap.policy.appclcm.LcmRequest", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$RequestAdapter" + }, + "APPC_LCM_RESPONSE": { + "adaptedClass": "org.onap.policy.appclcm.LcmResponse", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$ResponseAdapter" + } + } + } + } + } + } + }, + "eventInputParameters": { + "VCPEInitConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "standardIo": true + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "VirtualControlLoopEvent" + } + }, + "eventName": "VirtualControlLoopEvent" + }, + "GuardRequestorConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://172.16.5.238:54321/OnapVCpeSim/sim/pdp/api/getDecision", + "httpMethod": "POST", + "restRequestTimeout": 2000 + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventName": "GuardResponseEvent", + "eventNameFilter": "GuardResponseEvent", + "requestorMode": true, + "requestorPeer": "GuardRequestorProducer", + "requestorTimeout": 500 + }, + "AAIRequestorConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://172.16.5.238:54321/OnapVCpeSim/sim/aai/search/named-query", + "httpMethod": "POST", + "restRequestTimeout": 2000 + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryResponse" + } + }, + "eventName": "AAINamedQueryResponseEvent", + "eventNameFilter": "AAINamedQueryResponseEvent", + "requestorMode": true, + "requestorPeer": "AAIRequestorProducer", + "requestorTimeout": 500 + }, + "DCAEConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://172.16.5.238:54321/OnapVCpeSim/sim/events/unauthenticated.DCAE_CL_OUTPUT/APEX/1?timeout=60000" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "nameAlias": "closedLoopControlName", + "versionAlias": "version", + "sourceAlias": "from" + } + } + }, + "APPCConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://172.16.5.238:54321/OnapVCpeSim/sim/events/APPC_LCM_WRITE/APEX/1?timeout=60000" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "pojoField": "APPCLCMResponseEvent" + } + }, + "eventName": "APPCRestartVNFResponseEvent", + "eventNameFilter": "APPCRestartVNFResponseEvent" + } + }, + "eventOutputParameters": { + "logProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "/tmp/VCPEEventsOut.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + }, + "GuardRequestorProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "GuardRequestEvent", + "requestorMode": true, + "requestorPeer": "GuardRequestorConsumer", + "requestorTimeout": 500 + }, + "AAIRequestorProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryRequest" + } + }, + "eventNameFilter": "AAINamedQueryRequestEvent", + "requestorMode": true, + "requestorPeer": "AAIRequestorConsumer", + "requestorTimeout": 500 + }, + "APPCProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://172.16.5.238:54321/OnapVCpeSim/sim/events/APPC-LCM-READ" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "APPCLCMRequestEvent" + } + }, + "eventNameFilter": "APPCRestartVNFRequestEvent" + }, + "PolicyLogProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://172.16.5.238:54321/OnapVCpeSim/sim/events/POLICY_CL_MGT" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "VirtualControlLoopNotification" + } + }, + "eventNameFilter": "ControlLoopLogEvent" + } + } +} diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig_Sim.json b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig_Sim.json new file mode 100644 index 000000000..5bae09e7e --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig_Sim.json @@ -0,0 +1,215 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/ONAPvCPE/ONAPvCPEPolicyModel.json", + "engineParameters": { + "executorParameters": { + "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" + }, + "APPC_LCM_REQUEST": { + "adaptedClass": "org.onap.policy.appclcm.LcmRequest", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$RequestAdapter" + }, + "APPC_LCM_RESPONSE": { + "adaptedClass": "org.onap.policy.appclcm.LcmResponse", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$ResponseAdapter" + } + } + } + } + } + } + }, + "eventInputParameters": { + "VCPEInitConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "examples/events/ONAPvCPE/MultiEvents.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "VirtualControlLoopEvent" + } + }, + "eventName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e" + }, + "GuardRequestorConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/pdp/api/getDecision", + "httpMethod": "POST", + "restRequestTimeout": 2000 + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventName": "GuardResponseEvent", + "eventNameFilter": "GuardResponseEvent", + "requestorMode": true, + "requestorPeer": "GuardRequestorProducer", + "requestorTimeout": 500 + }, + "AAIRequestorConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/aai/search/named-query", + "httpMethod": "POST", + "restRequestTimeout": 2000 + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryResponse" + } + }, + "eventName": "AAINamedQueryResponseEvent", + "eventNameFilter": "AAINamedQueryResponseEvent", + "requestorMode": true, + "requestorPeer": "AAIRequestorProducer", + "requestorTimeout": 500 + }, + "DCAEConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/unauthenticated.DCAE_CL_OUTPUT/APEX/1?timeout=60000" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "nameAlias": "closedLoopControlName", + "versionAlias": "version", + "sourceAlias": "from" + } + } + }, + "APPCConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/APPC_LCM_WRITE/APEX/1?timeout=60000" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "pojoField": "APPCLCMResponseEvent" + } + }, + "eventName": "APPCRestartVNFResponseEvent", + "eventNameFilter": "APPCRestartVNFResponseEvent" + } + }, + "eventOutputParameters": { + "logProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "/tmp/VCPEEventsOut.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + }, + "GuardRequestorProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "GuardRequestEvent", + "requestorMode": true, + "requestorPeer": "GuardRequestorConsumer", + "requestorTimeout": 500 + }, + "AAIRequestorProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryRequest" + } + }, + "eventNameFilter": "AAINamedQueryRequestEvent", + "requestorMode": true, + "requestorPeer": "AAIRequestorConsumer", + "requestorTimeout": 500 + }, + "APPCProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/APPC-LCM-READ" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "APPCLCMRequestEvent" + } + }, + "eventNameFilter": "APPCRestartVNFRequestEvent" + }, + "PolicyLogProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/POLICY_CL_MGT" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "VirtualControlLoopNotification" + } + }, + "eventNameFilter": "ControlLoopLogEvent" + } + } +} diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig_Sim_StdIO.json b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig_Sim_StdIO.json new file mode 100644 index 000000000..a903cb3c2 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/ApexConfig_Sim_StdIO.json @@ -0,0 +1,215 @@ +{ + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policyModelFileName": "examples/models/ONAPvCPE/ONAPvCPEPolicyModel.json", + "engineParameters": { + "executorParameters": { + "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" + }, + "APPC_LCM_REQUEST": { + "adaptedClass": "org.onap.policy.appclcm.LcmRequest", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$RequestAdapter" + }, + "APPC_LCM_RESPONSE": { + "adaptedClass": "org.onap.policy.appclcm.LcmResponse", + "adaptorClass": "org.onap.policy.appclcm.util.Serialization$ResponseAdapter" + } + } + } + } + } + } + }, + "eventInputParameters": { + "VCPEInitConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "standardIo": true + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "VirtualControlLoopEvent" + } + }, + "eventName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e" + }, + "GuardRequestorConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/pdp/api/getDecision", + "httpMethod": "POST", + "restRequestTimeout": 2000 + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventName": "GuardResponseEvent", + "eventNameFilter": "GuardResponseEvent", + "requestorMode": true, + "requestorPeer": "GuardRequestorProducer", + "requestorTimeout": 500 + }, + "AAIRequestorConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/aai/search/named-query", + "httpMethod": "POST", + "restRequestTimeout": 2000 + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryResponse" + } + }, + "eventName": "AAINamedQueryResponseEvent", + "eventNameFilter": "AAINamedQueryResponseEvent", + "requestorMode": true, + "requestorPeer": "AAIRequestorProducer", + "requestorTimeout": 500 + }, + "DCAEConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/unauthenticated.DCAE_CL_OUTPUT/APEX/1?timeout=60000" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "nameAlias": "closedLoopControlName", + "versionAlias": "version", + "sourceAlias": "from" + } + } + }, + "APPCConsumer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/APPC_LCM_WRITE/APEX/1?timeout=60000" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "pojoField": "APPCLCMResponseEvent" + } + }, + "eventName": "APPCRestartVNFResponseEvent", + "eventNameFilter": "APPCRestartVNFResponseEvent" + } + }, + "eventOutputParameters": { + "logProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "FILE", + "parameters": { + "fileName": "/tmp/VCPEEventsOut.json" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + } + }, + "GuardRequestorProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON" + }, + "eventNameFilter": "GuardRequestEvent", + "requestorMode": true, + "requestorPeer": "GuardRequestorConsumer", + "requestorTimeout": 500 + }, + "AAIRequestorProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTREQUESTOR", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RestRequestorCarrierTechnologyParameters" + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "pojoField": "AAINamedQueryRequest" + } + }, + "eventNameFilter": "AAINamedQueryRequestEvent", + "requestorMode": true, + "requestorPeer": "AAIRequestorConsumer", + "requestorTimeout": 500 + }, + "APPCProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/APPC-LCM-READ" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "APPCLCMRequestEvent" + } + }, + "eventNameFilter": "APPCRestartVNFRequestEvent" + }, + "PolicyLogProducer": { + "carrierTechnologyParameters": { + "carrierTechnology": "RESTCLIENT", + "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", + "parameters": { + "url": "http://localhost:54321/OnapVCpeSim/sim/events/POLICY_CL_MGT" + } + }, + "eventProtocolParameters": { + "eventProtocol": "JSON", + "parameters": { + "versionAlias": "version", + "sourceAlias": "from", + "pojoField": "VirtualControlLoopNotification" + } + }, + "eventNameFilter": "ControlLoopLogEvent" + } + } +} diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/VCPEInitiationEvent2.json b/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/VCPEInitiationEvent2.json deleted file mode 100644 index 7e3e33777..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/VCPEInitiationEvent2.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", - "closedLoopAlarmStart": 1519638197699, - "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", - "closedLoopEventStatus": "ONSET", - "requestID": "4a68f8a5-0db9-4070-a132-adede51ebeaf", - "target_type": "VNF", - "target": "generic-vnf.vnf-id", - "AAI": { - "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db001c" - }, - "from": "DCAE", - "version": "1.0.2" -} -{ - "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", - "closedLoopAlarmStart": 1519638197324, - "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", - "closedLoopEventStatus": "ONSET", - "requestID": "4a68f8a5-0db9-4070-a132-adede51ebeef", - "target_type": "VNF", - "target": "generic-vnf.vnf-id", - "AAI": { - "generic-vnf.resource-version": "1", - "generic-vnf.vnf-name": "vCPEInfraVNF99", - "generic-vnf.prov-status": "PREPROV", - "generic-vnf.is-closed-loop-disabled": "false", - "generic-vnf.orchestration-status": "Created", - "generic-vnf.vnf-type": "cCPEInfraService10/vCPEInfraService10 0", - "generic-vnf.in-maint": "false", - "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03bf00f", - "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db001e" - }, - "from": "DCAE", - "version": "1.0.2" -} diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIQuery.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIQuery.json new file mode 100644 index 000000000..46b5dbe73 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIQuery.json @@ -0,0 +1,16 @@ +{ + "query-parameters": { + "named-query": { + "named-query-uuid": "a93ac487-409c-4e8c-9e5f-334ae8f99087" + } + }, + "instance-filters": { + "instance-filter": [ + { + "generic-vnf": { + "vnf-id": "de7cc3ab-0212-47df-9e64-da1c79234deb" + } + } + ] + } +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponse4Policy.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponse4Policy.json new file mode 100644 index 000000000..5bcff1b4b --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponse4Policy.json @@ -0,0 +1,76 @@ +{ + "inventory-response-item": [ + { + "model-name": "service-instance", + "generic-vnf": { + "vnf-id": "de7cc3ab-0212-47df-9e64-da1c79234deb", + "vnf-name": "ZRDM2MMEX39", + "vnf-type": "vMME Svc Jul 14/vMME VF Jul 14 1", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "orchestration-status": "active", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1503082370097", + "model-invariant-id": "82194af1-3c2c-485a-8f44-420e22a9eaa4", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "service-instance", + "service-instance": { + "service-instance-id": "37b8cdb7-94eb-468f-a0c2-4e3c3546578e", + "service-instance-name": "Changed Service Instance NAME", + "model-invariant-id": "82194af1-3c2c-485a-8f44-420e22a9eaa4", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9", + "resource-version": "1503082993532", + "orchestration-status": "Active" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "pnf", + "generic-vnf": { + "vnf-id": "jimmy-test", + "vnf-name": "jimmy-test-vnf", + "vnf-type": "vMME Svc Jul 14/vMME VF Jul 14 1", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "orchestration-status": "active", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1504013830207", + "model-invariant-id": "862b25a1-262a-4961-bdaa-cdc55d69785a", + "model-version-id": "e9f1fa7d-c839-418a-9601-03dc0d2ad687" + }, + "extra-properties": { + } + }, + { + "model-name": "service-instance", + "generic-vnf": { + "vnf-id": "jimmy-test-vnf2", + "vnf-name": "jimmy-test-vnf2-named", + "vnf-type": "vMME Svc Jul 14/vMME VF Jul 14 1", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "orchestration-status": "active", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1504014833841", + "model-invariant-id": "82194af1-3c2c-485a-8f44-420e22a9eaa4", + "model-version-id": "46b92144-923a-4d20-b85a-3cbd847668a9" + }, + "extra-properties": { + } + } + ] + } + } + ] + } + } + ] +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponse4VNF.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponse4VNF.json new file mode 100644 index 000000000..3e8391eaa --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponse4VNF.json @@ -0,0 +1,287 @@ +{ + "inventory-response-item": [ + { + "model-name": "vFW", + "generic-vnf": { + "vnf-id": "vFirewall_demo_app", + "vnf-name": "vFirewall_demo_app", + "vnf-type": "vFW", + "service-id": "vFirewall_demo_app", + "orchestration-status": "running", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1509456799110", + "model-invariant-id": "vFirewall", + "model-version-id": "vFW" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "vserver": { + "vserver-id": "5b06cf36-40a0-4bcb-bde9-849aa4702d67", + "vserver-name": "vFW", + "vserver-name2": "vFW", + "prov-status": "Running", + "vserver-selflink": "http://10.12.25.2:8774/v2.1/466979b815b5415ba14ada713e6e1846/servers/5b06cf36-40a0-4bcb-bde9-849aa4702d67", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1509047869791" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "vnfc": { + "vnfc-name": "VNFC_vGMUX_demo_app2", + "nfc-naming-code": "vGMUXCODE2", + "nfc-function": "vGMUX", + "prov-status": "Running", + "orchestration-status": "Error", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1509407048855" + }, + "extra-properties": { + } + }, + { + "tenant": { + "tenant-id": "466979b815b5415ba14ada713e6e1846", + "tenant-name": "Integration", + "resource-version": "1508920100541" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "cloud-region": { + "cloud-owner": "pod25", + "cloud-region-id": "RegionOne", + "identity-url": "http://10.12.25.2:5000/v3", + "sriov-automation": false, + "resource-version": "1509048416263" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "esr-system-info": { + "esr-system-info-id": "432ac032-e996-41f2-84ed-9c7a1766eb29", + "system-name": "example-system-name-val-29070", + "type": "example-type-val-85254", + "vendor": "example-vendor-val-94515", + "version": "example-version-val-71880", + "service-url": "http://10.12.25.2:5000/v3", + "user-name": "demo", + "password": "onapdemo", + "system-type": "VIM", + "ssl-cacert": "example-ssl-cacert-val-75021", + "ssl-insecure": true, + "ip-address": "example-ip-address-val-44431", + "port": "example-port-val-93234", + "cloud-domain": "Default", + "default-tenant": "Integration", + "resource-version": "1508920101033" + }, + "extra-properties": { + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "vserver": { + "vserver-id": "0c52905c-f682-42cf-bd52-e7f8953e80e3", + "vserver-name": "vFW", + "vserver-name2": "vFW", + "prov-status": "Running", + "vserver-selflink": "http://10.12.25.2:8774/v2.1/466979b815b5415ba14ada713e6e1846/servers/0c52905c-f682-42cf-bd52-e7f8953e80e3", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1509047548567" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "vnfc": { + "vnfc-name": "VNFC_vGMUX_demo_app3", + "nfc-naming-code": "vGMUXCODE3", + "nfc-function": "vGMUX", + "prov-status": "Running", + "orchestration-status": "Running", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1509041912808" + }, + "extra-properties": { + } + }, + { + "tenant": { + "tenant-id": "466979b815b5415ba14ada713e6e1846", + "tenant-name": "Integration", + "resource-version": "1508920100541" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "cloud-region": { + "cloud-owner": "pod25", + "cloud-region-id": "RegionOne", + "identity-url": "http://10.12.25.2:5000/v3", + "sriov-automation": false, + "resource-version": "1509048416263" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "esr-system-info": { + "esr-system-info-id": "432ac032-e996-41f2-84ed-9c7a1766eb29", + "system-name": "example-system-name-val-29070", + "type": "example-type-val-85254", + "vendor": "example-vendor-val-94515", + "version": "example-version-val-71880", + "service-url": "http://10.12.25.2:5000/v3", + "user-name": "demo", + "password": "onapdemo", + "system-type": "VIM", + "ssl-cacert": "example-ssl-cacert-val-75021", + "ssl-insecure": true, + "ip-address": "example-ip-address-val-44431", + "port": "example-port-val-93234", + "cloud-domain": "Default", + "default-tenant": "Integration", + "resource-version": "1508920101033" + }, + "extra-properties": { + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "vserver": { + "vserver-id": "33e16e02-098a-4f4e-a37f-b4e0307596c0", + "vserver-name": "vFW", + "vserver-name2": "vFW", + "prov-status": "Running", + "vserver-selflink": "http://10.12.25.2:8774/v2.1/466979b815b5415ba14ada713e6e1846/servers/33e16e02-098a-4f4e-a37f-b4e0307596c0", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1509047285114" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "vnfc": { + "vnfc-name": "vnfc-related-to-vserver-example", + "nfc-naming-code": "example-nfc-naming-code-val-78172", + "nfc-function": "example-nfc-function-val-56352", + "prov-status": "example-prov-status-val-10699", + "orchestration-status": "example-orchestration-status-val-68896", + "ipaddress-v4-oam-vip": "example-ipaddress-v4-oam-vip-val-71483", + "in-maint": true, + "is-closed-loop-disabled": true, + "group-notation": "example-group-notation-val-31912", + "resource-version": "1508800709772" + }, + "extra-properties": { + } + }, + { + "vnfc": { + "vnfc-name": "VNFC_vGMUX_demo_app", + "nfc-naming-code": "vGMUXCODE", + "nfc-function": "vGMUX", + "prov-status": "Running", + "orchestration-status": "Running", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1509041573965" + }, + "extra-properties": { + } + }, + { + "tenant": { + "tenant-id": "466979b815b5415ba14ada713e6e1846", + "tenant-name": "Integration", + "resource-version": "1508920100541" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "cloud-region": { + "cloud-owner": "pod25", + "cloud-region-id": "RegionOne", + "identity-url": "http://10.12.25.2:5000/v3", + "sriov-automation": false, + "resource-version": "1509048416263" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "esr-system-info": { + "esr-system-info-id": "432ac032-e996-41f2-84ed-9c7a1766eb29", + "system-name": "example-system-name-val-29070", + "type": "example-type-val-85254", + "vendor": "example-vendor-val-94515", + "version": "example-version-val-71880", + "service-url": "http://10.12.25.2:5000/v3", + "user-name": "demo", + "password": "onapdemo", + "system-type": "VIM", + "ssl-cacert": "example-ssl-cacert-val-75021", + "ssl-insecure": true, + "ip-address": "example-ip-address-val-44431", + "port": "example-port-val-93234", + "cloud-domain": "Default", + "default-tenant": "Integration", + "resource-version": "1508920101033" + }, + "extra-properties": { + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponseExample.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponseExample.json new file mode 100644 index 000000000..1d3f64c78 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/AAIResponseExample.json @@ -0,0 +1,206 @@ +{ + "inventory-response-item": [ + { + "vserver": { + "vserver-id": "6ed3642c-f7a1-4a7c-9290-3d51fe1531eb", + "vserver-name": "zdfw1lb01lb02", + "vserver-name2": "zdfw1lb01lb02", + "prov-status": "ACTIVE", + "vserver-selflink": "http://10.12.25.2:8774/v2.1/41d6d38489bd40b09ea8a6b6b852dcbd/servers/6ed3642c-f7a1-4a7c-9290-3d51fe1531eb", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1510606403522" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vLoadBalancer", + "generic-vnf": { + "vnf-id": "db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "vnf-name": "Vfmodule_vLB1113", + "vnf-type": "vLoadBalancer-1106/vLoadBalancer 0", + "service-id": "66f157fc-4148-4880-95f5-e120677e98d1", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1510604011851", + "model-invariant-id": "cee050ed-92a5-494f-ab04-234307a846dc", + "model-version-id": "fd65becc-6b2c-4fe8-ace9-cc29db9a3da2", + "model-customization-id": "1983c783-444f-4e79-af3a-85e5d49628f3", + "nf-type": "", + "nf-function": "", + "nf-role": "", + "nf-naming-code": "" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "fd65becc-6b2c-4fe8-ace9-cc29db9a3da2" + }, + { + "property-name": "model-ver.model-name", + "property-value": "vLoadBalancer" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "cee050ed-92a5-494f-ab04-234307a846dc" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1.0" + } + ] + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "model-name": "vLoadBalancer-1106", + "service-instance": { + "service-instance-id": "3b12f31f-8f2d-4f5c-b875-61ff1194b941", + "service-instance-name": "vLoadBalancer-1113", + "model-invariant-id": "1321d60d-f7ff-4300-96c2-6bf0b3268b7a", + "model-version-id": "732d4692-4b97-46f9-a996-0b3339e88c50", + "resource-version": "1510603936425" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "732d4692-4b97-46f9-a996-0b3339e88c50" + }, + { + "property-name": "model-ver.model-name", + "property-value": "vLoadBalancer-1106" + }, + { + "property-name": "model.model-type", + "property-value": "service" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "1321d60d-f7ff-4300-96c2-6bf0b3268b7a" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1.0" + } + ] + } + }, + { + "model-name": "Vloadbalancer..base_vlb..module-0", + "vf-module": { + "vf-module-id": "e6b3e3eb-34e1-4c00-b8c1-2a4fbe479b12", + "vf-module-name": "Vfmodule_vLB1113-1", + "heat-stack-id": "Vfmodule_vLB1113-1/3dd6d900-772f-4fcc-a0cb-e250ab2bb4db", + "orchestration-status": "active", + "is-base-vf-module": true, + "resource-version": "1510604612557", + "model-invariant-id": "6d760188-9a24-451a-b05b-e08b86cb94f2", + "model-version-id": "93facad9-55f2-4fe0-9574-814c2bc2d071", + "model-customization-id": "93fd5bd4-8051-4074-8530-c0c504604df5", + "module-index": 0 + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "93facad9-55f2-4fe0-9574-814c2bc2d071" + }, + { + "property-name": "model-ver.model-name", + "property-value": "Vloadbalancer..base_vlb..module-0" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "6d760188-9a24-451a-b05b-e08b86cb94f2" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1" + } + ] + } + }, + { + "model-name": "Vloadbalancer..dnsscaling..module-1", + "vf-module": { + "vf-module-id": "dummy_db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "vf-module-name": "dummy_db373a8d-f7be-4d02-8ac8-6ca4c305d144", + "is-base-vf-module": false, + "resource-version": "1510610079687", + "model-invariant-id": "356a1cff-71f2-4086-9980-a2927ce11c1c", + "model-version-id": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + "extra-properties": { + "extra-property": [ + { + "property-name": "model-ver.model-version-id", + "property-value": "6b93d804-cfc8-4be3-92cc-9336d135859a" + }, + { + "property-name": "model-ver.model-name", + "property-value": "Vloadbalancer..dnsscaling..module-1" + }, + { + "property-name": "model.model-type", + "property-value": "resource" + }, + { + "property-name": "model.model-invariant-id", + "property-value": "356a1cff-71f2-4086-9980-a2927ce11c1c" + }, + { + "property-name": "model-ver.model-version", + "property-value": "1" + } + ] + } + } + ] + } + }, + { + "tenant": { + "tenant-id": "41d6d38489bd40b09ea8a6b6b852dcbd", + "tenant-name": "Integration-SB-00", + "resource-version": "1509587770200" + }, + "extra-properties": { + }, + "inventory-response-items": { + "inventory-response-item": [ + { + "cloud-region": { + "cloud-owner": "CloudOwner", + "cloud-region-id": "RegionOne", + "cloud-type": "SharedNode", + "owner-defined-type": "OwnerType", + "cloud-region-version": "v1", + "cloud-zone": "CloudZone", + "sriov-automation": false, + "resource-version": "1509587770092" + }, + "extra-properties": { + } + } + ] + } + } + ] + } + } + ] +} diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartRequestEvent.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartRequestEvent.json new file mode 100644 index 000000000..6e18a91b0 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartRequestEvent.json @@ -0,0 +1,22 @@ +{ + "rpc-name": "restart", + "version": "2.0", + "correlation-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "type": "request", + "body": { + "input": { + "common-header": { + "timestamp": "2018-02-26T10:23:41.97Z", + "api-ver": "2.15", + "originator-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "request-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "sub-request-id": "1", + "flags": {} + }, + "action": "Restart", + "action-identifiers": { + "vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db39e1" + } + } + } +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseNOKEvent.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseNOKEvent.json new file mode 100644 index 000000000..9a0ff9af1 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseNOKEvent.json @@ -0,0 +1,22 @@ +{ + "rpc-name": "restart", + "version": "0.0.1", + "correlation-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "type": "response", + "body": { + "output": { + "common-header": { + "timestamp": "2018-02-26T10:23:42.97Z", + "api-ver": "5.00", + "originator-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "request-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "sub-request-id": "1", + "flags": {} + }, + "status": { + "code": 400, + "message": "Restart Failed" + } + } + } +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseOKEvent.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseOKEvent.json new file mode 100644 index 000000000..4afc51d85 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseOKEvent.json @@ -0,0 +1,22 @@ +{ + "rpc-name": "restart", + "version": "0.0.1", + "correlation-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "type": "response", + "body": { + "output": { + "common-header": { + "timestamp": "2018-02-26T10:23:42.97Z", + "api-ver": "5.00", + "originator-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "request-id": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "sub-request-id": "1", + "flags": {} + }, + "status": { + "code": 200, + "message": "Restart Successful" + } + } + } +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseOKInitialEvent.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseOKInitialEvent.json new file mode 100644 index 000000000..2f53a83bc --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/APPCvCPERestartResponseOKInitialEvent.json @@ -0,0 +1,22 @@ +{ + "rpc-name": "restart", + "version": "0.0.1", + "correlation-id": "4a68f8a5-0db9-4070-a132-adede51ebeef", + "type": "response", + "body": { + "output": { + "common-header": { + "timestamp": "2018-02-26T10:23:42.97Z", + "api-ver": "5.00", + "originator-id": "4a68f8a5-0db9-4070-a132-adede51ebeef", + "request-id": "4a68f8a5-0db9-4070-a132-adede51ebeef", + "sub-request-id": "1", + "flags": {} + }, + "status": { + "code": 200, + "message": "Restart Successful" + } + } + } +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/MultiEvents.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/MultiEvents.json new file mode 100644 index 000000000..09ace1ed6 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/MultiEvents.json @@ -0,0 +1,150 @@ +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ONSET", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e0000", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "AAI": { + "generic-vnf.resource-version": "1", + "generic-vnf.vnf-name": "vCPEInfraVNF0000", + "generic-vnf.prov-status": "PREPROV", + "generic-vnf.is-closed-loop-disabled": "false", + "generic-vnf.orchestration-status": "Created", + "generic-vnf.vnf-type": "vCPEInfraService10/vCPEInfraService10 0", + "generic-vnf.in-maint": "false", + "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03bd01f", + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db0000" + }, + "from": "DCAE", + "version": "1.0.2" +} +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ONSET", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e0001", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "AAI": { + "generic-vnf.resource-version": "1", + "generic-vnf.vnf-name": "vCPEInfraVNF0001", + "generic-vnf.prov-status": "PREPROV", + "generic-vnf.is-closed-loop-disabled": "false", + "generic-vnf.orchestration-status": "Created", + "generic-vnf.vnf-type": "vCPEInfraService10/vCPEInfraService10 0", + "generic-vnf.in-maint": "false", + "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03bd01f", + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db0001" + }, + "from": "DCAE", + "version": "1.0.2" +} +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ONSET", + "requestID": "664be3d2-6c12-4f4b-a3e7-c349acce0002", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "AAI": { + "vserver.is-closed-loop-disabled": "false", + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db0002" + }, + "from": "DCAE", + "version": "1.0.2" +} +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ONSET", + "requestID": "664be3d2-6c12-4f4b-a3e7-c349acce0003", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "AAI": { + "vserver.is-closed-loop-disabled": "false", + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db0003" + }, + "from": "DCAE", + "version": "1.0.2" +} +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638001326, + "closedLoopAlarmEnd": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ABATED", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e0005", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "version": "1.0.2", + "from": "DCAE", + "AAI": { + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db39e1", + "generic-vnf.resource-version": "1", + "generic-vnf.vnf-name": "vCPEInfraVNF0005", + "generic-vnf.prov-status": "PREPROV", + "generic-vnf.is-closed-loop-disabled": "false", + "generic-vnf.orchestration-status": "Created", + "generic-vnf.vnf-type": "cCPEInfraService10/vCPEInfraService10 0", + "generic-vnf.in-maint": "false", + "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03b0005" + } +} +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638001326, + "closedLoopAlarmEnd": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ABATED", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e0006", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "version": "1.0.2", + "from": "DCAE", + "AAI": { + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db39e1", + "generic-vnf.resource-version": "1", + "generic-vnf.vnf-name": "vCPEInfraVNF0006", + "generic-vnf.prov-status": "PREPROV", + "generic-vnf.is-closed-loop-disabled": "false", + "generic-vnf.orchestration-status": "Created", + "generic-vnf.vnf-type": "cCPEInfraService10/vCPEInfraService10 0", + "generic-vnf.in-maint": "false", + "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03b0006" + } +} +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638001326, + "closedLoopAlarmEnd": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ABATED", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e0006", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "version": "1.0.2", + "from": "DCAE", + "AAI": { + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db0006" + } +} +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638001326, + "closedLoopAlarmEnd": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ABATED", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e0007", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "version": "1.0.2", + "from": "DCAE", + "AAI": { + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db0007" + } +} diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEAbatedAAIInfoEvent.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEAbatedAAIInfoEvent.json new file mode 100644 index 000000000..5efbfef69 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEAbatedAAIInfoEvent.json @@ -0,0 +1,23 @@ +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638001326, + "closedLoopAlarmEnd": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ABATED", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "version": "1.0.2", + "from": "DCAE", + "AAI": { + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db39e1", + "generic-vnf.resource-version": "1", + "generic-vnf.vnf-name": "vCPEInfraVNF13", + "generic-vnf.prov-status": "PREPROV", + "generic-vnf.is-closed-loop-disabled": "false", + "generic-vnf.orchestration-status": "Created", + "generic-vnf.vnf-type": "cCPEInfraService10/vCPEInfraService10 0", + "generic-vnf.in-maint": "false", + "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03bd01f" + } +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEAbatedNoAAIInfoEvent.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEAbatedNoAAIInfoEvent.json new file mode 100644 index 000000000..7cc910e96 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEAbatedNoAAIInfoEvent.json @@ -0,0 +1,15 @@ +{ + "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", + "closedLoopAlarmStart": 1519638001326, + "closedLoopAlarmEnd": 1519638197324, + "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", + "closedLoopEventStatus": "ABATED", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e3d5c", + "target_type": "VNF", + "target": "generic-vnf.vnf-id", + "version": "1.0.2", + "from": "DCAE", + "AAI": { + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db39e1" + } +}
\ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/VCPEInitiationEvent0.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEOnsetAAIInfoEvent.json index e46a2739c..49ba03d2c 100644 --- a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/VCPEInitiationEvent0.json +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEOnsetAAIInfoEvent.json @@ -3,19 +3,19 @@ "closedLoopAlarmStart": 1519638197324, "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", "closedLoopEventStatus": "ONSET", - "requestID": "4a68f8a5-0db9-4070-a132-adede51ebeef", + "requestID": "4a68f8a5-0db9-4070-a132-adede51e3d5c", "target_type": "VNF", "target": "generic-vnf.vnf-id", "AAI": { "generic-vnf.resource-version": "1", - "generic-vnf.vnf-name": "vCPEInfraVNF99", + "generic-vnf.vnf-name": "vCPEInfraVNF13", "generic-vnf.prov-status": "PREPROV", "generic-vnf.is-closed-loop-disabled": "false", "generic-vnf.orchestration-status": "Created", - "generic-vnf.vnf-type": "cCPEInfraService10/vCPEInfraService10 0", + "generic-vnf.vnf-type": "vCPEInfraService10/vCPEInfraService10 0", "generic-vnf.in-maint": "false", - "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03bf00f", - "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db001e" + "generic-vnf.service-id": "5585fd2c-ad0d-4050-b0cf-dfe4a03bd01f", + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db39e1" }, "from": "DCAE", "version": "1.0.2" diff --git a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/VCPEInitiationEvent1.json b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEOnsetNoAAIInfoEvent.json index 5fcece8ac..5f351a985 100644 --- a/examples/examples-onap-vcpe/src/main/resources/examples/config/ONAPvCPE/VCPEInitiationEvent1.json +++ b/examples/examples-onap-vcpe/src/main/resources/examples/events/ONAPvCPE/VCPEOnsetNoAAIInfoEvent.json @@ -1,13 +1,14 @@ { "closedLoopControlName": "ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1", - "closedLoopAlarmStart": 1519638197699, + "closedLoopAlarmStart": 1519638197324, "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", "closedLoopEventStatus": "ONSET", - "requestID": "4a68f8a5-0db9-4070-a132-adede51ebeaf", + "requestID": "664be3d2-6c12-4f4b-a3e7-c349acced200", "target_type": "VNF", "target": "generic-vnf.vnf-id", "AAI": { - "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db001c" + "vserver.is-closed-loop-disabled": "false", + "generic-vnf.vnf-id": "b4fe00ac-1da6-4b00-ac0d-8e8300db39e1" }, "from": "DCAE", "version": "1.0.2" diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupRequestTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupRequestTask.js index bf66dbb22..cab75f6cd 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupRequestTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupRequestTask.js @@ -24,17 +24,24 @@ executor.logger.info(executor.inFields); var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( executor.inFields.get("vnfID").toString()); -var guardDecisionAttributes = executor.subject.getOutFieldSchemaHelper("decisionAttributes").createNewInstance(); +var aaiRequest = new org.onap.policy.aai.AaiNqRequest; +aaiRequest.setQueryParameters(new org.onap.policy.aai.AaiNqQueryParameters); +aaiRequest.setInstanceFilters(new org.onap.policy.aai.AaiNqInstanceFilters); -guardDecisionAttributes.put("actor", "APPC"); -guardDecisionAttributes.put("recipe", "Restart"); -guardDecisionAttributes.put("target", executor.inFields.get("vnfID").toString()); -guardDecisionAttributes.put("clname", "APEXvCPEImplementation"); +aaiRequest.getQueryParameters().setNamedQuery(new org.onap.policy.aai.AaiNqNamedQuery); +aaiRequest.getQueryParameters().getNamedQuery().setNamedQueryUuid(executor.inFields.get("requestID")); -executor.logger.info(guardDecisionAttributes); +var genericVnfInstanceFilterMap = new java.util.HashMap(); +genericVnfInstanceFilterMap.put("vnf-id", vcpeClosedLoopStatus.get("AAI").get("genericVnfVnfId")); -executor.outFields.put("decisionAttributes", guardDecisionAttributes); -executor.outFields.put("onapName", "APEX"); +var genericVnfFilterMap = new java.util.HashMap(); +genericVnfFilterMap.put("generic-vnf", genericVnfInstanceFilterMap); + +aaiRequest.getInstanceFilters().getInstanceFilter().add(genericVnfFilterMap); + +executor.logger.info(aaiRequest); + +executor.outFields.put("AAINamedQueryRequest", aaiRequest); executor.getContextAlbum("ControlLoopExecutionIDAlbum").put(executor.executionId.toString(), executor.inFields.get("vnfID")); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupResponseTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupResponseTask.js index 69cd03771..50961c214 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupResponseTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/AAILookupResponseTask.js @@ -28,17 +28,36 @@ executor.logger.info("Continuing execution with VNF ID: " + vnfID); var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(vnfID.toString()); executor.logger.info(vcpeClosedLoopStatus); -var guardResult = executor.inFields.get("decision"); - -if (guardResult === "PERMIT") { - vcpeClosedLoopStatus.put("notification", "OPERATION: GUARD_PERMIT"); -} else if (guardResult === "DENY") { - vcpeClosedLoopStatus.put("notification", "OPERATION: GUARD_DENY"); -} else { - executor.message = "guard result must be either \"PERMIT\" or \"DENY\""; - returnValue = executor.isFalse; +var aaiResponse = executor.inFields.get("AAINamedQueryResponse"); + +for (var iterator = aaiResponse.getInventoryResponseItems().iterator(); iterator.hasNext(); ) { + var responseItem = iterator.next(); + + if (responseItem.getModelName() != "vCPE") { + continue; + } + + var aaiInfo = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").getSchemaHelper().createNewSubInstance("VCPE_AAI_Type"); + + aaiInfo.put("genericVnfResourceVersion", responseItem.getGenericVnf().getResourceVersion()); + aaiInfo.put("genericVnfVnfName", responseItem.getGenericVnf().getVnfName()); + aaiInfo.put("genericVnfProvStatus", responseItem.getGenericVnf().getProvStatus()); + aaiInfo.put("genericVnfIsClosedLoopDisabled", responseItem.getGenericVnf().getIsClosedLoopDisabled().toString()); + aaiInfo.put("genericVnfVnfType", responseItem.getGenericVnf().getVnfType()); + aaiInfo.put("genericVnfInMaint", responseItem.getGenericVnf().getInMaint().toString()); + aaiInfo.put("genericVnfServiceId", responseItem.getGenericVnf().getServiceId()); + aaiInfo.put("genericVnfVnfId", responseItem.getGenericVnf().getVnfId()); + + aaiInfo.put("genericVnfOrchestrationStatus", responseItem.getVfModule().getOrchestrationStatus()); + + vcpeClosedLoopStatus.put("AAI", aaiInfo); + + break; } +// We should check here for the case where AAI returns an error or no data for the query + + var uuidType = Java.type("java.util.UUID"); var requestID = uuidType.fromString(vcpeClosedLoopStatus.get("requestID")); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFRequestTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFRequestTask.js index 184340288..7d17e25bc 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFRequestTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFRequestTask.js @@ -21,55 +21,36 @@ executor.logger.info(executor.subject.id); executor.logger.info(executor.inFields); -var genericDataRecordType = Java.type("org.apache.avro.generic.GenericData.Record"); +var appcRequest = new org.onap.policy.appclcm.LcmRequestWrapper; +appcRequest.setBody(new org.onap.policy.appclcm.LcmRequest); +appcRequest.getBody().setCommonHeader(new org.onap.policy.appclcm.LcmCommonHeader); -var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( - executor.inFields.get("vnfID").toString()); +appcRequest.setVersion("2.0.0"); +appcRequest.setRpcName("restart"); +appcRequest.setCorrelationId(executor.inFields.get("requestID")); +appcRequest.setType("request"); -var appcBodyRecord = executor.subject.getOutFieldSchemaHelper("body").createNewInstance(); -var appcBodyRecordSchema = appcBodyRecord.getSchema(); +var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(executor.inFields.get("vnfID").toString()); -var inputRecord = new genericDataRecordType(appcBodyRecordSchema.getField("input").schema()); -var inputRecordRecordSchema = inputRecord.getSchema(); +appcRequest.getBody().getCommonHeader().setTimeStamp(java.time.Instant.now()); +appcRequest.getBody().getCommonHeader().setApiVer("2.00"); +appcRequest.getBody().getCommonHeader().setOriginatorId(executor.inFields.get("requestID").toString()); +appcRequest.getBody().getCommonHeader().setRequestId(executor.inFields.get("requestID")); +appcRequest.getBody().getCommonHeader().setSubRequestId("1"); +appcRequest.getBody().getCommonHeader().getFlags().put("ttl", "10000"); +appcRequest.getBody().getCommonHeader().getFlags().put("force", "TRUE"); +appcRequest.getBody().getCommonHeader().getFlags().put("mode", "EXCLUSIVE"); -var actionIndentifiersRecord = new genericDataRecordType(inputRecordRecordSchema.getField("action_DasH_identifiers") - .schema()); +appcRequest.getBody().setAction("Restart"); +appcRequest.getBody().setActionIdentifiers(new java.util.HashMap()); +appcRequest.getBody().getActionIdentifiers().put("vnf-id", executor.inFields.get("vnfID").toString()); -var commonHeaderRecord = new genericDataRecordType(inputRecordRecordSchema.getField("common_DasH_header").schema()); -var commonHeaderRecordSchema = commonHeaderRecord.getSchema(); +executor.getContextAlbum("RequestIDVNFIDAlbum").put(executor.inFields.get("requestID").toString(), executor.inFields.get("vnfID")); -var commonHeaderFlagsRecord = new genericDataRecordType(commonHeaderRecordSchema.getField("flags").schema()); +vcpeClosedLoopStatus.put("notification", "OPERATION"); +vcpeClosedLoopStatus.put("notificationTime", java.lang.System.currentTimeMillis()); -appcBodyRecord.put("input", inputRecord); -inputRecord.put("action_DasH_identifiers", actionIndentifiersRecord); -inputRecord.put("common_DasH_header", commonHeaderRecord); -commonHeaderRecord.put("flags", commonHeaderFlagsRecord); - -inputRecord.put("action", "Restart"); -inputRecord.put("payload", "{}"); - -actionIndentifiersRecord.put("vnf_DasH_id", executor.inFields.get("vnfID").toString()); - -commonHeaderRecord.put("timestamp", new Date().toISOString()); -commonHeaderRecord.put("api_DasH_ver", "2.00"); -commonHeaderRecord.put("originator_DasH_id", executor.inFields.get("requestID").toString()); -commonHeaderRecord.put("request_DasH_id", executor.inFields.get("requestID").toString()); -commonHeaderRecord.put("sub_DasH_request_DasH_id", "1"); - -commonHeaderFlagsRecord.put("ttl", "10000"); -commonHeaderFlagsRecord.put("force", "TRUE"); -commonHeaderFlagsRecord.put("mode", "EXCLUSIVE"); - -executor.outFields.put("version", "2.0"); -executor.outFields.put("rpc-name", "restart"); -executor.outFields.put("correlation-id", executor.inFields.get("vnfID")); -executor.outFields.put("type", "request"); -executor.outFields.put("body", appcBodyRecord); - -executor.getContextAlbum("RequestIDVNFIDAlbum").put(executor.inFields.get("requestID").toString(), - executor.inFields.get("vnfID")); - -vcpeClosedLoopStatus.put("notification", "OPERATION: RESTART REQUESTED"); +executor.outFields.put("APPCLCMRequestEvent", appcRequest); executor.logger.info(executor.outFields); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFResponseTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFResponseTask.js index 5e20f1569..afaa72536 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFResponseTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/APPCRestartVNFResponseTask.js @@ -14,6 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * APPC LCM Response code: 100 ACCEPTED + * 200 ERROR UNEXPECTED ERROR means failure + * 312 REJECTED DUPLICATE REQUEST + * 400 SUCCESS + * + * Note: Sometimes the corelationId has a -1 at the tail, need to get rid of it when present. + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -21,30 +28,43 @@ executor.logger.info(executor.subject.id); executor.logger.info(executor.inFields); -var uuidType = Java.type("java.util.UUID"); -var integerType = Java.type("java.lang.Integer"); +var appcResponse = executor.inFields.get("APPCLCMResponseEvent"); -var requestID = uuidType.fromString(executor.inFields.get("correlation-id")); -var vnfID = executor.getContextAlbum("RequestIDVNFIDAlbum").remove(requestID.toString()); +var requestIDString = appcResponse.getCorrelationId().substr(0, 36); +executor.logger.info("requestIDString = " + requestIDString); +var vnfID = executor.getContextAlbum("RequestIDVNFIDAlbum").get(requestIDString); +executor.logger.info("Size of RequestIDVNFIDAlbum = " + executor.getContextAlbum("RequestIDVNFIDAlbum").size()); +executor.logger.info("vnfID = " + vnfID); var returnValue = executor.isTrue; if (vnfID != null) { var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(vnfID.toString()); + var requestId = java.util.UUID.fromString(vcpeClosedLoopStatus.get("requestID")); + + vcpeClosedLoopStatus.put("notificationTime", java.lang.System.currentTimeMillis()); - var notification = "OPERATION: VNF RESTART WITH RETURN CODE " - + executor.inFields.get("body").get("output").get("status").get("code") + ", " - + executor.inFields.get("body").get("output").get("status").get("message"); + executor.logger.info("Got from APPC code: " + org.onap.policy.appclcm.LcmResponseCode.toResponseValue(appcResponse.getBody().getStatus().getCode())); - vcpeClosedLoopStatus.put("notification", notification); - vcpeClosedLoopStatus.put("notificationTime", executor.inFields.get("body").get("output").get("common_DasH_header") - .get("timestamp")); + if (org.onap.policy.appclcm.LcmResponseCode.toResponseValue(appcResponse.getBody().getStatus().getCode()) == org.onap.policy.appclcm.LcmResponseCode.SUCCESS) { + vcpeClosedLoopStatus.put("notification", "OPERATION_SUCCESS"); + vcpeClosedLoopStatus.put("message", "vCPE restarted"); + executor.getContextAlbum("RequestIDVNFIDAlbum").remove(requestIDString); + } else if (org.onap.policy.appclcm.LcmResponseCode.toResponseValue(appcResponse.getBody().getStatus().getCode()) == "ACCEPTED" || + org.onap.policy.appclcm.LcmResponseCode.toResponseValue(appcResponse.getBody().getStatus().getCode()) == "REJECT" ) { + executor.logger.info("Got ACCEPTED 100 or REJECT 312, keep the context, wait for next response. Code is: " + org.onap.policy.appclcm.LcmResponseCode.toResponseValue(appcResponse.getBody().getStatus().getCode())); + } + else { + executor.getContextAlbum("RequestIDVNFIDAlbum").remove(requestIDString); + vcpeClosedLoopStatus.put("notification", "OPERATION_FAILURE"); + vcpeClosedLoopStatus.put("message", "vCPE restart failed"); + } - executor.outFields.put("requestID", requestID); + executor.outFields.put("requestID", requestId); executor.outFields.put("vnfID", vnfID); } else { - executor.message = "VNF ID not found in context album for request ID " + requestID; - returnValue = executor.isFalse + executor.message = "VNF ID not found in context album for request ID " + requestIDString; + returnValue = executor.isFalse; } executor.logger.info(executor.outFields); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js index a8b1fe8e4..f37b6f1b5 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js @@ -21,11 +21,20 @@ executor.logger.info(executor.subject.id); executor.logger.info(executor.inFields); -var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( +var vcpeClosedLoopStatus = null; +if( executor.inFields.get("vnfID") == null) { + executor.logger.info("AbatedTask: vnfID is null"); + var vnfName = executor.inFields.get("vnfName"); + vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( + executor.inFields.get("vnfName")); +} else { + vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( executor.inFields.get("vnfID").toString()); +} -vcpeClosedLoopStatus.put("notification", "VCPE NOTIFICATION HAS BEEN ABATED"); -vcpeClosedLoopStatus.put("notificationTime", new Date().toISOString()); +vcpeClosedLoopStatus.put("notification", "FINAL_SUCCESS"); +vcpeClosedLoopStatus.put("notificationTime", java.lang.System.currentTimeMillis()); +vcpeClosedLoopStatus.put("message", "situation has been abated"); executor.logger.info(executor.outFields); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/ControlLoopLogTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/ControlLoopLogTask.js index bceb628e2..d42aef9d0 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/ControlLoopLogTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/ControlLoopLogTask.js @@ -21,27 +21,51 @@ executor.logger.info(executor.subject.id); executor.logger.info(executor.inFields); -var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( - executor.inFields.get("vnfID").toString()); - -executor.logger.info("Logging context information for VNF \"" + executor.inFields.get("vnfID") + "\""); - -executor.outFields.put("AAI", vcpeClosedLoopStatus.get("AAI")); -executor.outFields.put("closedLoopControlName", vcpeClosedLoopStatus.get("closedLoopControlName")); -executor.outFields.put("closedLoopAlarmStart", vcpeClosedLoopStatus.get("closedLoopAlarmStart")); -executor.outFields.put("closedLoopAlarmEnd", vcpeClosedLoopStatus.get("closedLoopAlarmEnd")); -executor.outFields.put("closedLoopEventClient", vcpeClosedLoopStatus.get("closedLoopEventClient")); -executor.outFields.put("closedLoopEventStatus", vcpeClosedLoopStatus.get("closedLoopEventStatus")); -executor.outFields.put("version", vcpeClosedLoopStatus.get("version")); -executor.outFields.put("requestID", vcpeClosedLoopStatus.get("requestID")); -executor.outFields.put("target_type", vcpeClosedLoopStatus.get("target_type")); -executor.outFields.put("target", vcpeClosedLoopStatus.get("target")); -executor.outFields.put("from", vcpeClosedLoopStatus.get("from")); -executor.outFields.put("policyScope", vcpeClosedLoopStatus.get("policyScope")); -executor.outFields.put("policyName", vcpeClosedLoopStatus.get("policyName")); -executor.outFields.put("policyVersion", vcpeClosedLoopStatus.get("policyVersion")); -executor.outFields.put("notification", vcpeClosedLoopStatus.get("notification")); -executor.outFields.put("notificationTime", vcpeClosedLoopStatus.get("notificationTime")); +var vnfID = executor.inFields.get("vnfID"); +if(vnfID == null) { + vnfID = executor.inFields.get("vnfName"); +} +executor.logger.info("vnfID=" + vnfID); + +var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(vnfID.toString()); + +executor.logger.info("Logging context information for VNF \"" + vnfID + "\""); + +var clNotification = new org.onap.policy.controlloop.VirtualControlLoopNotification(); + +clNotification.setClosedLoopControlName(vcpeClosedLoopStatus.get("closedLoopControlName")); +clNotification.setClosedLoopAlarmStart(java.time.Instant.ofEpochMilli(vcpeClosedLoopStatus.get("closedLoopAlarmStart"))); +clNotification.setClosedLoopAlarmEnd(java.time.Instant.ofEpochMilli(vcpeClosedLoopStatus.get("closedLoopAlarmEnd"))); +clNotification.setClosedLoopEventClient(vcpeClosedLoopStatus.get("closedLoopEventClient")); +clNotification.setVersion(vcpeClosedLoopStatus.get("version")); +clNotification.setRequestId(java.util.UUID.fromString(vcpeClosedLoopStatus.get("requestID"))); +clNotification.setTargetType(org.onap.policy.controlloop.ControlLoopTargetType.toType(vcpeClosedLoopStatus.get("target_type"))); +clNotification.setTarget(org.onap.policy.controlloop.ControlLoopEventStatus.toStatus(vcpeClosedLoopStatus.get("target"))); +clNotification.setFrom(vcpeClosedLoopStatus.get("from")); +clNotification.setPolicyScope(vcpeClosedLoopStatus.get("policyScope")); +clNotification.setPolicyName(vcpeClosedLoopStatus.get("policyName")); +clNotification.setPolicyVersion(vcpeClosedLoopStatus.get("policyVersion")); +clNotification.setNotification(org.onap.policy.controlloop.ControlLoopNotificationType.toType(vcpeClosedLoopStatus.get("notification"))); +clNotification.setMessage(vcpeClosedLoopStatus.get("message")); + +var notificationInstant = java.time.Instant.ofEpochSecond(vcpeClosedLoopStatus.get("notificationTime")); +var notificationTime = java.time.ZonedDateTime.ofInstant(notificationInstant, java.time.ZoneOffset.UTC); +clNotification.setNotificationTime(notificationTime); + +var aaiInfo = vcpeClosedLoopStatus.get("AAI"); + +clNotification.getAai().put("generic-vnf.resource-version", aaiInfo.get("genericVnfResourceVersion")); +clNotification.getAai().put("generic-vnf.vnf-name", aaiInfo.get("genericVnfVnfName")); +clNotification.getAai().put("generic-vnf.prov-status", aaiInfo.get("genericVnfProvStatus")); +clNotification.getAai().put("generic-vnf.is-closed-loop-disabled", aaiInfo.get("genericVnfIsClosedLoopDisabled")); +clNotification.getAai().put("generic-vnf.orchestration-status", aaiInfo.get("genericVnfOrchestrationStatus")); +clNotification.getAai().put("generic-vnf.vnf-type", aaiInfo.get("genericVnfVnfType")); +clNotification.getAai().put("generic-vnf.in-maint", aaiInfo.get("genericVnfInMaint")); +clNotification.getAai().put("generic-vnf.service-id", aaiInfo.get("genericVnfServiceId")); +if(vnfID != null) { + clNotification.getAai().put("generic-vnf.vnf-id", aaiInfo.get("genericVnfVnfId")); +} +executor.outFields.put("VirtualControlLoopNotification", clNotification); executor.logger.info(executor.outFields); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/DeniedTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/DeniedTask.js index 4ee73750d..353c21ef6 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/DeniedTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/DeniedTask.js @@ -24,8 +24,8 @@ executor.logger.info(executor.inFields); var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( executor.inFields.get("vnfID").toString()); -vcpeClosedLoopStatus.put("notification", "VCPE VNF RESTART HAS BEEN DENIED BY GUARD"); -vcpeClosedLoopStatus.put("notificationTime", new Date().toISOString()); +vcpeClosedLoopStatus.put("notification", "REJECTED"); +vcpeClosedLoopStatus.put("notificationTime", java.lang.System.currentTimeMillis()); executor.logger.info(executor.outFields); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/GetVCPEStateTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/GetVCPEStateTask.js index 18bd418bf..0ba3c0985 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/GetVCPEStateTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/GetVCPEStateTask.js @@ -14,6 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. * + * Note: The incoming closedloop message can be ONSET with both VNF-name and VNF-ID + * or ABATED with only VNF-name. So need to handle differently. For ABATED case, + * since we still keep the RequireIDVNFID context album, we can get it from there. + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -21,49 +25,122 @@ executor.logger.info(executor.subject.id); executor.logger.info(executor.inFields); -var uuidType = Java.type("java.util.UUID"); +var clEventType = Java.type("org.onap.policy.controlloop.VirtualControlLoopEvent"); var longType = Java.type("java.lang.Long"); +var uuidType = Java.type("java.util.UUID"); -var requestID = uuidType.fromString(executor.inFields.get("requestID")); -var vnfID = uuidType.fromString(executor.inFields.get("AAI").get("generic_DasH_vnf_DoT_vnf_DasH_id")); - -var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(vnfID); - -if (vcpeClosedLoopStatus == null) { - executor.logger.info("Creating context information for new vCPE VNF \"" + vnfID.toString() + "\""); - - vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").getSchemaHelper().createNewInstance(); - - vcpeClosedLoopStatus.put("AAI", executor.inFields.get("AAI")); - vcpeClosedLoopStatus.put("closedLoopControlName", executor.inFields.get("closedLoopControlName")); - vcpeClosedLoopStatus.put("closedLoopAlarmStart", executor.inFields.get("closedLoopAlarmStart")); - vcpeClosedLoopStatus.put("closedLoopEventClient", executor.inFields.get("closedLoopEventClient")); - vcpeClosedLoopStatus.put("closedLoopEventStatus", executor.inFields.get("closedLoopEventStatus")); - vcpeClosedLoopStatus.put("version", executor.inFields.get("version")); - vcpeClosedLoopStatus.put("requestID", executor.inFields.get("requestID")); - vcpeClosedLoopStatus.put("target_type", executor.inFields.get("target_type")); - vcpeClosedLoopStatus.put("target", executor.inFields.get("target")); - vcpeClosedLoopStatus.put("from", executor.inFields.get("from")); - vcpeClosedLoopStatus.put("policyScope", "vCPE"); - vcpeClosedLoopStatus.put("policyName", "ONAPvCPEPolicyModel"); - vcpeClosedLoopStatus.put("policyVersion", "0.0.1"); - vcpeClosedLoopStatus.put("notification", ""); - vcpeClosedLoopStatus.put("notificationTime", ""); - - if (executor.inFields.get("closedLoopAlarmEnd") != null) { - vcpeClosedLoopStatus.put("closedLoopAlarmEnd", executor.inFields.get("closedLoopAlarmEnd")); - } else { - vcpeClosedLoopStatus.put("closedLoopAlarmEnd", longType.valueOf(0)); - } +var clEvent = executor.inFields.get("VirtualControlLoopEvent"); - executor.getContextAlbum("VCPEClosedLoopStatusAlbum").put(vnfID.toString(), vcpeClosedLoopStatus); +executor.logger.info(clEvent.toString()); +executor.logger.info(clEvent.getClosedLoopControlName()); - executor.logger.info("Created context information for new vCPE VNF \"" + vnfID.toString() + "\""); -} +var requestID = clEvent.getRequestId(); +executor.logger.info("requestID = " + requestID); +var vnfID = null; +var vcpeClosedLoopStatus = null; + +if (clEvent.getAai().get("generic-vnf.vnf-id") != null) { + vnfID = uuidType.fromString(clEvent.getAai().get("generic-vnf.vnf-id")); + executor.logger.info("vnfID = " + vnfID); + vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(vnfID); + + if (vcpeClosedLoopStatus == null) { + executor.logger.info("Creating context information for new vCPE VNF \"" + vnfID.toString() + "\""); + + vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").getSchemaHelper().createNewInstance(); + + vcpeClosedLoopStatus.put("closedLoopControlName", clEvent.getClosedLoopControlName()); + vcpeClosedLoopStatus.put("closedLoopAlarmStart", clEvent.getClosedLoopAlarmStart().toEpochMilli()); + vcpeClosedLoopStatus.put("closedLoopEventClient", clEvent.getClosedLoopEventClient()); + vcpeClosedLoopStatus.put("closedLoopEventStatus", clEvent.getClosedLoopEventStatus().toString()); + vcpeClosedLoopStatus.put("version", clEvent.getVersion()); + vcpeClosedLoopStatus.put("requestID", clEvent.getRequestId().toString()); + vcpeClosedLoopStatus.put("target_type", clEvent.getTargetType().toString()); + vcpeClosedLoopStatus.put("target", clEvent.getTarget()); + vcpeClosedLoopStatus.put("from", clEvent.getFrom()); + vcpeClosedLoopStatus.put("policyScope", "vCPE"); + vcpeClosedLoopStatus.put("policyName", "ONAPvCPEPolicyModel"); + vcpeClosedLoopStatus.put("policyVersion", "0.0.1"); + vcpeClosedLoopStatus.put("notification", "ACTIVE"); + vcpeClosedLoopStatus.put("notificationTime", java.lang.System.currentTimeMillis()); + vcpeClosedLoopStatus.put("message", ""); -executor.outFields.put("requestID", requestID); -executor.outFields.put("vnfID", vnfID); + var aaiInfo = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").getSchemaHelper().createNewSubInstance("VCPE_AAI_Type"); -executor.logger.info(executor.outFields); + aaiInfo.put("genericVnfResourceVersion", clEvent.getAai().get("generic-vnf.resource-version")); + aaiInfo.put("genericVnfVnfName", clEvent.getAai().get("generic-vnf.vnf-name")); + aaiInfo.put("genericVnfProvStatus", clEvent.getAai().get("generic-vnf.prov-status")); + aaiInfo.put("genericVnfIsClosedLoopDisabled", clEvent.getAai().get("generic-vnf.is-closed-loop-disabled")); + aaiInfo.put("genericVnfOrchestrationStatus", clEvent.getAai().get("generic-vnf.orchestration-status")); + aaiInfo.put("genericVnfVnfType", clEvent.getAai().get("generic-vnf.vnf-type")); + aaiInfo.put("genericVnfInMaint", clEvent.getAai().get("generic-vnf.in-maint")); + aaiInfo.put("genericVnfServiceId", clEvent.getAai().get("generic-vnf.service-id")); + aaiInfo.put("genericVnfVnfId", clEvent.getAai().get("generic-vnf.vnf-id")); + + vcpeClosedLoopStatus.put("AAI", aaiInfo); + + if (clEvent.getClosedLoopAlarmEnd() != null) { + vcpeClosedLoopStatus.put("closedLoopAlarmEnd", clEvent.getClosedLoopAlarmEnd().toEpochMilli()); + } else { + vcpeClosedLoopStatus.put("closedLoopAlarmEnd", java.lang.Long.valueOf(0)); + } + + executor.getContextAlbum("VCPEClosedLoopStatusAlbum").put(vnfID.toString(), vcpeClosedLoopStatus); + + executor.logger.info("Created context information for new vCPE VNF \"" + vnfID.toString() + "\""); + } + + executor.outFields.put("requestID", requestID); + executor.outFields.put("vnfID", vnfID); + + executor.logger.info(executor.outFields); +} +else { + executor.logger.info("No vnf-id in VirtualControlLoopEvent, status:" + clEvent.getClosedLoopEventStatus().toString()); + var vnfName = clEvent.getAai().get("generic-vnf.vnf-name"); + executor.logger.info("No vnf-id in VirtualControlLoopEvent for " + vnfName); + + vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(vnfName.toString()); + + if (vcpeClosedLoopStatus == null) { + executor.logger.info("Creating context information for new vCPE VNF \"" + vnfName.toString() + "\""); + + vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").getSchemaHelper().createNewInstance(); + + vcpeClosedLoopStatus.put("closedLoopControlName", clEvent.getClosedLoopControlName()); + vcpeClosedLoopStatus.put("closedLoopAlarmStart", clEvent.getClosedLoopAlarmStart().toEpochMilli()); + vcpeClosedLoopStatus.put("closedLoopEventClient", clEvent.getClosedLoopEventClient()); + vcpeClosedLoopStatus.put("closedLoopEventStatus", clEvent.getClosedLoopEventStatus().toString()); + vcpeClosedLoopStatus.put("version", clEvent.getVersion()); + vcpeClosedLoopStatus.put("requestID", clEvent.getRequestId().toString()); + vcpeClosedLoopStatus.put("target_type", clEvent.getTargetType().toString()); + vcpeClosedLoopStatus.put("target", clEvent.getTarget()); + vcpeClosedLoopStatus.put("from", clEvent.getFrom()); + vcpeClosedLoopStatus.put("policyScope", "vCPE"); + vcpeClosedLoopStatus.put("policyName", "ONAPvCPEPolicyModel"); + vcpeClosedLoopStatus.put("policyVersion", "0.0.1"); + vcpeClosedLoopStatus.put("notification", "ACTIVE"); + vcpeClosedLoopStatus.put("notificationTime", java.lang.System.currentTimeMillis()); + vcpeClosedLoopStatus.put("message", ""); + + var aaiInfo = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").getSchemaHelper().createNewSubInstance("VCPE_AAI_Type"); + + aaiInfo.put("genericVnfVnfName", clEvent.getAai().get("generic-vnf.vnf-name")); + vcpeClosedLoopStatus.put("AAI", aaiInfo); + + if (clEvent.getClosedLoopAlarmEnd() != null) { + vcpeClosedLoopStatus.put("closedLoopAlarmEnd", clEvent.getClosedLoopAlarmEnd().toEpochMilli()); + } else { + vcpeClosedLoopStatus.put("closedLoopAlarmEnd", java.lang.Long.valueOf(0)); + } + + executor.getContextAlbum("VCPEClosedLoopStatusAlbum").put(vnfName.toString(), vcpeClosedLoopStatus); + + executor.logger.info("Created context information for new vCPE VNF \"" + vnfName.toString() + "\""); + } + executor.outFields.put("requestID", requestID); + executor.outFields.put("vnfName", vnfName); + executor.logger.info(executor.outFields); +} returnValue = executor.isTrue; diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/GuardRequestTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/GuardRequestTask.js index bf66dbb22..d247f8a65 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/GuardRequestTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/GuardRequestTask.js @@ -34,11 +34,11 @@ guardDecisionAttributes.put("clname", "APEXvCPEImplementation"); executor.logger.info(guardDecisionAttributes); executor.outFields.put("decisionAttributes", guardDecisionAttributes); -executor.outFields.put("onapName", "APEX"); +executor.outFields.put("onapName", "PDPD"); executor.getContextAlbum("ControlLoopExecutionIDAlbum").put(executor.executionId.toString(), executor.inFields.get("vnfID")); executor.logger.info(executor.outFields); -var returnValue = executor.isTrue;
\ No newline at end of file +var returnValue = executor.isTrue; diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/GuardResponseTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/GuardResponseTask.js index 69cd03771..2a9100b7f 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/GuardResponseTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/GuardResponseTask.js @@ -36,7 +36,7 @@ if (guardResult === "PERMIT") { vcpeClosedLoopStatus.put("notification", "OPERATION: GUARD_DENY"); } else { executor.message = "guard result must be either \"PERMIT\" or \"DENY\""; - returnValue = executor.isFalse; + returnValue = executor.FALSE; } var uuidType = Java.type("java.util.UUID"); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyOnsetOrAbatedStateTSL.js b/examples/examples-onap-vcpe/src/main/resources/logic/OnsetOrAbatedStateTSL.js index b97fe5a0c..c8a3bfba8 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyOnsetOrAbatedStateTSL.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/OnsetOrAbatedStateTSL.js @@ -22,11 +22,19 @@ executor.logger.info(executor.subject.id); executor.logger.info(executor.inFields); var returnValue = executor.isTrue; +var status = null; -var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( +if( executor.inFields.get("vnfID") == null) { + executor.logger.info("OnsetOrAbatedStateTSL: vnfID is null"); + var vnfName = executor.inFields.get("vnfName"); + var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( + executor.inFields.get("vnfName")); + status = vcpeClosedLoopStatus.get("closedLoopEventStatus").toString(); +} else { + var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( executor.inFields.get("vnfID").toString()); - -var status = vcpeClosedLoopStatus.get("closedLoopEventStatus"); + status = vcpeClosedLoopStatus.get("closedLoopEventStatus").toString(); +} var returnValue = executor.isTrue; @@ -36,7 +44,7 @@ if (status === "ONSET") { executor.subject.getTaskKey("AbatedTask").copyTo(executor.selectedTask); onsetFlag = executor.isFalse; } else { - executor.message = "closedLoopEventStatus must be either \"ONSET\" or \"ABATED\""; + executor.message = "closedLoopEventStatus is \"" + status + "\", it must be either \"ONSET\" or \"ABATED\""; returnValue = executor.isFalse; } diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyAAILookupStateTSL.js b/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyAAILookupStateTSL.js deleted file mode 100644 index ce627950c..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyAAILookupStateTSL.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * ================================================================================ - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -executor.logger.info(executor.subject.id); -executor.logger.info(executor.inFields); - -var returnValue = executor.isTrue; - -var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( - executor.inFields.get("vnfID").toString()); -var aaiInfo = vcpeClosedLoopStatus.get("AAI"); - -executor.logger.info(aaiInfo); - -if (aaiInfo.get("generic_DasH_vnf.resource_DasH_version") != null - && aaiInfo.get("generic_DasH_vnf.vnf_DasH_name") != null - && aaiInfo.get("generic_DasH_vnf.prov_DasH_status") != null - && aaiInfo.get("generic_DasH_vnf.is_DasH_closed_DasH_loop_DasH_disabled") != null - && aaiInfo.get("generic_DasH_vnf.orchestration_DasH_status") != null - && aaiInfo.get("generic_DasH_vnf.vnf_DasH_type") != null - && aaiInfo.get("generic_DasH_vnf.in_DasH_maint") != null - && aaiInfo.get("generic_DasH_vnf.service_DasH_id") != null - && aaiInfo.get("generic_DasH_vnf.vnf_DasH_id") != null) { - executor.subject.getTaskKey("AAILookupRequestTask").copyTo(executor.selectedTask); -} else { - executor.subject.getTaskKey("NoAAILookupTask").copyTo(executor.selectedTask); -} - -executor.logger.info("ReceiveEventPolicyOnsetOrAbatedStateTSL State Selected Task:" + executor.selectedTask); diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyRequestAAIStateTSL.js b/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyRequestAAIStateTSL.js new file mode 100644 index 000000000..b397a5f7c --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/logic/ReceiveEventPolicyRequestAAIStateTSL.js @@ -0,0 +1,54 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +executor.logger.info(executor.subject.id); +executor.logger.info(executor.inFields); + +var returnValue = executor.isTrue; + +if( executor.inFields.get("vnfID") == null) { + executor.logger.info("ReceiveEventPolicyRequestAAIStateTSL: vnfID is null"); + var vnfName = executor.inFields.get("vnfName"); + var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( + executor.inFields.get("vnfName")); + executor.logger.info("CL event status: " + vcpeClosedLoopStatus.get("closedLoopEventStatus")); + executor.subject.getTaskKey("NoAAILookupTask").copyTo(executor.selectedTask); + } else { + var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get( + executor.inFields.get("vnfID").toString()); + var aaiInfo = vcpeClosedLoopStatus.get("AAI"); + + executor.logger.info(aaiInfo); + + if (aaiInfo.get("genericVnfResourceVersion") != null + && aaiInfo.get("genericVnfVnfName") != null + && aaiInfo.get("genericVnfProvStatus") != null + && aaiInfo.get("genericVnfIsClosedLoopDisabled") != null + && aaiInfo.get("genericVnfOrchestrationStatus") != null + && aaiInfo.get("genericVnfVnfType") != null + && aaiInfo.get("genericVnfInMaint") != null + && aaiInfo.get("genericVnfServiceId") != null + && aaiInfo.get("genericVnfVnfId") != null) { + executor.subject.getTaskKey("NoAAILookupTask").copyTo(executor.selectedTask); + } else { + executor.subject.getTaskKey("AAILookupRequestTask").copyTo(executor.selectedTask); + } +} +executor.logger.info("ReceiveEventPolicyOnsetOrAbatedStateTSL State Selected Task:" + executor.selectedTask); diff --git a/examples/examples-onap-vcpe/src/main/resources/policy/ONAPvCPEPolicyModel.apex b/examples/examples-onap-vcpe/src/main/resources/policy/ONAPvCPEPolicyModel.apex index 22d0ddae0..490c4ad7c 100644 --- a/examples/examples-onap-vcpe/src/main/resources/policy/ONAPvCPEPolicyModel.apex +++ b/examples/examples-onap-vcpe/src/main/resources/policy/ONAPvCPEPolicyModel.apex @@ -25,20 +25,17 @@ schema create name=SimpleLongType flavour=Java schema=java.lang.Long schema create name=SimpleBooleanType flavour=Java schema=java.lang.Boolean schema create name=UUIDType flavour=Java schema=java.util.UUID -schema create name=VCPEAAIInfoType flavour=Avro schema=LS -#MACROFILE:"src/main/resources/schemas/VCPEAAIInfoType.avsc" -LE +schema create name=VirtualControlLoopEventType flavour=Java schema=org.onap.policy.controlloop.VirtualControlLoopEvent +schema create name=VirtualControlLoopNotificationType flavour=Java schema=org.onap.policy.controlloop.VirtualControlLoopNotification -schema create name=GuardDecisionAttributesType flavour=Avro schema=LS -#MACROFILE:"src/main/resources/schemas/GuardDecisionAttributesType.avsc" -LE +schema create name=AAIServiceNamedQueryRequestType flavour=Java schema=org.onap.policy.aai.AaiNqRequest +schema create name=AAIServiceNamedQueryResponseType flavour=Java schema=org.onap.policy.aai.AaiNqResponse -schema create name=APPCInputBodyType flavour=Avro schema=LS -#MACROFILE:"src/main/resources/schemas/APPCInputBodyType.avsc" -LE +schema create name=APPCLCMRequestType flavour=Java schema=org.onap.policy.appclcm.LcmRequestWrapper +schema create name=APPCLCMResponseType flavour=Java schema=org.onap.policy.appclcm.LcmResponseWrapper -schema create name=APPCOutputBodyType flavour=Avro schema=LS -#MACROFILE:"src/main/resources/schemas/APPCOutputBodyType.avsc" +schema create name=GuardDecisionAttributesType flavour=Avro schema=LS +#MACROFILE:"src/main/resources/schemas/GuardDecisionAttributesType.avsc" LE schema create name=VCPEClosedLoopStatusType flavour=Avro schema=LS @@ -51,24 +48,13 @@ album create name=ControlLoopExecutionIDAlbum scope=policy writable=true schemaN album create name=RequestIDVNFIDAlbum scope=policy writable=true schemaName=UUIDType -event create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 version=1.0.2 nameSpace=org.onap.policy.apex.onap.vcpe source=DCAE target=APEX - -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=closedLoopControlName schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=closedLoopAlarmStart schemaName=SimpleLongType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=closedLoopAlarmEnd schemaName=SimpleLongType optional=true -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=closedLoopEventClient schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=closedLoopEventStatus schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=requestID schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=target_type schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=target schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=from schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=version schemaName=SimpleStringType -event parameter create name=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 parName=AAI schemaName=VCPEAAIInfoType +event create name=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e version=1.0.2 nameSpace=org.onap.policy.apex.onap.vcpe source=DCAE target=APEX +event parameter create name=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e parName=VirtualControlLoopEvent schemaName=VirtualControlLoopEventType event create name=VCPEStateUpdatedEvent nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=APEX - event parameter create name=VCPEStateUpdatedEvent parName=requestID schemaName=UUIDType event parameter create name=VCPEStateUpdatedEvent parName=vnfID schemaName=UUIDType +event parameter create name=VCPEStateUpdatedEvent parName=vnfName schemaName=SimpleStringType optional=true event create name=GuardRequestEvent nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=APEX @@ -80,60 +66,31 @@ event create name=GuardResponseEvent nameSpace=org.onap.policy.apex.onap.vcpe so event parameter create name=GuardResponseEvent parName=decision schemaName=SimpleStringType event parameter create name=GuardResponseEvent parName=details schemaName=SimpleStringType -event create name=APPCRestartVNFRequestEvent nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=APPC +event create name=APPCRestartVNFRequestEvent version="2.0.0" nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=APPC +event parameter create name=APPCRestartVNFRequestEvent parName=APPCLCMRequestEvent schemaName=APPCLCMRequestType -event parameter create name=APPCRestartVNFRequestEvent parName=body schemaName=APPCInputBodyType -event parameter create name=APPCRestartVNFRequestEvent parName=version schemaName=SimpleStringType -event parameter create name=APPCRestartVNFRequestEvent parName=rpc-name schemaName=SimpleStringType -event parameter create name=APPCRestartVNFRequestEvent parName=correlation-id schemaName=SimpleStringType -event parameter create name=APPCRestartVNFRequestEvent parName=type schemaName=SimpleStringType - -event create name=APPCRestartVNFResponseEvent nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=APPC - -event parameter create name=APPCRestartVNFResponseEvent parName=body schemaName=APPCOutputBodyType -event parameter create name=APPCRestartVNFResponseEvent parName=version schemaName=SimpleStringType -event parameter create name=APPCRestartVNFResponseEvent parName=rpc-name schemaName=SimpleStringType -event parameter create name=APPCRestartVNFResponseEvent parName=correlation-id schemaName=SimpleStringType -event parameter create name=APPCRestartVNFResponseEvent parName=type schemaName=SimpleStringType +event create name=APPCRestartVNFResponseEvent version="2.0.0" nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=APPC +event parameter create name=APPCRestartVNFResponseEvent parName=APPCLCMResponseEvent schemaName=APPCLCMResponseType event create name=ControlLoopLogEvent nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=APEX +event parameter create name=ControlLoopLogEvent parName=VirtualControlLoopNotification schemaName=VirtualControlLoopNotificationType -event parameter create name=ControlLoopLogEvent parName=AAI schemaName=VCPEAAIInfoType -event parameter create name=ControlLoopLogEvent parName=closedLoopControlName schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=closedLoopAlarmStart schemaName=SimpleLongType -event parameter create name=ControlLoopLogEvent parName=closedLoopAlarmEnd schemaName=SimpleLongType optional=true -event parameter create name=ControlLoopLogEvent parName=closedLoopEventClient schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=closedLoopEventStatus schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=version schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=requestID schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=target_type schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=target schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=from schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=policyScope schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=policyName schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=policyVersion schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=notification schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=message schemaName=SimpleStringType -event parameter create name=ControlLoopLogEvent parName=notificationTime schemaName=SimpleStringType +event create name=AAINamedQueryRequestEvent nameSpace=org.onap.policy.apex.onap.vcpe source=APEX target=AAI +event parameter create name=AAINamedQueryRequestEvent parName=AAINamedQueryRequest schemaName=AAIServiceNamedQueryRequestType -task create name=GetVCPEStateTask +event create name=AAINamedQueryResponseEvent nameSpace=org.onap.policy.apex.onap.vcpe source=AAI target=APEX +event parameter create name=AAINamedQueryResponseEvent parName=AAINamedQueryResponse schemaName=AAIServiceNamedQueryResponseType -task inputfield create name=GetVCPEStateTask fieldName=closedLoopControlName schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=closedLoopAlarmStart schemaName=SimpleLongType -task inputfield create name=GetVCPEStateTask fieldName=closedLoopAlarmEnd schemaName=SimpleLongType optional=true -task inputfield create name=GetVCPEStateTask fieldName=closedLoopEventClient schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=closedLoopEventStatus schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=requestID schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=target_type schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=target schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=from schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=version schemaName=SimpleStringType -task inputfield create name=GetVCPEStateTask fieldName=AAI schemaName=VCPEAAIInfoType +task create name=GetVCPEStateTask -task contextref create name=GetVCPEStateTask albumName=VCPEClosedLoopStatusAlbum +task inputfield create name=GetVCPEStateTask fieldName=VirtualControlLoopEvent schemaName=VirtualControlLoopEventType task outputfield create name=GetVCPEStateTask fieldName=requestID schemaName=UUIDType task outputfield create name=GetVCPEStateTask fieldName=vnfID schemaName=UUIDType +task outputfield create name=GetVCPEStateTask fieldName=vnfName schemaName=SimpleStringType optional=true + +task contextref create name=GetVCPEStateTask albumName=VCPEClosedLoopStatusAlbum +task contextref create name=GetVCPEStateTask albumName=RequestIDVNFIDAlbum task logic create name=GetVCPEStateTask logicFlavour=JAVASCRIPT logic=LS #MACROFILE:"src/main/resources/logic/GetVCPEStateTask.js" @@ -143,9 +100,11 @@ task create name=AbatedTask task inputfield create name=AbatedTask fieldName=requestID schemaName=UUIDType task inputfield create name=AbatedTask fieldName=vnfID schemaName=UUIDType +task inputfield create name=AbatedTask fieldName=vnfName schemaName=SimpleStringType optional=true task outputfield create name=AbatedTask fieldName=requestID schemaName=UUIDType task outputfield create name=AbatedTask fieldName=vnfID schemaName=UUIDType +task outputfield create name=AbatedTask fieldName=vnfName schemaName=SimpleStringType optional=true task contextref create name=AbatedTask albumName=VCPEClosedLoopStatusAlbum @@ -202,11 +161,7 @@ task create name=APPCRestartVNFRequestTask task inputfield create name=APPCRestartVNFRequestTask fieldName=requestID schemaName=UUIDType task inputfield create name=APPCRestartVNFRequestTask fieldName=vnfID schemaName=UUIDType -task outputfield create name=APPCRestartVNFRequestTask fieldName=body schemaName=APPCInputBodyType -task outputfield create name=APPCRestartVNFRequestTask fieldName=version schemaName=SimpleStringType -task outputfield create name=APPCRestartVNFRequestTask fieldName=rpc-name schemaName=SimpleStringType -task outputfield create name=APPCRestartVNFRequestTask fieldName=correlation-id schemaName=SimpleStringType -task outputfield create name=APPCRestartVNFRequestTask fieldName=type schemaName=SimpleStringType +task outputfield create name=APPCRestartVNFRequestTask fieldName=APPCLCMRequestEvent schemaName=APPCLCMRequestType task contextref create name=APPCRestartVNFRequestTask albumName=VCPEClosedLoopStatusAlbum task contextref create name=APPCRestartVNFRequestTask albumName=RequestIDVNFIDAlbum @@ -217,11 +172,7 @@ LE task create name=APPCRestartVNFResponseTask -task inputfield create name=APPCRestartVNFResponseTask fieldName=body schemaName=APPCOutputBodyType -task inputfield create name=APPCRestartVNFResponseTask fieldName=version schemaName=SimpleStringType -task inputfield create name=APPCRestartVNFResponseTask fieldName=rpc-name schemaName=SimpleStringType -task inputfield create name=APPCRestartVNFResponseTask fieldName=correlation-id schemaName=SimpleStringType -task inputfield create name=APPCRestartVNFResponseTask fieldName=type schemaName=SimpleStringType +task inputfield create name=APPCRestartVNFResponseTask fieldName=APPCLCMResponseEvent schemaName=APPCLCMResponseType task outputfield create name=APPCRestartVNFResponseTask fieldName=requestID schemaName=UUIDType task outputfield create name=APPCRestartVNFResponseTask fieldName=vnfID schemaName=UUIDType @@ -238,23 +189,7 @@ task create name=ControlLoopLogTask task inputfield create name=ControlLoopLogTask fieldName=requestID schemaName=UUIDType task inputfield create name=ControlLoopLogTask fieldName=vnfID schemaName=UUIDType -task outputfield create name=ControlLoopLogTask fieldName=AAI schemaName=VCPEAAIInfoType -task outputfield create name=ControlLoopLogTask fieldName=closedLoopControlName schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=closedLoopAlarmStart schemaName=SimpleLongType -task outputfield create name=ControlLoopLogTask fieldName=closedLoopAlarmEnd schemaName=SimpleLongType optional=true -task outputfield create name=ControlLoopLogTask fieldName=closedLoopEventClient schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=closedLoopEventStatus schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=requestID schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=version schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=target_type schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=target schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=from schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=policyScope schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=policyName schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=policyVersion schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=notification schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=message schemaName=SimpleStringType -task outputfield create name=ControlLoopLogTask fieldName=notificationTime schemaName=SimpleStringType +task outputfield create name=ControlLoopLogTask fieldName=VirtualControlLoopNotification schemaName=VirtualControlLoopNotificationType task contextref create name=ControlLoopLogTask albumName=VCPEClosedLoopStatusAlbum @@ -262,6 +197,49 @@ task logic create name=ControlLoopLogTask logicFlavour=JAVASCRIPT logic=LS #MACROFILE:"src/main/resources/logic/ControlLoopLogTask.js" LE +task create name=AAILookupRequestTask + +task inputfield create name=AAILookupRequestTask fieldName=requestID schemaName=UUIDType +task inputfield create name=AAILookupRequestTask fieldName=vnfID schemaName=UUIDType + +task outputfield create name=AAILookupRequestTask fieldName=AAINamedQueryRequest schemaName=AAIServiceNamedQueryRequestType + +task contextref create name=AAILookupRequestTask albumName=VCPEClosedLoopStatusAlbum +task contextref create name=AAILookupRequestTask albumName=ControlLoopExecutionIDAlbum + +task logic create name=AAILookupRequestTask logicFlavour=JAVASCRIPT logic=LS +#MACROFILE:"src/main/resources/logic/AAILookupRequestTask.js" +LE + +task create name=AAILookupResponseTask + +task inputfield create name=AAILookupResponseTask fieldName=AAINamedQueryResponse schemaName=AAIServiceNamedQueryResponseType + +task outputfield create name=AAILookupResponseTask fieldName=requestID schemaName=UUIDType +task outputfield create name=AAILookupResponseTask fieldName=vnfID schemaName=UUIDType + +task contextref create name=AAILookupResponseTask albumName=VCPEClosedLoopStatusAlbum +task contextref create name=AAILookupResponseTask albumName=ControlLoopExecutionIDAlbum + +task logic create name=AAILookupResponseTask logicFlavour=JAVASCRIPT logic=LS +#MACROFILE:"src/main/resources/logic/AAILookupResponseTask.js" +LE + +task create name=NoAAILookupTask + +task inputfield create name=NoAAILookupTask fieldName=requestID schemaName=UUIDType +task inputfield create name=NoAAILookupTask fieldName=vnfID schemaName=UUIDType + +task outputfield create name=NoAAILookupTask fieldName=requestID schemaName=UUIDType +task outputfield create name=NoAAILookupTask fieldName=vnfID schemaName=UUIDType + +task logic create name=NoAAILookupTask logicFlavour=JAVASCRIPT logic=LS +#MACROFILE:"src/main/resources/logic/NoAAILookupTask.js" +LE + +# +# ReceiveEventPolicy +# policy create name=ReceiveEventPolicy template=Freestyle firstState=GetVCPEState policy state create name=ReceiveEventPolicy stateName=AbatedState triggerName=VCPEStateUpdatedEvent defaultTaskName=ControlLoopLogTask @@ -277,13 +255,53 @@ policy state taskref create name=ReceiveEventPolicy stateName=OnsetOrAbatedState policy state contextref create name=ReceiveEventPolicy stateName=OnsetOrAbatedState albumName=VCPEClosedLoopStatusAlbum policy state selecttasklogic create name=ReceiveEventPolicy stateName=OnsetOrAbatedState logicFlavour=JAVASCRIPT logic=LS -#MACROFILE:"src/main/resources/logic/ReceiveEventPolicyOnsetOrAbatedStateTSL.js" +#MACROFILE:"src/main/resources/logic/OnsetOrAbatedStateTSL.js" +LE + +policy state create name=ReceiveEventPolicy stateName=RequestAAIState triggerName=VCPEStateUpdatedEvent defaultTaskName=AAILookupRequestTask +policy state output create name=ReceiveEventPolicy stateName=RequestAAIState outputName=RequestAAIStateOutput eventName=AAINamedQueryRequestEvent +policy state taskref create name=ReceiveEventPolicy stateName=RequestAAIState taskName=AAILookupRequestTask outputType=DIRECT outputName=RequestAAIStateOutput +policy state output create name=ReceiveEventPolicy stateName=RequestAAIState outputName=DoNotRequestAAIStateOutput eventName=VCPEStateUpdatedEvent nextState=OnsetOrAbatedState +policy state taskref create name=ReceiveEventPolicy stateName=RequestAAIState taskName=NoAAILookupTask outputType=DIRECT outputName=DoNotRequestAAIStateOutput + +policy state contextref create name=ReceiveEventPolicy stateName=RequestAAIState albumName=VCPEClosedLoopStatusAlbum + +policy state selecttasklogic create name=ReceiveEventPolicy stateName=RequestAAIState logicFlavour=JAVASCRIPT logic=LS +#MACROFILE:"src/main/resources/logic/ReceiveEventPolicyRequestAAIStateTSL.js" LE -policy state create name=ReceiveEventPolicy stateName=GetVCPEState triggerName=ControlLoop-vCPE-85317438-861d-42a9-979e-9d96dc0a9ef1 defaultTaskName=GetVCPEStateTask -policy state output create name=ReceiveEventPolicy stateName=GetVCPEState outputName=GetVCPEStateOutput eventName=VCPEStateUpdatedEvent nextState=OnsetOrAbatedState +policy state create name=ReceiveEventPolicy stateName=GetVCPEState triggerName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e defaultTaskName=GetVCPEStateTask +policy state output create name=ReceiveEventPolicy stateName=GetVCPEState outputName=GetVCPEStateOutput eventName=VCPEStateUpdatedEvent nextState=RequestAAIState policy state taskref create name=ReceiveEventPolicy stateName=GetVCPEState taskName=GetVCPEStateTask outputType=DIRECT outputName=GetVCPEStateOutput +# +# AAIResponsePolicy +# +policy create name=AAIResponsePolicy template=Freestyle firstState=AAIResponseState + +policy state create name=AAIResponsePolicy stateName=AbatedState triggerName=VCPEStateUpdatedEvent defaultTaskName=ControlLoopLogTask +policy state output create name=AAIResponsePolicy stateName=AbatedState outputName=AbatedOutput eventName=ControlLoopLogEvent +policy state taskref create name=AAIResponsePolicy stateName=AbatedState taskName=ControlLoopLogTask outputType=DIRECT outputName=AbatedOutput + +policy state create name=AAIResponsePolicy stateName=OnsetOrAbatedState triggerName=VCPEStateUpdatedEvent defaultTaskName=AbatedTask +policy state output create name=AAIResponsePolicy stateName=OnsetOrAbatedState outputName=OnsetOutput eventName=GuardRequestEvent +policy state taskref create name=AAIResponsePolicy stateName=OnsetOrAbatedState taskName=GuardRequestTask outputType=DIRECT outputName=OnsetOutput +policy state output create name=AAIResponsePolicy stateName=OnsetOrAbatedState outputName=AbatedOutput eventName=VCPEStateUpdatedEvent nextState=AbatedState +policy state taskref create name=AAIResponsePolicy stateName=OnsetOrAbatedState taskName=AbatedTask outputType=DIRECT outputName=AbatedOutput + +policy state contextref create name=AAIResponsePolicy stateName=OnsetOrAbatedState albumName=VCPEClosedLoopStatusAlbum + +policy state selecttasklogic create name=AAIResponsePolicy stateName=OnsetOrAbatedState logicFlavour=JAVASCRIPT logic=LS +#MACROFILE:"src/main/resources/logic/OnsetOrAbatedStateTSL.js" +LE + +policy state create name=AAIResponsePolicy stateName=AAIResponseState triggerName=AAINamedQueryResponseEvent defaultTaskName=AAILookupResponseTask +policy state output create name=AAIResponsePolicy stateName=AAIResponseState outputName=AAIResponseStateOutput eventName=VCPEStateUpdatedEvent nextState=OnsetOrAbatedState +policy state taskref create name=AAIResponsePolicy stateName=AAIResponseState taskName=AAILookupResponseTask outputType=DIRECT outputName=AAIResponseStateOutput + +# +# RestartAPPCRequestPolicy +# policy create name=RestartAPPCRequestPolicy template=Freestyle firstState=PolicyGuardResponseState policy state create name=RestartAPPCRequestPolicy stateName=DeniedState triggerName=VCPEStateUpdatedEvent defaultTaskName=ControlLoopLogTask @@ -306,6 +324,9 @@ policy state selecttasklogic create name=RestartAPPCRequestPolicy stateName=Perm #MACROFILE:"src/main/resources/logic/RestartAPPCRequestPolicyPermitOrDenyTSL.js" LE +# +# RestartAPPCResponsePolicy +# policy create name=RestartAPPCResponsePolicy template=Freestyle firstState=RestartAPPCResponseState policy state create name=RestartAPPCResponsePolicy stateName=ResponseLogState triggerName=VCPEStateUpdatedEvent defaultTaskName=ControlLoopLogTask diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/AAIInstanceFiltersType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/AAIInstanceFiltersType.avsc deleted file mode 100644 index 621372d2f..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/AAIInstanceFiltersType.avsc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type": "record", - "name": "AAIInstanceFilters_Type", - "namespace": "org.onap.policy.apex.onap.vcpe", - "fields": [ - { - "type": "record", - "name": "instance_DasH_filters", - "namespace": "org.onap.policy.apex.onap.vcpe", - "fields": [ - { - "name": "instance_DasH_filter", - "type": { - "type": "array", - "items": { - "type": "record", - "name": "generic_DasH_vnf", - "fields": [ - { - "name": "vnf_DasH_id", - "type": "string" - } - ] - } - } - } - ] - } - ] -} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/AAIInventoryResponseItemType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/AAIInventoryResponseItemType.avsc deleted file mode 100644 index e64d0e36a..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/AAIInventoryResponseItemType.avsc +++ /dev/null @@ -1,70 +0,0 @@ -{ - "type": "array", - "items": { - "type": "record", - "name": "AAIInventoryResponseItem_Type", - "fields": [ - { - "name": "model_DasH_name", - "type": "string" - }, - { - "name": "extra_DasH_properties", - "type": { - "type": "record", - "name": "AAIInventoryResponseItemExtraProperties_Type", - "fields": [] - } - }, - { - "name": "generic_DasH_vnf", - "type": { - "type": "record", - "name": "AAIInventoryResponseItemGenericVNF_Type", - "fields": [ - { - "name": "vnf_DasH_id", - "type": "string" - }, - { - "name": "vnf_DasH_name", - "type": "string" - }, - { - "name": "vnf_DasH_type", - "type": "string" - }, - { - "name": "service_DasH_id", - "type": "string" - }, - { - "name": "orchestration_DasH_status", - "type": "string" - }, - { - "name": "in_DasH_maint", - "type": "boolean" - }, - { - "name": "is_DasH_closed_DasH_loop_DasH_disabled", - "type": "boolean" - }, - { - "name": "resource_DasH_version", - "type": "string" - }, - { - "name": "model_DasH_invariant_DasH_id", - "type": "string" - }, - { - "name": "model_DasH_version_DasH_id", - "type": "string" - } - ] - } - } - ] - } -} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/AAINamedQueryType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/AAINamedQueryType.avsc deleted file mode 100644 index ffa3ca534..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/AAINamedQueryType.avsc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "record", - "name": "AAINamedQuery_Type", - "namespace": "org.onap.policy.apex.onap.vcpe", - "fields": [ - { - "name": "named_DasH_query_DasH_uuid", - "type": "string" - } - ] -} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/APPCInputBodyType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/APPCInputBodyType.avsc deleted file mode 100644 index 3acf96e7f..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/APPCInputBodyType.avsc +++ /dev/null @@ -1,76 +0,0 @@ -{ - "type" : "record", - "name" : "APPCInputBody_Type", - "namespace" : "org.onap.policy.apex.onap.vcpe", - "fields" : [ - { - "name": "input", - "type": { - "type" : "record", - "name" : "InputRecord", - "fields" : [ - { - "name": "action", "type": "string" - }, - { - "name": "action_DasH_identifiers", - "type": { - "type" : "record", - "name" : "ActionIdentifiersRecord", - "fields" : [ - { - "name": "vnf_DasH_id", "type": "string" - } - ] - } - }, - { - "name": "common_DasH_header", - "type": { - "type" : "record", - "name" : "InputCommonHeaderRecord", - "fields" : [ - { - "name": "request_DasH_id", "type": "string" - }, - { - "name": "originator_DasH_id", "type": "string" - }, - { - "name": "api_DasH_ver", "type": "string" - }, - { - "name": "sub_DasH_request_DasH_id", "type": "string" - }, - { - "name": "timestamp", "type": "string" - }, - { - "name": "flags", - "type": { - "type" : "record", - "name" : "FlagsRecord", - "fields" : [ - { - "name": "ttl", "type": "string" - }, - { - "name": "force", "type": "string" - }, - { - "name": "mode", "type": "string" - } - ] - } - } - ] - } - }, - { - "name": "payload", "type": "string" - } - ] - } - } - ] -} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/APPCOutputBodyType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/APPCOutputBodyType.avsc deleted file mode 100644 index 2c110170a..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/APPCOutputBodyType.avsc +++ /dev/null @@ -1,55 +0,0 @@ -{ - "type" : "record", - "name" : "APPCOutputBody_Type", - "namespace" : "org.onap.policy.apex.onap.vcpe", - "fields" : [ - { - "name": "output", - "type": { - "type" : "record", - "name" : "OutputRecord", - "fields" : [ - { - "name": "status", - "type": { - "type" : "record", - "name" : "StatusRecord", - "fields" : [ - { - "name": "code", "type": "int" - }, - { - "name": "message", "type": "string" - } - ] - } - }, - { - "name": "common_DasH_header", - "type": { - "type" : "record", - "name" : "OutputCommonHeaderRecord", - "fields" : [ - { - "name": "request_DasH_id", "type": "string" - }, - { - "name": "originator_DasH_id", "type": "string" - }, - { - "name": "api_DasH_ver", "type": "string" - }, - { - "name": "sub_DasH_request_DasH_id", "type": "string" - }, - { - "name": "timestamp", "type": "string" - } - ] - } - } - ] - } - } - ] -} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEAAIInfoType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEAAIInfoType.avsc deleted file mode 100644 index ff7cad18a..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEAAIInfoType.avsc +++ /dev/null @@ -1,43 +0,0 @@ -{ - "type": "record", - "name": "AAI_Type", - "namespace": "org.onap.policy.apex.onap.vcpe", - "fields": [ - { - "name": "generic_DasH_vnf_DoT_resource_DasH_version", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_name", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_prov_DasH_status", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_is_DasH_closed_DasH_loop_DasH_disabled", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_orchestration_DasH_status", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_type", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_in_DasH_maint", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_service_DasH_id", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_id", - "type": "string" - } - ] -} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusType.avsc index e628c23d9..cc83c5219 100644 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusType.avsc +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusType.avsc @@ -10,39 +10,39 @@ "namespace": "org.onap.policy.apex.onap.vcpe", "fields": [ { - "name": "generic_DasH_vnf_DoT_resource_DasH_version", + "name": "genericVnfResourceVersion", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_vnf_DasH_name", + "name": "genericVnfVnfName", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_prov_DasH_status", + "name": "genericVnfProvStatus", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_is_DasH_closed_DasH_loop_DasH_disabled", + "name": "genericVnfIsClosedLoopDisabled", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_orchestration_DasH_status", + "name": "genericVnfOrchestrationStatus", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_vnf_DasH_type", + "name": "genericVnfVnfType", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_in_DasH_maint", + "name": "genericVnfInMaint", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_service_DasH_id", + "name": "genericVnfServiceId", "type": "string" }, { - "name": "generic_DasH_vnf_DoT_vnf_DasH_id", + "name": "genericVnfVnfId", "type": "string" } ] @@ -106,6 +106,10 @@ }, { "name": "notificationTime", + "type": "long" + }, + { + "name": "message", "type": "string" } ] diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusTypeWithHistory.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusTypeWithHistory.avsc deleted file mode 100644 index 9b76f9440..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusTypeWithHistory.avsc +++ /dev/null @@ -1,152 +0,0 @@ -{ - "type": "record", - "name": "VCPEClosedLoopStatus", - "fields": [ - { - "name": "AAI", - "type": { - "type": "record", - "name": "VCPE_AAI_Type", - "namespace": "org.onap.policy.apex.onap.vcpe", - "fields": [ - { - "name": "generic_DasH_vnf_DoT_resource_DasH_version", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_name", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_prov_DasH_status", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_is_DasH_closed_DasH_loop_DasH_disabled", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_orchestration_DasH_status", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_type", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_in_DasH_maint", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_service_DasH_id", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_id", - "type": "string" - } - ] - } - }, - { - "name": "closedLoopAlarmStart", - "type": "long" - }, - { - "name": "closedLoopControlName", - "type": "string" - }, - { - "name": "version", - "type": "string" - }, - { - "name": "requestID", - "type": "string" - }, - { - "name": "closedLoopEventClient", - "type": "string" - }, - { - "name": "closedLoopEventStatus", - "type": "string" - }, - { - "name": "target_type", - "type": "string" - }, - { - "name": "target", - "type": "string" - }, - { - "name": "from", - "type": "string" - }, - { - "name": "policyScope", - "type": "string" - }, - { - "name": "policyName", - "type": "string" - }, - { - "name": "policyVersion", - "type": "string" - }, - { - "name": "notification", - "type": "string" - }, - { - "name": "history", - "type": [ - { - "type": "record", - "name": "VCPE_History_Type", - "namespace": "org.onap.policy.apex.onap.vcpe", - "fields": [ - { - "name": "generic_DasH_vnf_DoT_resource_DasH_version", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_name", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_prov_DasH_status", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_is_DasH_closed_DasH_loop_DasH_disabled", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_orchestration_DasH_status", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_type", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_in_DasH_maint", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_service_DasH_id", - "type": "string" - }, - { - "name": "generic_DasH_vnf_DoT_vnf_DasH_id", - "type": "string" - } - ] - } - ] - } - ] -}
\ No newline at end of file |