diff --git a/.spellcheck-en-custom.txt b/.spellcheck-en-custom.txt index 4bb487d..0c64237 100644 --- a/.spellcheck-en-custom.txt +++ b/.spellcheck-en-custom.txt @@ -34,6 +34,9 @@ dataschema deterministically emmitted english +enqueue +enqueued +enqueueing eventdata fas href @@ -55,6 +58,7 @@ pre rolledback runtime sbom +scheduledexecution schemaUri schemas schemauri diff --git a/conformance/scheduledexecution_canceled.json b/conformance/scheduledexecution_canceled.json new file mode 100644 index 0000000..ff0ac20 --- /dev/null +++ b/conformance/scheduledexecution_canceled.json @@ -0,0 +1,65 @@ +{ + "context": { + "specversion": "0.6.0-draft", + "id": "271069a8-fc18-44f1-b38f-9d70a1695819", + "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", + "source": "/scheduler/prod", + "type": "dev.cdevents.scheduledexecution.canceled.0.1.0-draft", + "timestamp": "2026-08-12T02:00:03Z", + "schemaUri": "https://myorg.com/schema/custom", + "links": [ + { + "linkType": "RELATION", + "linkKind": "TRIGGER", + "target": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "PATH", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "END", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + } + ] + }, + "subject": { + "id": "sched-deploy-orders-9281", + "source": "/scheduler/prod", + "content": { + "target": { + "id": "orders-svc", + "source": "/prod/deploys", + "type": "deployment" + }, + "scheduledTime": "2026-08-12T02:00:00Z", + "author": { + "id": "alice", + "source": "/scheduler/prod" + }, + "changeWindow": { + "id": "win-maint-0812", + "source": "/scheduler/prod" + }, + "reason": "Superseded by an out-of-band release" + } + } +} diff --git a/conformance/scheduledexecution_created.json b/conformance/scheduledexecution_created.json new file mode 100644 index 0000000..a04d193 --- /dev/null +++ b/conformance/scheduledexecution_created.json @@ -0,0 +1,64 @@ +{ + "context": { + "specversion": "0.6.0-draft", + "id": "271069a8-fc18-44f1-b38f-9d70a1695819", + "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", + "source": "/scheduler/prod", + "type": "dev.cdevents.scheduledexecution.created.0.1.0-draft", + "timestamp": "2026-08-12T02:00:03Z", + "schemaUri": "https://myorg.com/schema/custom", + "links": [ + { + "linkType": "RELATION", + "linkKind": "TRIGGER", + "target": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "PATH", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "END", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + } + ] + }, + "subject": { + "id": "sched-deploy-orders-9281", + "source": "/scheduler/prod", + "content": { + "target": { + "id": "orders-svc", + "source": "/prod/deploys", + "type": "deployment" + }, + "scheduledTime": "2026-08-12T02:00:00Z", + "author": { + "id": "alice", + "source": "/scheduler/prod" + }, + "changeWindow": { + "id": "win-maint-0812", + "source": "/scheduler/prod" + } + } + } +} diff --git a/conformance/scheduledexecution_missed.json b/conformance/scheduledexecution_missed.json new file mode 100644 index 0000000..2a71cb7 --- /dev/null +++ b/conformance/scheduledexecution_missed.json @@ -0,0 +1,61 @@ +{ + "context": { + "specversion": "0.6.0-draft", + "id": "271069a8-fc18-44f1-b38f-9d70a1695819", + "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", + "source": "/scheduler/prod", + "type": "dev.cdevents.scheduledexecution.missed.0.1.0-draft", + "timestamp": "2026-08-12T02:00:03Z", + "schemaUri": "https://myorg.com/schema/custom", + "links": [ + { + "linkType": "RELATION", + "linkKind": "TRIGGER", + "target": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "PATH", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "END", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + } + ] + }, + "subject": { + "id": "sched-deploy-orders-9281", + "source": "/scheduler/prod", + "content": { + "target": { + "id": "orders-svc", + "source": "/prod/deploys", + "type": "deployment" + }, + "scheduledTime": "2026-08-12T02:00:00Z", + "changeWindow": { + "id": "win-maint-0812", + "source": "/scheduler/prod" + }, + "reason": "Scheduler backlog exceeded the firing window" + } + } +} diff --git a/conformance/scheduledexecution_modified.json b/conformance/scheduledexecution_modified.json new file mode 100644 index 0000000..1645bd8 --- /dev/null +++ b/conformance/scheduledexecution_modified.json @@ -0,0 +1,64 @@ +{ + "context": { + "specversion": "0.6.0-draft", + "id": "271069a8-fc18-44f1-b38f-9d70a1695819", + "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", + "source": "/scheduler/prod", + "type": "dev.cdevents.scheduledexecution.modified.0.1.0-draft", + "timestamp": "2026-08-12T02:00:03Z", + "schemaUri": "https://myorg.com/schema/custom", + "links": [ + { + "linkType": "RELATION", + "linkKind": "TRIGGER", + "target": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "PATH", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "END", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + } + ] + }, + "subject": { + "id": "sched-deploy-orders-9281", + "source": "/scheduler/prod", + "content": { + "target": { + "id": "orders-svc", + "source": "/prod/deploys", + "type": "deployment" + }, + "scheduledTime": "2026-08-12T02:00:00Z", + "author": { + "id": "alice", + "source": "/scheduler/prod" + }, + "changeWindow": { + "id": "win-maint-0812", + "source": "/scheduler/prod" + } + } + } +} diff --git a/conformance/scheduledexecution_triggered.json b/conformance/scheduledexecution_triggered.json new file mode 100644 index 0000000..eb5d8c5 --- /dev/null +++ b/conformance/scheduledexecution_triggered.json @@ -0,0 +1,67 @@ +{ + "context": { + "specversion": "0.6.0-draft", + "id": "271069a8-fc18-44f1-b38f-9d70a1695819", + "chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b", + "source": "/scheduler/prod", + "type": "dev.cdevents.scheduledexecution.triggered.0.1.0-draft", + "timestamp": "2026-08-12T02:00:03Z", + "schemaUri": "https://myorg.com/schema/custom", + "links": [ + { + "linkType": "RELATION", + "linkKind": "TRIGGER", + "target": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "PATH", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + }, + { + "linkType": "END", + "from": { + "contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce" + }, + "tags": { + "foo1": "bar", + "foo2": "bar" + } + } + ] + }, + "subject": { + "id": "sched-deploy-orders-9281", + "source": "/scheduler/prod", + "content": { + "target": { + "id": "orders-svc", + "source": "/prod/deploys", + "type": "deployment" + }, + "scheduledTime": "2026-08-12T02:00:00Z", + "trigger": { + "type": "schedule" + }, + "changeWindow": { + "id": "win-maint-0812", + "source": "/scheduler/prod" + }, + "triggeredExecution": { + "id": "deploy-44119", + "source": "/prod/deploys" + } + } + } +} diff --git a/core.md b/core.md index 03ef83d..b28fc59 100644 --- a/core.md +++ b/core.md @@ -18,10 +18,13 @@ Core events are at the lower level of abstraction in the dictionary: they descri In the context of Continuous Delivery, a *pipeline* is the definition of a set of *tasks* that needs to be performed to build, test, package, release and deploy software artifacts. The definition of *pipelines* and *tasks* is an authoring process, and has no event associated to it. CDEvents identifies two [*subjects*](spec.md#subject), [`pipelineRun`](#pipelinerun) and [`taskRun`](#taskrun), which are the runtime counterparts of *pipelines* and *tasks*. +Executions are not always enqueued as soon as they are requested. A [`scheduledExecution`](#scheduledexecution) is the registered intent to enqueue an execution at a future time, and covers the lifecycle before enqueueing. + | Subject | Description | Predicates | |---------|-------------|------------| | [`pipelineRun`](#pipelinerun) | An instance of a *pipeline* | [`queued`](#pipelinerun-queued), [`started`](#pipelinerun-started), [`finished`](#pipelinerun-finished)| | [`taskRun`](#taskrun) | An instance of a *task* | [`queued`](#taskrun-queued), [`started`](#taskrun-started), [`finished`](#taskrun-finished)| +| [`scheduledExecution`](#scheduledexecution) | A registered intent to enqueue an execution at a future time | [`created`](#scheduledexecution-created), [`modified`](#scheduledexecution-modified), [`canceled`](#scheduledexecution-canceled), [`triggered`](#scheduledexecution-triggered), [`missed`](#scheduledexecution-missed)| ### `pipelineRun` @@ -58,6 +61,30 @@ associated, in which case it is acceptable to generate only taskRun events. | url | `URI` | url to the `taskRun` | `https://dashboard.org/namespace/taskrun-1234`, `https://api.cdsystem.com/namespace/taskrun-1234` | | errors | `String` | In case of error, canceled, or failed pipeline , provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`| +### `scheduledExecution` + +A [`scheduledExecution`](#scheduledexecution) is a registered intent to enqueue a target execution at a future time. It is the registration, not the execution: it covers the lifecycle *before* enqueueing, during which the schedule may be amended, and then either fires, is canceled, or does not fire at all. + +The existing `queued` predicates represent work already accepted into an execution queue. A schedule registered today to fire next week is not visible in the event stream until it materializes as a queued execution, by which point the registration, any amendment to it, and any cancellation have left no trace. Making the schedule a subject records that history as it happens. + +When a `scheduledExecution` fires, it produces the target's own `queued` event. Whether the resulting execution succeeds is reported by the target's events, not by this subject. + +Two times are relevant and both are carried: `scheduledTime` is the time the execution was registered to fire, while [`timestamp`](spec.md#timestamp) in the context is the time the occurrence happened. On [`triggered`](#scheduledexecution-triggered), the difference between them records whether the firing was on time. + +The producing scheduler or controller is identified by [`source`](spec.md#source-context) in the context. `author` records the actor that the producing system attributes the action to; CDEvents records attributed identity, and proving it is the producer's responsibility. + +| Field | Type | Description | Examples | +|-------|------|-------------|----------| +| id | `String` | See [id](spec.md#id-subject)| `sched-deploy-orders-9281` | +| source | `URI-Reference` | See [source](spec.md#source-subject) | | +| target | `Object` | The execution to be enqueued. `type` names what is scheduled. | `{"id": "orders-svc", "source": "/prod/deploys", "type": "deployment"}` | +| scheduledTime | `Timestamp` | The time the execution is registered to fire | `2026-08-12T02:00:00Z` | +| author | `Object` | The actor the producer attributes the action to | `{"id": "alice", "source": "/scheduler/prod"}` | +| trigger | `Object` ([`trigger`](testing-events.md#trigger)) | What caused the firing | `{"type": "schedule"}`, `{"type": "manual"}` | +| changeWindow | `Object` | A change window this execution is bound to, if any | `{"id": "win-maint-0812", "source": "/scheduler/prod"}` | +| triggeredExecution | `Object` | The execution that was enqueued | `{"id": "deploy-44119", "source": "/prod/deploys"}` | +| reason | `String` | Detail for a cancellation or a missed firing | `Superseded by an out-of-band release` | + ## Events ### [`pipelineRun queued`](conformance/pipelinerun_queued.json) @@ -162,3 +189,95 @@ A taskRun has finished, successfully or not. | url | `URI` | url to the `taskRun` | `https://dashboard.org/namespace/taskrun-1234`, `https://api.cdsystem.com/namespace/taskrun-1234` | | | outcome | `String (enum)` | outcome of a finished `taskRun` | `success`, `failure`, `cancel`, or `error` | `success`, `failure`, `cancel`, `error` | | errors | `String` | In case of error, canceled, or failed pipeline , provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`| | + +### [`scheduledExecution Created`](conformance/scheduledexecution_created.json) + +A scheduled execution has been registered to fire at a future time. + +- Event Type: __`dev.cdevents.scheduledexecution.created.0.1.0-draft`__ +- Predicate: created +- Subject: [`scheduledExecution`](#scheduledexecution) + +| Field | Type | Description | Examples | Required | +|-------|------|-------------|----------|----------------------------| +| id | `String` | See [id](spec.md#id-subject)| `sched-deploy-orders-9281` | ✅ | +| source | `URI-Reference` | [source](spec.md#source) from the context | | | +| target | `Object` | The execution to be enqueued | `{"id": "orders-svc", "source": "/prod/deploys", "type": "deployment"}` | ✅ | +| scheduledTime | `Timestamp` | The time the execution is registered to fire | `2026-08-12T02:00:00Z` | ✅ | +| author | `Object` | The actor the producer attributes the registration to | `{"id": "alice", "source": "/scheduler/prod"}` | ✅ | +| changeWindow | `Object` | A change window this execution is bound to, if any | `{"id": "win-maint-0812", "source": "/scheduler/prod"}` | | + +### [`scheduledExecution Modified`](conformance/scheduledexecution_modified.json) + +A registered scheduled execution has been changed. The subject retains its identity across the change. + +- Event Type: __`dev.cdevents.scheduledexecution.modified.0.1.0-draft`__ +- Predicate: modified +- Subject: [`scheduledExecution`](#scheduledexecution) + +| Field | Type | Description | Examples | Required | +|-------|------|-------------|----------|----------------------------| +| id | `String` | See [id](spec.md#id-subject)| `sched-deploy-orders-9281` | ✅ | +| source | `URI-Reference` | [source](spec.md#source) from the context | | | +| target | `Object` | The execution to be enqueued, as it stands after the change | `{"id": "orders-svc", "source": "/prod/deploys", "type": "deployment"}` | ✅ | +| scheduledTime | `Timestamp` | The firing time as it stands after the change | `2026-08-12T02:00:00Z` | ✅ | +| author | `Object` | The actor the producer attributes the change to | `{"id": "alice", "source": "/scheduler/prod"}` | ✅ | +| changeWindow | `Object` | A change window this execution is bound to, if any | `{"id": "win-maint-0812", "source": "/scheduler/prod"}` | | + +### [`scheduledExecution Canceled`](conformance/scheduledexecution_canceled.json) + +A registered scheduled execution has been withdrawn before firing. Nothing was enqueued. + +- Event Type: __`dev.cdevents.scheduledexecution.canceled.0.1.0-draft`__ +- Predicate: canceled +- Subject: [`scheduledExecution`](#scheduledexecution) + +| Field | Type | Description | Examples | Required | +|-------|------|-------------|----------|----------------------------| +| id | `String` | See [id](spec.md#id-subject)| `sched-deploy-orders-9281` | ✅ | +| source | `URI-Reference` | [source](spec.md#source) from the context | | | +| target | `Object` | The execution that will now not be enqueued | `{"id": "orders-svc", "source": "/prod/deploys", "type": "deployment"}` | ✅ | +| scheduledTime | `Timestamp` | The time the execution had been registered to fire | `2026-08-12T02:00:00Z` | ✅ | +| author | `Object` | The actor the producer attributes the cancellation to | `{"id": "alice", "source": "/scheduler/prod"}` | ✅ | +| changeWindow | `Object` | A change window this execution was bound to, if any | `{"id": "win-maint-0812", "source": "/scheduler/prod"}` | | +| reason | `String` | Detail for the cancellation | `Superseded by an out-of-band release` | | + +### [`scheduledExecution Triggered`](conformance/scheduledexecution_triggered.json) + +A scheduled execution has fired and handed off to the execution it describes. This is the point at which the target's own `queued` event is produced. + +Firing is caused either by elapsed time or by an actor, and `trigger.type` records which. `author` is required when `trigger.type` is `manual`, and MUST NOT be present for any other value: the absence of `author` is what tells a consumer that no actor fired the execution. + +- Event Type: __`dev.cdevents.scheduledexecution.triggered.0.1.0-draft`__ +- Predicate: triggered +- Subject: [`scheduledExecution`](#scheduledexecution) + +| Field | Type | Description | Examples | Required | +|-------|------|-------------|----------|----------------------------| +| id | `String` | See [id](spec.md#id-subject)| `sched-deploy-orders-9281` | ✅ | +| source | `URI-Reference` | [source](spec.md#source) from the context | | | +| target | `Object` | The execution that was enqueued | `{"id": "orders-svc", "source": "/prod/deploys", "type": "deployment"}` | ✅ | +| scheduledTime | `Timestamp` | The time the execution had been registered to fire | `2026-08-12T02:00:00Z` | ✅ | +| trigger | `Object` ([`trigger`](testing-events.md#trigger)) | What caused the firing | `{"type": "schedule"}`, `{"type": "manual"}` | ✅ | +| author | `Object` | The actor that fired the execution. MUST NOT be present unless `trigger.type` is `manual`. | `{"id": "alice", "source": "/scheduler/prod"}` | when `trigger.type` is `manual` | +| changeWindow | `Object` | A change window this execution is bound to, if any | `{"id": "win-maint-0812", "source": "/scheduler/prod"}` | | +| triggeredExecution | `Object` | The execution that was enqueued | `{"id": "deploy-44119", "source": "/prod/deploys"}` | | + +### [`scheduledExecution Missed`](conformance/scheduledexecution_missed.json) + +A scheduled execution did not fire. `scheduledTime` passed without the execution being enqueued. + +This event is emitted at the producer's discretion by a producer that was available to observe the absence; the specification defines no tolerance window. A producer that was itself unavailable at `scheduledTime` emits nothing, including no `missed` event. A schedule that never fired is distinct from an execution that fired and then failed, which is reported by the target's own events. + +- Event Type: __`dev.cdevents.scheduledexecution.missed.0.1.0-draft`__ +- Predicate: missed +- Subject: [`scheduledExecution`](#scheduledexecution) + +| Field | Type | Description | Examples | Required | +|-------|------|-------------|----------|----------------------------| +| id | `String` | See [id](spec.md#id-subject)| `sched-deploy-orders-9281` | ✅ | +| source | `URI-Reference` | [source](spec.md#source) from the context | | | +| target | `Object` | The execution that was not enqueued | `{"id": "orders-svc", "source": "/prod/deploys", "type": "deployment"}` | ✅ | +| scheduledTime | `Timestamp` | The time the execution had been registered to fire | `2026-08-12T02:00:00Z` | ✅ | +| changeWindow | `Object` | A change window this execution was bound to, if any | `{"id": "win-maint-0812", "source": "/scheduler/prod"}` | | +| reason | `String` | Detail for the missed firing | `Scheduler backlog exceeded the firing window` | | diff --git a/schemas/scheduledexecutioncanceled.json b/schemas/scheduledexecutioncanceled.json new file mode 100644 index 0000000..899d790 --- /dev/null +++ b/schemas/scheduledexecutioncanceled.json @@ -0,0 +1,171 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cdevents.dev/0.6.0-draft/schema/scheduledexecution-canceled-event", + "properties": { + "context": { + "properties": { + "specversion": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "enum": [ + "dev.cdevents.scheduledexecution.canceled.0.1.0-draft" + ], + "default": "dev.cdevents.scheduledexecution.canceled.0.1.0-draft" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "schemaUri": { + "type": "string", + "minLength": 1, + "format": "uri" + }, + "chainId": { + "type": "string", + "minLength": 1 + }, + "links": { + "$ref": "links/embeddedlinksarray" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "specversion", + "id", + "source", + "type", + "timestamp" + ] + }, + "subject": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "content": { + "properties": { + "target": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "type" + ] + }, + "scheduledTime": { + "type": "string", + "format": "date-time" + }, + "author": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "changeWindow": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "reason": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "target", + "scheduledTime", + "author" + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "content" + ] + }, + "customData": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string", + "contentEncoding": "base64" + } + ] + }, + "customDataContentType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "context", + "subject" + ] +} diff --git a/schemas/scheduledexecutioncreated.json b/schemas/scheduledexecutioncreated.json new file mode 100644 index 0000000..81d6671 --- /dev/null +++ b/schemas/scheduledexecutioncreated.json @@ -0,0 +1,168 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cdevents.dev/0.6.0-draft/schema/scheduledexecution-created-event", + "properties": { + "context": { + "properties": { + "specversion": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "enum": [ + "dev.cdevents.scheduledexecution.created.0.1.0-draft" + ], + "default": "dev.cdevents.scheduledexecution.created.0.1.0-draft" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "schemaUri": { + "type": "string", + "minLength": 1, + "format": "uri" + }, + "chainId": { + "type": "string", + "minLength": 1 + }, + "links": { + "$ref": "links/embeddedlinksarray" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "specversion", + "id", + "source", + "type", + "timestamp" + ] + }, + "subject": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "content": { + "properties": { + "target": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "type" + ] + }, + "scheduledTime": { + "type": "string", + "format": "date-time" + }, + "author": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "changeWindow": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "target", + "scheduledTime", + "author" + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "content" + ] + }, + "customData": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string", + "contentEncoding": "base64" + } + ] + }, + "customDataContentType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "context", + "subject" + ] +} diff --git a/schemas/scheduledexecutionmissed.json b/schemas/scheduledexecutionmissed.json new file mode 100644 index 0000000..e0ea13d --- /dev/null +++ b/schemas/scheduledexecutionmissed.json @@ -0,0 +1,152 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cdevents.dev/0.6.0-draft/schema/scheduledexecution-missed-event", + "properties": { + "context": { + "properties": { + "specversion": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "enum": [ + "dev.cdevents.scheduledexecution.missed.0.1.0-draft" + ], + "default": "dev.cdevents.scheduledexecution.missed.0.1.0-draft" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "schemaUri": { + "type": "string", + "minLength": 1, + "format": "uri" + }, + "chainId": { + "type": "string", + "minLength": 1 + }, + "links": { + "$ref": "links/embeddedlinksarray" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "specversion", + "id", + "source", + "type", + "timestamp" + ] + }, + "subject": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "content": { + "properties": { + "target": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "type" + ] + }, + "scheduledTime": { + "type": "string", + "format": "date-time" + }, + "changeWindow": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "reason": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "target", + "scheduledTime" + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "content" + ] + }, + "customData": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string", + "contentEncoding": "base64" + } + ] + }, + "customDataContentType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "context", + "subject" + ] +} diff --git a/schemas/scheduledexecutionmodified.json b/schemas/scheduledexecutionmodified.json new file mode 100644 index 0000000..fc6550d --- /dev/null +++ b/schemas/scheduledexecutionmodified.json @@ -0,0 +1,168 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cdevents.dev/0.6.0-draft/schema/scheduledexecution-modified-event", + "properties": { + "context": { + "properties": { + "specversion": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "enum": [ + "dev.cdevents.scheduledexecution.modified.0.1.0-draft" + ], + "default": "dev.cdevents.scheduledexecution.modified.0.1.0-draft" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "schemaUri": { + "type": "string", + "minLength": 1, + "format": "uri" + }, + "chainId": { + "type": "string", + "minLength": 1 + }, + "links": { + "$ref": "links/embeddedlinksarray" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "specversion", + "id", + "source", + "type", + "timestamp" + ] + }, + "subject": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "content": { + "properties": { + "target": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "type" + ] + }, + "scheduledTime": { + "type": "string", + "format": "date-time" + }, + "author": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "changeWindow": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "target", + "scheduledTime", + "author" + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "content" + ] + }, + "customData": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string", + "contentEncoding": "base64" + } + ] + }, + "customDataContentType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "context", + "subject" + ] +} diff --git a/schemas/scheduledexecutiontriggered.json b/schemas/scheduledexecutiontriggered.json new file mode 100644 index 0000000..529ea82 --- /dev/null +++ b/schemas/scheduledexecutiontriggered.json @@ -0,0 +1,247 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cdevents.dev/0.6.0-draft/schema/scheduledexecution-triggered-event", + "properties": { + "context": { + "properties": { + "specversion": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "enum": [ + "dev.cdevents.scheduledexecution.triggered.0.1.0-draft" + ], + "default": "dev.cdevents.scheduledexecution.triggered.0.1.0-draft" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "schemaUri": { + "type": "string", + "minLength": 1, + "format": "uri" + }, + "chainId": { + "type": "string", + "minLength": 1 + }, + "links": { + "$ref": "links/embeddedlinksarray" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "specversion", + "id", + "source", + "type", + "timestamp" + ] + }, + "subject": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "content": { + "properties": { + "target": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + }, + "type": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "type" + ] + }, + "scheduledTime": { + "type": "string", + "format": "date-time" + }, + "author": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "trigger": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "manual", + "pipeline", + "event", + "schedule", + "other" + ] + }, + "uri": { + "type": "string", + "format": "uri" + } + } + }, + "changeWindow": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + }, + "triggeredExecution": { + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "source": { + "type": "string", + "minLength": 1, + "format": "uri-reference" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id" + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "target", + "scheduledTime", + "trigger" + ], + "allOf": [ + { + "properties": { + "trigger": { + "required": [ + "type" + ] + } + } + }, + { + "if": { + "required": [ + "trigger" + ], + "properties": { + "trigger": { + "required": [ + "type" + ], + "properties": { + "type": { + "const": "manual" + } + } + } + } + }, + "then": { + "required": [ + "author" + ] + }, + "else": { + "not": { + "required": [ + "author" + ] + } + } + } + ] + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "id", + "content" + ] + }, + "customData": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "string", + "contentEncoding": "base64" + } + ] + }, + "customDataContentType": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "context", + "subject" + ] +}