From 7a8e49a16020f7d04724803659f365236987c5ed Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 19 Dec 2019 21:42:34 -0600 Subject: Update vCPE example to use Avro schemas THis change updates the vCPE example to show how the example can work towards the APPC using Avro schemas only. This means that Policies can be adapted to changes in controller APIs using Avro alone. This example works with the old and new format policy-models. Issue-ID: POLICY-2043 Change-Id: I42ac0eac5203eaa37316cf6c460c67f7e8d6deb2 Signed-off-by: liamfallon --- .../schemas/GuardDecisionAttributesType.avsc | 23 ---- .../schemas/VCPEClosedLoopStatusType.avsc | 128 --------------------- .../definitive/GuardDecisionAttributesType.avsc | 23 ++++ .../definitive/VCPEClosedLoopStatusType.avsc | 128 +++++++++++++++++++++ .../schemas/standalone/ControlLoopStatusType.avsc | 128 +++++++++++++++++++++ .../schemas/standalone/ControllerRequestType.avsc | 90 +++++++++++++++ .../schemas/standalone/ControllerResponseType.avsc | 101 ++++++++++++++++ .../standalone/VirtualControlLoopEventType.avsc | 76 ++++++++++++ .../VirtualControlLoopNotificationType.avsc | 77 +++++++++++++ 9 files changed, 623 insertions(+), 151 deletions(-) delete mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/GuardDecisionAttributesType.avsc delete mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusType.avsc create mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/definitive/GuardDecisionAttributesType.avsc create mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/definitive/VCPEClosedLoopStatusType.avsc create mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControlLoopStatusType.avsc create mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerRequestType.avsc create mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerResponseType.avsc create mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopEventType.avsc create mode 100644 examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopNotificationType.avsc (limited to 'examples/examples-onap-vcpe/src/main/resources/schemas') diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/GuardDecisionAttributesType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/GuardDecisionAttributesType.avsc deleted file mode 100644 index bc25955fa..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/GuardDecisionAttributesType.avsc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "record", - "name": "GuardDecisionAttributes_Type", - "namespace": "org.onap.policy.apex.onap.vcpe", - "fields": [ - { - "name": "actor", - "type": "string" - }, - { - "name": "recipe", - "type": "string" - }, - { - "name": "target", - "type": "string" - }, - { - "name": "clname", - "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 deleted file mode 100644 index b02287d2a..000000000 --- a/examples/examples-onap-vcpe/src/main/resources/schemas/VCPEClosedLoopStatusType.avsc +++ /dev/null @@ -1,128 +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": "genericVnfResourceVersion", - "type": "string" - }, - { - "name": "genericVnfVnfName", - "type": "string" - }, - { - "name": "genericVnfProvStatus", - "type": "string" - }, - { - "name": "genericVnfIsClosedLoopDisabled", - "type": "string" - }, - { - "name": "genericVnfOrchestrationStatus", - "type": "string" - }, - { - "name": "genericVnfVnfType", - "type": "string" - }, - { - "name": "genericVnfInMaint", - "type": "string" - }, - { - "name": "genericVnfServiceId", - "type": "string" - }, - { - "name": "genericVnfVnfId", - "type": "string" - }, - { - "name": "vserverIsClosedLoopDisabled", - "type": "string" - }, - { - "name": "vserverName", - "type": "string" - }, - { - "name": "vserverProvStatus", - "type": "string" - } - ] - } - }, - { - "name": "closedLoopAlarmStart", - "type": "long" - }, - { - "name": "closedLoopAlarmEnd", - "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": "notificationTime", - "type": "long" - }, - { - "name": "message", - "type": "string" - } - ] -} \ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/definitive/GuardDecisionAttributesType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/definitive/GuardDecisionAttributesType.avsc new file mode 100644 index 000000000..bc25955fa --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/definitive/GuardDecisionAttributesType.avsc @@ -0,0 +1,23 @@ +{ + "type": "record", + "name": "GuardDecisionAttributes_Type", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "actor", + "type": "string" + }, + { + "name": "recipe", + "type": "string" + }, + { + "name": "target", + "type": "string" + }, + { + "name": "clname", + "type": "string" + } + ] +} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/definitive/VCPEClosedLoopStatusType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/definitive/VCPEClosedLoopStatusType.avsc new file mode 100644 index 000000000..b02287d2a --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/definitive/VCPEClosedLoopStatusType.avsc @@ -0,0 +1,128 @@ +{ + "type": "record", + "name": "VCPEClosedLoopStatus", + "fields": [ + { + "name": "AAI", + "type": { + "type": "record", + "name": "VCPE_AAI_Type", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "genericVnfResourceVersion", + "type": "string" + }, + { + "name": "genericVnfVnfName", + "type": "string" + }, + { + "name": "genericVnfProvStatus", + "type": "string" + }, + { + "name": "genericVnfIsClosedLoopDisabled", + "type": "string" + }, + { + "name": "genericVnfOrchestrationStatus", + "type": "string" + }, + { + "name": "genericVnfVnfType", + "type": "string" + }, + { + "name": "genericVnfInMaint", + "type": "string" + }, + { + "name": "genericVnfServiceId", + "type": "string" + }, + { + "name": "genericVnfVnfId", + "type": "string" + }, + { + "name": "vserverIsClosedLoopDisabled", + "type": "string" + }, + { + "name": "vserverName", + "type": "string" + }, + { + "name": "vserverProvStatus", + "type": "string" + } + ] + } + }, + { + "name": "closedLoopAlarmStart", + "type": "long" + }, + { + "name": "closedLoopAlarmEnd", + "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": "notificationTime", + "type": "long" + }, + { + "name": "message", + "type": "string" + } + ] +} \ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControlLoopStatusType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControlLoopStatusType.avsc new file mode 100644 index 000000000..b02287d2a --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControlLoopStatusType.avsc @@ -0,0 +1,128 @@ +{ + "type": "record", + "name": "VCPEClosedLoopStatus", + "fields": [ + { + "name": "AAI", + "type": { + "type": "record", + "name": "VCPE_AAI_Type", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "genericVnfResourceVersion", + "type": "string" + }, + { + "name": "genericVnfVnfName", + "type": "string" + }, + { + "name": "genericVnfProvStatus", + "type": "string" + }, + { + "name": "genericVnfIsClosedLoopDisabled", + "type": "string" + }, + { + "name": "genericVnfOrchestrationStatus", + "type": "string" + }, + { + "name": "genericVnfVnfType", + "type": "string" + }, + { + "name": "genericVnfInMaint", + "type": "string" + }, + { + "name": "genericVnfServiceId", + "type": "string" + }, + { + "name": "genericVnfVnfId", + "type": "string" + }, + { + "name": "vserverIsClosedLoopDisabled", + "type": "string" + }, + { + "name": "vserverName", + "type": "string" + }, + { + "name": "vserverProvStatus", + "type": "string" + } + ] + } + }, + { + "name": "closedLoopAlarmStart", + "type": "long" + }, + { + "name": "closedLoopAlarmEnd", + "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": "notificationTime", + "type": "long" + }, + { + "name": "message", + "type": "string" + } + ] +} \ No newline at end of file diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerRequestType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerRequestType.avsc new file mode 100644 index 000000000..41bbca4cb --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerRequestType.avsc @@ -0,0 +1,90 @@ +{ + "type": "record", + "name": "VCPEClosedLoopStatus", + "fields": [ + { + "name": "version", + "type": "string" + }, + { + "name": "rpc_DasH_name", + "type": "string" + }, + { + "name": "correlation_DasH_id", + "type": "string" + }, + { + "name": "type", + "type": "string" + }, + { + "name": "body", + "type": { + "type": "record", + "name": "Controller_Body_Type", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "input", + "type": { + "type": "record", + "name": "Controller_Body_Type_Input", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "action", + "type": "string" + }, + { + "name": "action_DasH_identifiers", + "type": { + "type": "map", + "values": "string" + } + }, + { + "name": "common_DasH_header", + "type": { + "type": "record", + "name": "Controller_Body_Type_Common_Header", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "timestamp", + "type": "long" + }, + { + "name": "api_DasH_ver", + "type": "string" + }, + { + "name": "originator_DasH_id", + "type": "string" + }, + { + "name": "request_DasH_id", + "type": "string" + }, + { + "name": "sub_DasH_request_DasH_id", + "type": "string" + }, + { + "name": "flags", + "type": { + "type": "map", + "values": "string" + } + } + ] + } + } + ] + } + } + ] + } + } + ] +} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerResponseType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerResponseType.avsc new file mode 100644 index 000000000..336c16143 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/ControllerResponseType.avsc @@ -0,0 +1,101 @@ +{ + "type": "record", + "name": "VCPEClosedLoopStatus", + "fields": [ + { + "name": "version", + "type": "string" + }, + { + "name": "rpc_DasH_name", + "type": "string" + }, + { + "name": "correlation_DasH_id", + "type": "string" + }, + { + "name": "type", + "type": "string" + }, + { + "name": "body", + "type": { + "type": "record", + "name": "Controller_Body_Type", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "output", + "type": { + "type": "record", + "name": "Controller_Body_Type_Output", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "payload", + "type": "string" + }, + { + "name": "common_DasH_header", + "type": { + "type": "record", + "name": "Controller_Body_Type_Common_Header", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "timestamp", + "type": "long" + }, + { + "name": "api_DasH_ver", + "type": "string" + }, + { + "name": "originator_DasH_id", + "type": "string" + }, + { + "name": "request_DasH_id", + "type": "string" + }, + { + "name": "sub_DasH_request_DasH_id", + "type": "string" + }, + { + "name": "flags", + "type": { + "type": "map", + "values": "string" + } + } + ] + } + }, + { + "name": "status", + "type": { + "type": "record", + "name": "Controller_Body_Type_Output_Status", + "namespace": "org.onap.policy.apex.onap.vcpe", + "fields": [ + { + "name": "code", + "type": "int" + }, + { + "name": "message", + "type": "string" + } + ] + } + } + ] + } + } + ] + } + } + ] +} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopEventType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopEventType.avsc new file mode 100644 index 000000000..e0e076483 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopEventType.avsc @@ -0,0 +1,76 @@ +{ + "type": "record", + "name": "VirtualControlLoopEvent", + "fields": [ + { + "name": "requestID", + "type": "string" + }, + { + "name": "target_type", + "type": "string" + }, + { + "name": "closedLoopControlName", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "closedLoopEventClient", + "type": "string" + }, + { + "name": "target", + "type": "string" + }, + { + "name": "from", + "type": "string" + }, + { + "name": "policyScope", + "type": "string" + }, + { + "name": "policyName", + "type": "string" + }, + { + "name": "policyVersion", + "type": "string" + }, + { + "name": "closedLoopEventStatus", + "type": "string" + }, + { + "name": "additionalEventParams", + "type": { + "type": "map", + "values": "string" + } + }, + { + "name": "AAI", + "type": { + "type": "map", + "values": "string" + } + }, + { + "name": "payload", + "type": "string" + }, + { + "name": "closedLoopAlarmStart", + "type": "long" + }, + { + "name": "closedLoopAlarmEnd", + "type": "long" + } + ] +} diff --git a/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopNotificationType.avsc b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopNotificationType.avsc new file mode 100644 index 000000000..0b7a80cb5 --- /dev/null +++ b/examples/examples-onap-vcpe/src/main/resources/schemas/standalone/VirtualControlLoopNotificationType.avsc @@ -0,0 +1,77 @@ +{ + "type": "record", + "name": "VirtualControlLoopNotification", + "fields": [ + { + "name": "closedLoopControlName", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "requestID", + "type": "string" + }, + { + "name": "closedLoopEventClient", + "type": "string" + }, + { + "name": "targetType", + "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": "message", + "type": "string" + }, + { + "name": "notificationTime", + "type": "long" + }, + { + "name": "opsClTimer", + "type": "int" + }, + { + "name": "AAI", + "type": { + "type": "map", + "values": "string" + } + }, + { + "name": "closedLoopAlarmStart", + "type": "long" + }, + { + "name": "closedLoopAlarmEnd", + "type": "long" + } + ] +} -- cgit 1.2.3-korg