...
Priyank Maheshwari We need to revisit this schema and include the cloud events fields. ( At the moment this doesnt doesn't have proper fields )
Expand |
---|
title | AVC Subscription Event |
---|
|
Subscription Event Object Field | Type | Description | Kafka Header | Event Payload Field | Notes | CloudEvents Mapping |
---|
version | string | The event type version |
|
| ekiemcc : What is this version? This should be covered in the header now? |
| eventType | string | The event type |
|
| ekiemcc : This is now covered by the header? Is this needed any longer in the body? Enum: ["CREATE"] | standard ( type ) | event | Event | The payload for an event |
|
| Defined by event object below | standard ( data ) |
Event Object (cps:org.onap.cps.ncmp.events:avc-subscription-event:v1)Field | Type | Description | Kafka Header | Event Payload Field | Notes |
---|
subscription | Subscription | The subscription details |
| x | Defined by subscription object below | dataType | DataType | The datatype content |
| x | Defined by dataType object below | predicates | Predicates | Additional values to be added into the subscription |
| x | Defined by predicates object below |
Type: SubscriptionField | Type | Description | Kafka Header | Event Payload Field | Notes |
---|
clientID | string | The client ID |
| x |
| name | string | The name of the subscription |
| x |
| isTagged | boolean | optional parameter, default is false |
| x | default: false |
Type: DataTypeField | Type | Description | Kafka Header | Event Payload Field | Notes |
---|
dataspace | string | The dataspace name |
| x |
| dataCategory | string | The category type of the data |
| x |
| dataProvider | string | The provider name of the data |
| x |
| schemaName | string | The name of the schema |
| x |
| schemaVersion | string | The version of the schema |
| x |
|
Type: PredicatesField | Type | Description | Kafka Header | Event Payload Field | Notes |
---|
targets | array | CM Handles to be targeted by the subscription |
| x |
| datastore | string | datastore which is to be used by the subscription |
| x |
| xpath-filter | string | filter to be applied to the CM Handles through this event |
| x |
|
|
...
Expand |
---|
title | DMI Async Batch Response Event |
---|
|
BatchResponseEvent Object Field | Type | Description | Kafka Header | Event Payload Field | Notes | CloudEvents Mapping |
---|
eventID | string | The unique id identifying the event generated by DMI | x |
|
| standard ( id ) | eventCorrelationId | string | The request id passed by NCMP | x |
eventTarget |
|
| extensions (correlationid) | eventTarget | string | The destination topic of the client | x |
|
| extensions ( target ) | eventTime | string | The timestamp when original event occurred | x |
|
| standard ( time) | eventType | string | The type of the event | x |
|
| standard ( type ) | eventSchema | string | The event schema for async request response events | x |
|
| standard ( dataschema ) | eventSchemaVersion | string | The event schema version for async request response events | x |
|
| N/A included in 'dataschema' | event | Event | The payload of an event |
| x | java object not yet defined by schema, see issue #2 | standard ( data ) |
Type: Event (cps:org.onap.cps.ncmp.event.async:dmi-async-batch-response-event-schema:v1) Field | Type | Description | Kafka Header | Event Payload Field | Notes |
---|
No Properties defined (Entire event treated as single object) |
|
...
Cloudy Event Library
Introduction...
CloudEvents is a specification for describing event data in common formats to provide interoperability across services, platforms and systems.
- These cloud events will be applied to all the internal and external events we have in CPS , NCMP and DMI Plugin.
- Cloud events will be taking care of the fields which are part of kafka headers or part of the actual payload ( fields other than "data" are sent as kafka headers )
- These CNCF cloud events will be applied to all the events listed in above sections ( LCM , DMI Data AVC etc. )
link to library
...
Library
https://github.com/cloudevents/spec
https://github.com/cloudevents/sdk-java
Examples : https://github.com/cloudevents/sdk-java/tree/main/examples/kafka/src/main/java/io/cloudevents/examples/kafka
Before | After | CloudeEvent builder method | Example Value | Notes |
---|
eventId | id | .withId() |
| Mandatory |
eventSource | source | .withSource() |
| Mandatory |
N/A | specversion (default 1.0) | .v1() | 1.0 | Mandatory - This is the version of the cloud events |
eventType | type | .withType() |
| Mandatory |
eventTime | time | .withTime() |
| Optional |
eventSchema | dataschema | .withDataSchema() |
| Optional includes the version of the schema |
| datacontenttype | withDataContentType() | application/json | Optional |
eventCorrelationId | correlationid | .withExtension() |
| Optional This will be part of the extensions field in the cloud events and all the restrictions of the attribute field naming applies to it. i.e these fields will be in the small case. This is marked as optional as it applies to the event which has this field. |
event | data | .withData(json TBC) |
| Mandatory actual event/payload now would be under "data" field. |
...