diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2022-05-25 12:25:48 +0100 |
---|---|---|
committer | mpriyank <priyank.maheshwari@est.tech> | 2022-06-01 15:56:31 +0100 |
commit | e9d2f4fa53927711d9fb058ebf815d8db2d551cc (patch) | |
tree | a497cf12ab50b4c0df80f155f8c43e3c76ae82d4 | |
parent | 85d4473a5994e2111bb481a641e49badb8602fb0 (diff) |
NcmpEvent creation for ModuleSync
- NcmpEvent schema creation which will be published when module sync is
completed
- Added cmHandleId in the event payload and made eventCorrelationId as
optional
- Upcoming : NcmpEvent publisher code and mapping of the events
Issue-ID: CPS-1036
Change-Id: I7731e6e6a4a8f718967ce68cc6ae0e411eb8c12b
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
-rw-r--r-- | cps-bom/pom.xml | 2 | ||||
-rw-r--r-- | cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json | 87 |
2 files changed, 88 insertions, 1 deletions
diff --git a/cps-bom/pom.xml b/cps-bom/pom.xml index f2fcb6ee0e..9b864b07fe 100644 --- a/cps-bom/pom.xml +++ b/cps-bom/pom.xml @@ -2,7 +2,7 @@ <!-- ============LICENSE_START======================================================= Copyright (C) 2020 Pantheon.tech - Modifications Copyright (C) 2021 - 2022 Nordix Foundation + Modifications Copyright (C) 2021-2022 Nordix Foundation Modifications Copyright (C) 2021 Bell Canada. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json new file mode 100644 index 0000000000..84fc12edbd --- /dev/null +++ b/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json @@ -0,0 +1,87 @@ +{ + + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "urn:cps:org.onap.ncmp.cmhandle.lcm-event:v1", + + "$ref": "#/definitions/NcmpEvent", + + "definitions": { + + "NcmpEvent": { + "description": "The payload for NCMP event.", + "type": "object", + "javaType" : "org.onap.ncmp.cmhandle.lcm.event.NcmpEvent", + "properties": { + "eventId": { + "description": "The unique id identifying the event for the specified source.", + "type": "string" + }, + "eventCorrelationId": { + "description": "The id identifying the event for the specified source.", + "type": "string" + }, + "eventTime": { + "description": "The timestamp when the data has been observed.", + "type": "string" + }, + "eventSource": { + "description": "The source of the event.", + "type": "string", + "format": "uri" + }, + "eventType": { + "description": "The type of the event.", + "type": "string" + }, + "eventSchema": { + "description": "The schema, including its version, that this event adheres to.", + "type": "string", + "format": "uri" + }, + "event": { + "$ref": "#/definitions/Event" + } + }, + "required": [ + "eventId", + "eventTime", + "eventSource", + "eventType", + "eventSchema", + "event" + ], + "additionalProperties": false + }, + + "Event": { + "description": "The Payload of an event.", + "type": "object", + "properties": { + "cmHandleId": { + "description": "cmHandle id", + "type": "string" + }, + "operation": { + "description": "The name of the Operation that triggered this event.", + "type": "string", + "enum": ["CREATE", "UPDATE", "DELETE"] + }, + "cmhandle-state": { + "description": "State of cmHandle.", + "type": "string", + "enum": ["ADVISED", "READY", "LOCKED"] + }, + "cmhandle-properties": { + "description": "cmHandle properties as json object.", + "type": "object", + "existingJavaType": "java.util.List<java.util.Map<String,String>>", + "additionalProperties": false + } + }, + "required": [ + "operation" + ], + "additionalProperties": false + } + } +} |