From 3032261ec743bde6eb136cd2030774c3dc358fa9 Mon Sep 17 00:00:00 2001 From: mpriyank Date: Fri, 16 Jun 2023 15:55:52 +0100 Subject: DMI Data AVC to cloud events - DMI Data AVC to be consumed as CloudEvents now - Removed the schema header as it is taken care by cloudevent headers - Implemented naming and packaging comments on the schema - Test cases refactoring Issue-ID: CPS-1719 Change-Id: I9864f90446720fe903fb3c1502d86035d886751d Signed-off-by: mpriyank --- .../schemas/dmidataavc/avc-event-header-v1.json | 50 ---------- .../schemas/dmidataavc/avc-event-schema-1.0.0.json | 106 ++++++++++++++++++++ .../schemas/dmidataavc/avc-event-schema-v1.json | 107 --------------------- 3 files changed, 106 insertions(+), 157 deletions(-) delete mode 100644 cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-header-v1.json create mode 100644 cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-1.0.0.json delete mode 100644 cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-v1.json (limited to 'cps-ncmp-events/src/main') diff --git a/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-header-v1.json b/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-header-v1.json deleted file mode 100644 index ea1e617c82..0000000000 --- a/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-header-v1.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "urn:cps:org.onap.cps.ncmp.events:avc-event-header-schema:v1", - "$ref": "#/definitions/AvcEventHeader", - "definitions": { - "AvcEventHeader": { - "description": "The header for AVC event.", - "type": "object", - "javaType" : "org.onap.cps.ncmp.events.avc.v1.AvcEventHeader", - "properties": { - "eventId": { - "description": "The unique id identifying the event generated by DMI for this AVC event.", - "type": "string" - }, - "eventCorrelationId": { - "description": "The request id passed by NCMP for this AVC event.", - "type": "string" - }, - "eventTime": { - "description": "The time of the AVC event. The expected format is 'yyyy-MM-dd'T'HH:mm:ss.SSSZ'.", - "type": "string" - }, - "eventSource": { - "description": "The source of the AVC event.", - "type": "string" - }, - "eventType": { - "description": "The type of the AVC event.", - "type": "string" - }, - "eventSchema": { - "description": "The event schema for AVC events.", - "type": "string" - }, - "eventSchemaVersion": { - "description": "The event schema version for AVC events.", - "type": "string" - } - }, - "required": [ - "eventId", - "eventCorrelationId", - "eventType", - "eventSchema", - "eventSchemaVersion" - ], - "additionalProperties": false - } - } -} \ No newline at end of file diff --git a/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-1.0.0.json b/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-1.0.0.json new file mode 100644 index 0000000000..a5bed939bf --- /dev/null +++ b/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-1.0.0.json @@ -0,0 +1,106 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "urn:cps:org.onap.cps.ncmp.events:avc-event-schema:1.0.0", + "$ref": "#/definitions/AvcEvent", + "definitions": { + "Edit": { + "additionalProperties": false, + "properties": { + "edit-id": { + "type": "string" + }, + "operation": { + "type": "string" + }, + "target": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/Value" + } + }, + "required": [ + "edit-id", + "operation", + "target" + ] + }, + "Value": { + "type": "object", + "additionalProperties": false, + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "object", + "existingJavaType": "java.util.Map", + "additionalProperties": false, + "properties": { + "isHoAllowed": { + "type": "boolean" + } + } + } + } + } + }, + "AvcEvent": { + "description": "The payload for AVC event.", + "type": "object", + "javaType": "org.onap.cps.ncmp.events.avc1_0_0.AvcEvent", + "properties": { + "data": { + "description": "The AVC event content compliant with RFC8641 format", + "type": "object", + "additionalProperties": false, + "properties": { + "push-change-update": { + "type": "object", + "additionalProperties": false, + "properties": { + "datastore-changes": { + "type": "object", + "additionalProperties": false, + "properties": { + "ietf-yang-patch:yang-patch": { + "type": "object", + "additionalProperties": false, + "properties": { + "patch-id": { + "type": "string" + }, + "edit": { + "type": "array", + "items": { + "$ref": "#/definitions/Edit" + } + } + }, + "required": [ + "patch-id", + "edit" + ] + } + }, + "required": [ + "ietf-yang-patch:yang-patch" + ] + } + }, + "required": [ + "datastore-changes" + ] + } + }, + "required": [ + "push-change-update" + ] + } + }, + "required": [ + "data" + ], + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-v1.json deleted file mode 100644 index 7e975c9b93..0000000000 --- a/cps-ncmp-events/src/main/resources/schemas/dmidataavc/avc-event-schema-v1.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "urn:cps:org.onap.cps.ncmp.events:avc-event-schema:v1", - "$ref": "#/definitions/AvcEvent", - "definitions": { - "Edit": { - "javaType": "org.onap.cps.ncmp.events.avc.v1.Edit", - "additionalProperties": false, - "properties": { - "edit-id": { - "type": "string" - }, - "operation": { - "type": "string" - }, - "target": { - "type": "string" - }, - "value": { - "$ref": "#/definitions/Value" - } - }, - "required": [ - "edit-id", - "operation", - "target" - ] - }, - "Value": { - "type": "object", - "additionalProperties": false, - "properties": { - "attributes": { - "type": "array", - "items": { - "type": "object", - "existingJavaType": "java.util.Map", - "additionalProperties": false, - "properties": { - "isHoAllowed": { - "type": "boolean" - } - } - } - } - } - }, - "AvcEvent": { - "description": "The payload for AVC event.", - "type": "object", - "javaType": "org.onap.cps.ncmp.events.avc.v1.AvcEvent", - "properties": { - "event": { - "description": "The AVC event content compliant with RFC8641 format", - "type": "object", - "additionalProperties": false, - "properties": { - "push-change-update": { - "type": "object", - "additionalProperties": false, - "properties": { - "datastore-changes": { - "type": "object", - "additionalProperties": false, - "properties": { - "ietf-yang-patch:yang-patch": { - "type": "object", - "additionalProperties": false, - "properties": { - "patch-id": { - "type": "string" - }, - "edit": { - "type": "array", - "items": { - "$ref": "#/definitions/Edit" - } - } - }, - "required": [ - "patch-id", - "edit" - ] - } - }, - "required": [ - "ietf-yang-patch:yang-patch" - ] - } - }, - "required": [ - "datastore-changes" - ] - } - }, - "required": [ - "push-change-update" - ] - } - }, - "required": [ - "event" - ], - "additionalProperties": false - } - } -} \ No newline at end of file -- cgit 1.2.3-korg