Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titlecps-data-updated-event-schema.json
linenumberstrue
{

  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "urn:cps:org.onap.cps:data-updated-event-schema:1.0.0-SNAPSHOT",

  "$ref": "#/definitions/CpsDataUpdatedEvent",

  "definitions": {

    "CpsDataUpdatedEvent": {
      "title": "CpsDataUpdatedEvent",
      "description": "A CPS data updated event.",
      "type": "object",
      "properties": {
        "schema": {
          "const": "urn:cps:org.onap.cps:data-updated-event-schema:1.0.0-SNAPSHOT",
          "description": "The schema, including its version, that the event adheres to."
        },
        "id": {
          "type": "string",
          "description": "The unique id identifying the event for the specified source. ProducersProducer must ensure that source + id is unique for each distinct event."
        },
        "source": {
          "type": "string",
          "format": "uri",
          "description": "The source of the event. ProducersProducer must ensure that source + id is unique for each distinct event."
        },
        "type": {
          "type": "string",
          "description": "The type of the event."
        },
        "content": {
          "$ref": "#/definitions/Content"
        }
      },
      "required": [
        "schema",
        "id",
        "source",
        "type",
        "content"
      ],
      "additionalProperties": false
    },

    "Content": {
      "title": "Content",
      "description": "The event content.",
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string"
        },
        "coreReferences": {
          "$ref": "#/definitions/CoreReferenceList"
        },
        "data": {
          "$ref": "#/definitions/Data"
        }
      },
      "additionalProperties": false
    },

    "CoreReferenceList": {
      "title": "CoreReferenceList",
      "description": "All CPS Core references for data.",
      "type": "object",
      "properties": {
        "dataspace": {
          "$ref": "#/definitions/CoreReference"
        },
        "schemaSet": {
          "$ref": "#/definitions/CoreReference"
        },
        "anchor": {
          "$ref": "#/definitions/CoreReference"
        }
      },
      "additionalProperties": false
    },

    "CoreReference": {
      "title": "CoreReference",
      "description": "A CPS Core reference for data.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique id identifying the reference."
        },
        "name": {
          "type": "string",
          "description": "The name of the reference."
        }
      },
      "additionalProperties": false
    },

    "Data": {
      "title": "Data",
      "description": "The json data content payload",
      "type": "object"
    }

  }

}

Following is a CPS Data Updated Event example:

Code Block
titlecps-data-updated-event.json
linenumberstrue
{
  "schema": "urn:cps:org.onap.cps:data-updated-event-schema:1.0.0-SNAPSHOT",
  "id": "38aa6cc6-264d-4ede-b534-18f5c1f403ea",
  "source": "urn:cps:org.onap.cps",
  "type": "org.onap.cps.data-updated-event",
  "content": {
    "timestamp": "2020-12-01T00:00:00.000+0000",
    "coreReferences": {
      "dataspace": {
        "id": "123",
        "name": "my-dataspace"
      },
      "schemaSet": {
        "id": "456",
        "name": "my-schema-set"
      },
      "anchor": {
        "id": "789",
        "name": "my-anchor"
      }
    },
    "data": {
      "interface": {
        "name": "itf-1",
        "status": "up"
      }
    }
  }
}