From 84e8a0ac2dccaf42aeba6eea111ea5b2fbe1eaa4 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Mon, 30 Jan 2023 10:42:20 +0000 Subject: [PATCH] Add schema files Signed-off-by: Andrea Frittoli --- schemas/incidentdetected.json | 129 ++++++++++++++++++++++++++++++++++ schemas/incidentresolved.json | 129 ++++++++++++++++++++++++++++++++++ 2 files changed, 258 insertions(+) create mode 100644 schemas/incidentdetected.json create mode 100644 schemas/incidentresolved.json diff --git a/schemas/incidentdetected.json b/schemas/incidentdetected.json new file mode 100644 index 00000000..ea5623db --- /dev/null +++ b/schemas/incidentdetected.json @@ -0,0 +1,129 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cdevents.dev/0.2.0-draft/schema/incident-detected-event", + "properties": { + "context": { + "properties": { + "version": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1 + }, + "type": { + "type": "string", + "enum": [ + "dev.cdevents.incident.detected.0.1.0-draft" + ], + "default": "dev.cdevents.incident.detected.0.1.0-draft" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "version", + "id", + "source", + "type", + "timestamp" + ] + }, + "subject": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string" + }, + "type": { + "type": "string", + "minLength": 1 + }, + "content": { + "properties": { + "description": { + "type": "string" + }, + "environment": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "service": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "artifactId": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "type", + "content" + ] + }, + "customData": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string", + "contentEncoding": "base64" + } + ] + }, + "customDataContentType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "context", + "subject" + ] +} \ No newline at end of file diff --git a/schemas/incidentresolved.json b/schemas/incidentresolved.json new file mode 100644 index 00000000..f9f91651 --- /dev/null +++ b/schemas/incidentresolved.json @@ -0,0 +1,129 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cdevents.dev/0.2.0-draft/schema/incident-resolved-event", + "properties": { + "context": { + "properties": { + "version": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1 + }, + "type": { + "type": "string", + "enum": [ + "dev.cdevents.incident.resolved.0.1.0-draft" + ], + "default": "dev.cdevents.incident.resolved.0.1.0-draft" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "version", + "id", + "source", + "type", + "timestamp" + ] + }, + "subject": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string" + }, + "type": { + "type": "string", + "minLength": 1 + }, + "content": { + "properties": { + "description": { + "type": "string" + }, + "environment": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "service": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "artifactId": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false, + "type": "object" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "type", + "content" + ] + }, + "customData": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string", + "contentEncoding": "base64" + } + ] + }, + "customDataContentType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "context", + "subject" + ] +} \ No newline at end of file