-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds event schema based in Event Structure document (#124)
- Loading branch information
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"title": "Inventory Event Structure", | ||
"description": "The event schema will be compatible with CloudEvents, a specification for describing event data in a common way. The following describes how the fabric will align with the CloudEvent schema.", | ||
"type": "object", | ||
"properties": { | ||
"specversion": { | ||
"description": "Specifies the version of the CloudEvents spec targeted.", | ||
"type": "string", | ||
"enum": [ | ||
"1.0" | ||
] | ||
}, | ||
"type": { | ||
"description": "We use a string comprised of redhat.inventory.(resources|resources_relationship).{resource_type}.(created|updated|deleted)", | ||
"type": "string", | ||
"pattern": "^redhat\\.inventory\\.(resources|resources_relationship)\\.[a-zA-Z0-9_-]+\\.(created|updated|deleted)$", | ||
"examples": [ | ||
"redhat.inventory.resources.k8s_cluster.created", | ||
"redhat.inventory.resources.k8s_cluster.updated", | ||
"redhat.inventory.resources.k8s_cluster.deleted", | ||
"redhat.inventory.resources_relationship.k8spolicy_ispropagatedto_k8scluster.created", | ||
"redhat.inventory.resources_relationship.k8spolicy_ispropagatedto_k8scluster.updated", | ||
"redhat.inventory.resources_relationship.k8spolicy_ispropagatedto_k8scluster.deleted" | ||
] | ||
}, | ||
"source": { | ||
"description": "Describes the source (or app) that generated the event.", | ||
"type": "string", | ||
"format": "uri", | ||
"examples": [ | ||
"https://redhat.com" | ||
] | ||
}, | ||
"id": { | ||
"description": "Identifies the event. Unique for this source.", | ||
"type": "string", | ||
"format": "uuid", | ||
"examples": [ | ||
"afebabe-cafe-babe-cafe-babecafebabe" | ||
] | ||
}, | ||
"time": { | ||
"description": "Last reported from inventory-api", | ||
"type": "string", | ||
"format": "date-time", | ||
"examples": [ | ||
"2018-11-13T20:20:39+00:00" | ||
] | ||
}, | ||
"datacontenttype": { | ||
"description": "Content type of data value", | ||
"type": "string", | ||
"pattern": "^application\\/json$" | ||
}, | ||
"data": { | ||
"type": "object" | ||
}, | ||
|
||
"subject": { | ||
"description": "Represents the updated resource: (resource|resources-relation)/{resource_type}/{resource_id}", | ||
"type": "string", | ||
"pattern": "^\\/(resources|resources-relationships)\\/[a-zA-Z0-9\\_-]+\\/[a-zA-Z0-9\\-]+$", | ||
"examples": [ | ||
"/resources/k8s_cluster/A234-1234-1234", | ||
"/resources-relationships/k8spolicy_ispropagatedto_k8scluster/A234-1234-1234" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"specversion", | ||
"type", | ||
"source", | ||
"id", | ||
"time", | ||
"datacontenttype", | ||
"data", | ||
"subject" | ||
] | ||
} |