From a646958a5fe1bd9813e18c936d5139a6437b4588 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Tue, 17 Sep 2024 16:48:02 -0700 Subject: [PATCH 01/12] adding the documentation for events on kafka Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 365 +++++++++++++++++++++ 1 file changed, 365 insertions(+) create mode 100644 src/content/docs/start-here/kafka-event.md diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md new file mode 100644 index 0000000..69fc2e7 --- /dev/null +++ b/src/content/docs/start-here/kafka-event.md @@ -0,0 +1,365 @@ +# Event Schema Design +## Mapping to Cloud Events + +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. + +||[CloudEvent Intent](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#required-attributes)|[Fabric Intent](https://github.com/project-kessel/inventory-api/blob/main/data/kafka-event-schema.json) +|---|---|---| +|specversion|The version of the CloudEvents specification which the event uses. This enables the interpretation of the context. Compliant event producers MUST use a value of 1.0 when referring to this version of the specification.|---| +|type|This attribute contains a value describing the type of event related to the originating occurrence. Often this attribute is used for routing, observability, policy enforcement, etc. The format of this is producer defined and might include information such as the version of the type - see Versioning of CloudEvents in the Primer for more information. Constraints
MUST be a non-empty string ;
SHOULD be prefixed with a reverse-DNS name.
The prefixed domain dictates the organization which defines the semantics of this event type.
Examples
- com.github.pull_request.opened
- com.example.object.deleted.v2 | We use a string comprised of __`redhat.inventory.resources.resource_type.operation`__
- redhat.inventory.resources.k8s-cluster.created
- redhat.inventory.resources.k8s-cluster.updated
- redhat.inventory.resources.k8s-cluster.deleted
or
__`redhat.inventory.resource_relationships.relationship_type.operation`___
-redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.created
- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.updated
- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted
The only valid values for operation are created, updated or deleted. This allows a consumer to filter on method and/or resource type.| +|Source (URI)|Description: Identifies the context in which an event happened. Often this will include information such as the type of the event source, the organization publishing the event or the process that produced the event. The exact syntax and semantics behind the data encoded in the URI is defined by the event producer.
Producers MUST ensure that source + id is unique for each distinct event.
An application MAY assign a unique source to each distinct producer, which makes it easy to produce unique IDs since no other producer will have the same source. The application MAY use UUIDs, URNs, DNS authorities or an application-specific scheme to create unique source identifiers.|Inventory-URI| +|Id (String)|Description: Identifies the event. Producers MUST ensure that source + id is unique for each distinct event. If a duplicate event is re-sent (e.g. due to a network error) it MAY have the same id. Consumers MAY assume that Events with identical source and id are duplicates.|inventory-api generated ID for the event| +|time|Timestamp of when the occurrence happened. If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer, however all producers for the same source MUST be consistent in this respect. In other words, either they all use the actual time of the occurrence or they all use the same algorithm to determine the value used.
Constraints
- OPTIONAL
- If present, MUST adhere to the format specified in RFC 3339|last_reported from inventory-api| +|datacontenttype|Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format. For example, an event rendered using the JSON envelope format might carry an XML payload in data, and the consumer is informed by this attribute being set to "application/xml". The rules for how data content is rendered for different datacontenttype values are defined in the event format specifications| "application/json”| +|data|The event payload. This specification does not place any restriction on the type of this information. It is encoded into a media format which is specified by the datacontenttype attribute (e.g. application/json), and adheres to the dataschema format when those respective attributes are present.|Payload will mimic the OpenAPI Specs for each method, i.e POST, PUT and DELETE. The data object will contain the information about the resource, including
- metadata object
- reporter_data object
- resource_data object or relationship_data object
The reporter_data will be the reporter who made the api call for which this event is referencing. | +|dataschema|Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI.
Constraints
OPTIONAL
If present, MUST be a non-empty URI|Not Used| +|subject|This describes the subject of the event in the context of the event producer (identified by source). In publish-subscribe scenarios, a subscriber will typically subscribe to events emitted by a source, but the source identifier alone might not be sufficient as a qualifier for any specific event if the source context has internal sub-structure.

Identifying the subject of the event in context metadata (opposed to only in the data payload) is particularly helpful in generic subscription filtering scenarios where middleware is unable to interpret the data content. In the above example, the subscriber might only be interested in blobs with names ending with '.jpg' or '.jpeg' and the subject attribute allows for constructing a simple and efficient string-suffix filter for that subset of events.|We use a string composed of __`resources/resource_type/id where id is the ID of the resource created by the asset inventory service.`__
/resources/k8s-cluster/A234-1234-1234
or
__`resource-relationships/relationship_type/id where id is the ID of the resource-relationship created by the asset inventory service`__
/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234| +|---|---|---| + + +## Examples +### Resources +### Create a Cluster +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources.k8s-cluster.created, + "source" : "inventory-api-uri", + "id" : "A234-1234-1234", + "subject": "/resources/k8s-cluster/A234-1234-1234", + "time" : "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" : { + "metadata": { + “id” : “some id generated by inventory” + “resource_type” : “k8s-cluster” + “last_reported” : "2018-04-05T17:31:00Z", + "workspace": "workspace name", + "labels": [ + { + "key": "env", + "value": "prod" + } + ] + }, + "reporter_data": { + “reporter_instance_id” : “an id of the reporter” + “last_reported” : "2018-04-05T17:31:00Z", + "reporter_type": “REPORTER_TYPE_ACM”, + "console_href": "some https://referring the local-res-id", + "api_href": "some https://referring the local-res-id", + "local_resource_id": "id-as-supplied-by-reporter", + "reporter_version": "2.12" + }, + "resource_data": { + "external_cluster_id": "cluster-guid/ARN etc", + "cluster_status": “CLUSTER_STATUS_READY”, + "kube_version": "v1.30.1", + "kube_vendor": “KUBE_VENDOR_OPENSHIFT”, + "vendor_version": "4.16", + "cloud_platform": “CLOUD_PLATFORM_AWS_UPI”, + "nodes": [ + { + "name": "ip-10-0-0-1.ec2.internal", + "cpu": "7500m", + "memory": "30973224Ki", + "labels": [ + { + "key": "node.openshift.io/os_id", + "value": "rhcos" + } + ] + } + ] + } + } +} + + +``` + + +### Update a Cluster + +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources.k8s-cluster.updated”, + "source" : "inventory-api-uri", + "id" : "A234-1234-1234", + "subject": "/resources/k8s-cluster/A234-1234-1234", + "time" : "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" : { + "metadata": { + “id” : “some id generated by inventory” + “resource_type” : “k8s-cluster” + “last_reported” : "2018-04-05T17:31:00Z", + "workspace": "workspace name", + "labels": [ + { + "key": "env", + "value": "prod" + } + ] + }, + "reporter_data": { + “reporter_instance_id” : “an id of the reporter” + “last_reported” : "2018-04-05T17:31:00Z", + "reporter_type": “REPORTER_TYPE_ACM”, + "console_href": "some https://referring the local-res-id", + "api_href": "some https://referring the local-res-id", + "local_resource_id": "id-as-supplied-by-reporter", + "reporter_version": "2.12" + }, + "resource_data": { + "external_cluster_id": "cluster-guid/ARN etc", + "cluster_status": “CLUSTER_STATUS_READY”, + "kube_version": "v1.30.1", + "kube_vendor": “KUBE_VENDOR_OPENSHIFT”, + "vendor_version": "4.16", + "cloud_platform": “CLOUD_PLATFORM_AWS_UPI”, + "nodes": [ + { + "name": "ip-10-0-0-1.ec2.internal", + "cpu": "7500m", + "memory": "30973224Ki", + "labels": [ + { + "key": "node.openshift.io/os_id", + "value": "rhcos" + } + ] + } + ] + } + } +} +``` + +### Delete a Cluster +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources.k8s-cluster.deleted”, + "source" : "inventory-api-uri", + "id" : "A234-1234-1234", + "subject": "/resources/k8s-cluster/A234-1234-1234", + "time" : "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" : { + "metadata": { + “id” : “some id generated by inventory” + }, + "reporter_data": { + “reporter_instance_id” : “an id of the reporter” + "reporter_type": “ACM”, + "local_resource_id": "id-as-supplied-by-reporter", + } + } +} + +``` + +### Create a Policy +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources.k8s-policy.created”, + "source" : "inventory-api-uri", + "id" : "A234-1234-1234", + "subject": "/resources/k8s-policy/A234-1234-1234", + "time" : "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" :{ + "metadata": { + "id": “some id generated by inventory”, + "resource_type": “k8s-policy”, + "last_reported": “2018-04-05T17:31:00Z”, + "workspace": "workspace name", + "labels": [ + { + "key": "apps.open-cluster-management.io/reconcile-rate", + "value": "high" + } + ] + }, + "reporter_data": { + “reporter_instance_id” : “an id of the reporter” + “last_reported” : "2018-04-05T17:31:00Z", + "reporter_type": “REPORTER_TYPE_ACM”, + "console_href": "some https://referring the local-res-id", + "api_href": "some https://referring the local-res-id", + "local_resource_id": "id-as-supplied-by-reporter", + "reporter_version": "2.12" + }, + "resource_data": { + "Disabled": “False” + "severity": “SEVERITY_LOW” + } + } +} +``` + +### Update a Policy +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources.k8s-policy.updated” + "source" : "inventory-api-uri", + "id" : "A234-1234-1234", + "subject": "/resources/k8s-policy/A234-1234-1234", + "time" : "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" :{ + "metadata": { + "id": “some id generated by inventory”, + "resource_type": “k8s-policy”, + "last_reported": “2018-04-05T17:31:00Z”, + "workspace": "workspace name", + "labels": [ + { + "key": "apps.open-cluster-management.io/reconcile-rate", + "value": "high" + } + ] + }, + "reporter_data": { + “reporter_instance_id” : “an id of the reporter” + “last_reported” : "2018-04-05T17:31:00Z", + "reporter_type": “REPORTER_TYPE_ACM”, + "console_href": "some https://referring the local-res-id", + "api_href": "some https://referring the local-res-id", + "local_resource_id": "id-as-supplied-by-reporter", + "reporter_version": "2.12" + }, + "resource_data": { + "Disabled": “False” + "severity": “SEVERITY_LOW” + } + } +} +``` + +### Delete a Policy +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources.k8s-policy.deleted” + "source" : "inventory-api-uri", + "id" : "A234-1234-1234", + "subject": "/resources/k8s-policy/A234-1234-1234", + "time" : "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" :{ + "metadata": { + "id": “some id generated by inventory”, + "resource_type": “k8s-policy”, + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_instance_id": “an id of the reporter” , + "reporter_type": “ACM”, + "local_resource_id": "id-as-supplied-by-reporter" + } + } +} +``` + +### Resource Relationships + +### Create a Relationship +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.created”, + "source": "inventory-api-uri", + "id": "A234-1234-1234", + "subject": "/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234, + "time": "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" :{ + "metadata": { + “id": “some id generated by inventory”, + "relationship_type": “k8s-policy_ispropagatedto_k8s-cluster”, + "last_reported": “2018-04-05T17:31:00Z”, + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_type": “ACM”, + "subject_local_resource_id": "policy-id-as-supplied-by-reporter", + "object_local_resource_id": "cluster-id-as-supplied-by-reporter", + "reporter_version": "2.12", + “reporter_instance_id”: “an id of the reporter”, + }, + "relationship_data": { + "status": “COMPLIANT”, + “k8s_policy_id”: “id-in-inventory”, + “k8s_cluster_id”: “id-in-inventory”, + } + } +} +``` + + +### Update a Relationship +``` +{ + "specversion" : "1.0", + “type”: “redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.updated”, + "source": "inventory-api-uri", + "id": "A234-1234-1234", + "subject": "/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234, + "time": "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" :{ + "metadata": { + “id": “some id generated by inventory”, + "relationship_type": “k8s-policy_ispropagatedto_k8s-cluster”, + "last_reported": “2018-04-05T17:31:00Z”, + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_type": “ACM”, + "subject_local_resource_id": "policy-id-as-supplied-by-reporter", + "object_local_resource_id": "cluster-id-as-supplied-by-reporter", + "reporter_version": "2.12", + “reporter_instance_id”: “an id of the reporter”, + }, + "relationship_data": { + "status": “COMPLIANT”, + “k8s_policy_id”: “id-in-inventory”, + “k8s_cluster_id”: “id-in-inventory”, + } + } +} +``` + + +### Delete a Relationship +``` +{ + +"specversion" : "1.0", + “type”: “redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted”, + "source": "inventory-api-uri", + "id": "A234-1234-1234", + "subject": "/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234, + "time": "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" :{ + "metadata": { + “id": “some id generated by inventory”, + "relationship_type": “k8s-policy_ispropagatedto_k8s-cluster”, + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_type": “ACM”, + "subject_local_resource_id": "policy-id-as-supplied-by-reporter", + "object_local_resource_id": "cluster-id-as-supplied-by-reporter", + "reporter_version": "2.12", + “reporter_instance_id”: “an id of the reporter”, + } + } +} +``` From 0930a77a39b77723eea9823e3c8a92f0bb65083a Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Thu, 19 Sep 2024 10:45:57 -0700 Subject: [PATCH 02/12] reformat table and change is-propagated-to Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 160 ++++++++++++++++++--- 1 file changed, 137 insertions(+), 23 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index 69fc2e7..6f729c8 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -1,20 +1,134 @@ # Event Schema Design ## Mapping to Cloud Events -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. - -||[CloudEvent Intent](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#required-attributes)|[Fabric Intent](https://github.com/project-kessel/inventory-api/blob/main/data/kafka-event-schema.json) -|---|---|---| -|specversion|The version of the CloudEvents specification which the event uses. This enables the interpretation of the context. Compliant event producers MUST use a value of 1.0 when referring to this version of the specification.|---| -|type|This attribute contains a value describing the type of event related to the originating occurrence. Often this attribute is used for routing, observability, policy enforcement, etc. The format of this is producer defined and might include information such as the version of the type - see Versioning of CloudEvents in the Primer for more information. Constraints
MUST be a non-empty string ;
SHOULD be prefixed with a reverse-DNS name.
The prefixed domain dictates the organization which defines the semantics of this event type.
Examples
- com.github.pull_request.opened
- com.example.object.deleted.v2 | We use a string comprised of __`redhat.inventory.resources.resource_type.operation`__
- redhat.inventory.resources.k8s-cluster.created
- redhat.inventory.resources.k8s-cluster.updated
- redhat.inventory.resources.k8s-cluster.deleted
or
__`redhat.inventory.resource_relationships.relationship_type.operation`___
-redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.created
- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.updated
- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted
The only valid values for operation are created, updated or deleted. This allows a consumer to filter on method and/or resource type.| -|Source (URI)|Description: Identifies the context in which an event happened. Often this will include information such as the type of the event source, the organization publishing the event or the process that produced the event. The exact syntax and semantics behind the data encoded in the URI is defined by the event producer.
Producers MUST ensure that source + id is unique for each distinct event.
An application MAY assign a unique source to each distinct producer, which makes it easy to produce unique IDs since no other producer will have the same source. The application MAY use UUIDs, URNs, DNS authorities or an application-specific scheme to create unique source identifiers.|Inventory-URI| -|Id (String)|Description: Identifies the event. Producers MUST ensure that source + id is unique for each distinct event. If a duplicate event is re-sent (e.g. due to a network error) it MAY have the same id. Consumers MAY assume that Events with identical source and id are duplicates.|inventory-api generated ID for the event| -|time|Timestamp of when the occurrence happened. If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer, however all producers for the same source MUST be consistent in this respect. In other words, either they all use the actual time of the occurrence or they all use the same algorithm to determine the value used.
Constraints
- OPTIONAL
- If present, MUST adhere to the format specified in RFC 3339|last_reported from inventory-api| -|datacontenttype|Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format. For example, an event rendered using the JSON envelope format might carry an XML payload in data, and the consumer is informed by this attribute being set to "application/xml". The rules for how data content is rendered for different datacontenttype values are defined in the event format specifications| "application/json”| -|data|The event payload. This specification does not place any restriction on the type of this information. It is encoded into a media format which is specified by the datacontenttype attribute (e.g. application/json), and adheres to the dataschema format when those respective attributes are present.|Payload will mimic the OpenAPI Specs for each method, i.e POST, PUT and DELETE. The data object will contain the information about the resource, including
- metadata object
- reporter_data object
- resource_data object or relationship_data object
The reporter_data will be the reporter who made the api call for which this event is referencing. | -|dataschema|Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI.
Constraints
OPTIONAL
If present, MUST be a non-empty URI|Not Used| -|subject|This describes the subject of the event in the context of the event producer (identified by source). In publish-subscribe scenarios, a subscriber will typically subscribe to events emitted by a source, but the source identifier alone might not be sufficient as a qualifier for any specific event if the source context has internal sub-structure.

Identifying the subject of the event in context metadata (opposed to only in the data payload) is particularly helpful in generic subscription filtering scenarios where middleware is unable to interpret the data content. In the above example, the subscriber might only be interested in blobs with names ending with '.jpg' or '.jpeg' and the subject attribute allows for constructing a simple and efficient string-suffix filter for that subset of events.|We use a string composed of __`resources/resource_type/id where id is the ID of the resource created by the asset inventory service.`__
/resources/k8s-cluster/A234-1234-1234
or
__`resource-relationships/relationship_type/id where id is the ID of the resource-relationship created by the asset inventory service`__
/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234| -|---|---|---| +The event schema will be compatible with CloudEvents, a specification for describing event data in a common way. The following describes how the fabric (Kessel Inventory) will align with the CloudEvent schema. + +The attributes of CloudEvent and the usage is described [here.](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#required-attributes) + +For Kessel Inventory schema, look [here.](https://github.com/project-kessel/inventory-api/blob/main/data/kafka-event-schema.json) + +### Attributes +#### specversion (String) + +##### Cloud Event Intent +The version of the CloudEvents specification which the event uses. This enables the interpretation of the context. Compliant event producers MUST use a value of 1.0 when referring to this version of the specification. + +##### Kessel Inventory Intent +Same as above. + +#### type (String) +##### Cloud Event Intent +This attribute contains a value describing the type of event related to the originating occurrence. Often this attribute is used for routing, observability, policy enforcement, etc. The format of this is producer defined and might include information such as the version of the type - see Versioning of CloudEvents in the Primer for more information. Constraints: +- MUST be a non-empty string +- SHOULD be prefixed with a reverse-DNS name. + - The prefixed domain dictates the organization which defines the semantics of this event type.
Examples: + ``` + com.github.pull_request.opened + com.example.object.deleted.v2 + ``` + +##### Kessel Inventory Intent +We use a string comprised of __`redhat.inventory.resources.resource_type.operation`__ +``` +- redhat.inventory.resources.k8s-cluster.created +- redhat.inventory.resources.k8s-cluster.updated +- redhat.inventory.resources.k8s-cluster.deleted +``` +or
__`redhat.inventory.resource_relationships.relationship_type.operation`___ +``` +- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.created +- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.updated +- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted +``` +The only valid values for operation are created, updated or deleted. This allows a consumer to filter on method and/or resource type. + + +### Attributes +#### Source (URI) + +##### Cloud Event Intent +The version of the CloudEvents specification which the event uses. This enables the interpretation of the context. Compliant event producers MUST use a value of 1.0 when referring to this version of the specification. + +##### Kessel Inventory Intent +Same as above. + +### Attributes +#### Source (URI) + +##### Cloud Event Intent +Identifies the context in which an event happened. Often this will include information such as the type of the event source, the organization publishing the event or the process that produced the event. The exact syntax and semantics behind the data encoded in the URI is defined by the event producer.

Producers MUST ensure that source + id is unique for each distinct event.
An application MAY assign a unique source to each distinct producer, which makes it easy to produce unique IDs since no other producer will have the same source. The application MAY use UUIDs, URNs, DNS authorities or an application-specific scheme to create unique source identifiers. + +##### Kessel Inventory Intent +Inventory-URI + +### Attributes +#### Id (String) + +##### Cloud Event Intent +Identifies the event. Producers MUST ensure that source + id is unique for each distinct event. If a duplicate event is re-sent (e.g. due to a network error) it MAY have the same id. Consumers MAY assume that Events with identical source and id are duplicates. + +##### Kessel Inventory Intent +inventory-api generated ID for the event + +### Attributes +#### time (Timestamp) + +##### Cloud Event Intent +Timestamp of when the occurrence happened. If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer, however all producers for the same source MUST be consistent in this respect. In other words, either they all use the actual time of the occurrence or they all use the same algorithm to determine the value used.
Constraints: +- OPTIONAL + - If present, MUST adhere to the format specified in RFC 3339 + +##### Kessel Inventory Intent +last_reported from inventory-api + +### Attributes +#### datacontenttype (String per RFC 2046) + +##### Cloud Event Intent +Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format. For example, an event rendered using the JSON envelope format might carry an XML payload in data, and the consumer is informed by this attribute being set to "application/xml". The rules for how data content is rendered for different datacontenttype values are defined in the event format specifications. + +##### Kessel Inventory Intent +"application/json" + +### Attributes +#### data + +##### Cloud Event Intent +The event payload. This specification does not place any restriction on the type of this information. It is encoded into a media format which is specified by the datacontenttype attribute (e.g. application/json), and adheres to the dataschema format when those respective attributes are present. + +##### Kessel Inventory Intent +Payload will mimic the OpenAPI Specs for each method, i.e POST, PUT and DELETE. The data object will contain the information about the resource, including +- metadata object +- reporter_data object +- resource_data object or relationship_data object
The reporter_data will be the reporter who made the api call for which this event is referencing. + +### Attributes +#### dataschema (URI) + +##### Cloud Event Intent +Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI.
Constraints: +- OPTIONAL + - If present, MUST be a non-empty URI + +##### Kessel Inventory Intent +Not Used + +### Attributes +#### subject (String) + +##### Cloud Event Intent +This describes the subject of the event in the context of the event producer (identified by source). In publish-subscribe scenarios, a subscriber will typically subscribe to events emitted by a source, but the source identifier alone might not be sufficient as a qualifier for any specific event if the source context has internal sub-structure.

Identifying the subject of the event in context metadata (opposed to only in the data payload) is particularly helpful in generic subscription filtering scenarios where middleware is unable to interpret the data content. In the above example, the subscriber might only be interested in blobs with names ending with '.jpg' or '.jpeg' and the subject attribute allows for constructing a simple and efficient string-suffix filter for that subset of events. + +##### Kessel Inventory Intent +We use a string composed of __`resources/resource_type/id where id is the ID of the resource created by the asset inventory service.`__
Example: +``` +/resources/k8s-cluster/A234-1234-1234 +``` + or
__`resource-relationships/relationship_type/id where id is the ID of the resource-relationship created by the asset inventory service`__
Example: + ``` + /resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234 + ``` + ## Examples @@ -272,16 +386,16 @@ The event schema will be compatible with CloudEvents, a specification for descri ``` { "specversion" : "1.0", - “type”: “redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.created”, + “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.created”, "source": "inventory-api-uri", "id": "A234-1234-1234", - "subject": "/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234, + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234, "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ "metadata": { “id": “some id generated by inventory”, - "relationship_type": “k8s-policy_ispropagatedto_k8s-cluster”, + "relationship_type": “k8s-policy_is-propagated-to_k8s-cluster”, "last_reported": “2018-04-05T17:31:00Z”, "workspace": "workspace name", }, @@ -306,16 +420,16 @@ The event schema will be compatible with CloudEvents, a specification for descri ``` { "specversion" : "1.0", - “type”: “redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.updated”, + “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.updated”, "source": "inventory-api-uri", "id": "A234-1234-1234", - "subject": "/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234, + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234, "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ "metadata": { “id": “some id generated by inventory”, - "relationship_type": “k8s-policy_ispropagatedto_k8s-cluster”, + "relationship_type": “k8s-policy_is-propagated-to_k8s-cluster”, "last_reported": “2018-04-05T17:31:00Z”, "workspace": "workspace name", }, @@ -341,16 +455,16 @@ The event schema will be compatible with CloudEvents, a specification for descri { "specversion" : "1.0", - “type”: “redhat.inventory.resources_relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted”, + “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.deleted”, "source": "inventory-api-uri", "id": "A234-1234-1234", - "subject": "/resources-relationships/k8s-policy_ispropagatedto_k8s-cluster/A234-1234-1234, + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234, "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ "metadata": { “id": “some id generated by inventory”, - "relationship_type": “k8s-policy_ispropagatedto_k8s-cluster”, + "relationship_type": “k8s-policy_is-propagated-to_k8s-cluster”, "workspace": "workspace name", }, "reporter_data": { From d95a137db12f955da2bbd76a5e85ec43e709cb99 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Thu, 19 Sep 2024 10:52:24 -0700 Subject: [PATCH 03/12] reformat table and change is-propagated-to Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index 6f729c8..fa46f7e 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -43,16 +43,7 @@ or
__`redhat.inventory.resource_relationships.relationship_type.operation`__ The only valid values for operation are created, updated or deleted. This allows a consumer to filter on method and/or resource type. -### Attributes -#### Source (URI) - -##### Cloud Event Intent -The version of the CloudEvents specification which the event uses. This enables the interpretation of the context. Compliant event producers MUST use a value of 1.0 when referring to this version of the specification. -##### Kessel Inventory Intent -Same as above. - -### Attributes #### Source (URI) ##### Cloud Event Intent @@ -61,7 +52,7 @@ Identifies the context in which an event happened. Often this will include infor ##### Kessel Inventory Intent Inventory-URI -### Attributes + #### Id (String) ##### Cloud Event Intent @@ -70,7 +61,7 @@ Identifies the event. Producers MUST ensure that source + id is unique for each ##### Kessel Inventory Intent inventory-api generated ID for the event -### Attributes + #### time (Timestamp) ##### Cloud Event Intent @@ -81,7 +72,7 @@ Timestamp of when the occurrence happened. If the time of the occurrence cannot ##### Kessel Inventory Intent last_reported from inventory-api -### Attributes + #### datacontenttype (String per RFC 2046) ##### Cloud Event Intent @@ -90,7 +81,7 @@ Content type of data value. This attribute enables data to carry any type of con ##### Kessel Inventory Intent "application/json" -### Attributes + #### data ##### Cloud Event Intent @@ -102,7 +93,7 @@ Payload will mimic the OpenAPI Specs for each method, i.e POST, PUT and DELETE. - reporter_data object - resource_data object or relationship_data object
The reporter_data will be the reporter who made the api call for which this event is referencing. -### Attributes + #### dataschema (URI) ##### Cloud Event Intent @@ -113,7 +104,7 @@ Identifies the schema that data adheres to. Incompatible changes to the schema S ##### Kessel Inventory Intent Not Used -### Attributes + #### subject (String) ##### Cloud Event Intent From 5cfac3c4f6c3b0a7af14468f924201544bc07758 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Thu, 19 Sep 2024 12:41:31 -0700 Subject: [PATCH 04/12] Apply suggestions from code review Co-authored-by: Naveen Malik --- src/content/docs/start-here/kafka-event.md | 108 ++++++++++++--------- 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index fa46f7e..9af690e 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -21,25 +21,24 @@ Same as above. This attribute contains a value describing the type of event related to the originating occurrence. Often this attribute is used for routing, observability, policy enforcement, etc. The format of this is producer defined and might include information such as the version of the type - see Versioning of CloudEvents in the Primer for more information. Constraints: - MUST be a non-empty string - SHOULD be prefixed with a reverse-DNS name. - - The prefixed domain dictates the organization which defines the semantics of this event type.
Examples: - ``` - com.github.pull_request.opened - com.example.object.deleted.v2 - ``` + - The prefixed domain dictates the organization which defines the semantics of this event type. + +Examples: +- `com.github.pull_request.opened` +- `com.example.object.deleted.v2` ##### Kessel Inventory Intent -We use a string comprised of __`redhat.inventory.resources.resource_type.operation`__ -``` -- redhat.inventory.resources.k8s-cluster.created -- redhat.inventory.resources.k8s-cluster.updated -- redhat.inventory.resources.k8s-cluster.deleted -``` -or
__`redhat.inventory.resource_relationships.relationship_type.operation`___ -``` -- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.created -- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.updated -- redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted -``` +We use a string comprised of _`redhat.inventory.resources.resource_type.operation`_ + +- `redhat.inventory.resources.k8s-cluster.created` +- `redhat.inventory.resources.k8s-cluster.updated` +- `redhat.inventory.resources.k8s-cluster.deleted` + +or _`redhat.inventory.resource_relationships.relationship_type.operation`_ + +- `redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.created` +- `redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.updated` +- `redhat.inventory.resources-relationship.k8s-policy_ispropagatedto_k8s-cluster.deleted` The only valid values for operation are created, updated or deleted. This allows a consumer to filter on method and/or resource type. @@ -47,7 +46,11 @@ The only valid values for operation are created, updated or deleted. This allows #### Source (URI) ##### Cloud Event Intent -Identifies the context in which an event happened. Often this will include information such as the type of the event source, the organization publishing the event or the process that produced the event. The exact syntax and semantics behind the data encoded in the URI is defined by the event producer.

Producers MUST ensure that source + id is unique for each distinct event.
An application MAY assign a unique source to each distinct producer, which makes it easy to produce unique IDs since no other producer will have the same source. The application MAY use UUIDs, URNs, DNS authorities or an application-specific scheme to create unique source identifiers. +Identifies the context in which an event happened. Often this will include information such as the type of the event source, the organization publishing the event or the process that produced the event. The exact syntax and semantics behind the data encoded in the URI is defined by the event producer. + +Producers MUST ensure that source + id is unique for each distinct event. + +An application MAY assign a unique source to each distinct producer, which makes it easy to produce unique IDs since no other producer will have the same source. The application MAY use UUIDs, URNs, DNS authorities or an application-specific scheme to create unique source identifiers. ##### Kessel Inventory Intent Inventory-URI @@ -65,7 +68,9 @@ inventory-api generated ID for the event #### time (Timestamp) ##### Cloud Event Intent -Timestamp of when the occurrence happened. If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer, however all producers for the same source MUST be consistent in this respect. In other words, either they all use the actual time of the occurrence or they all use the same algorithm to determine the value used.
Constraints: +Timestamp of when the occurrence happened. If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer, however all producers for the same source MUST be consistent in this respect. In other words, either they all use the actual time of the occurrence or they all use the same algorithm to determine the value used. + +Constraints: - OPTIONAL - If present, MUST adhere to the format specified in RFC 3339 @@ -91,13 +96,17 @@ The event payload. This specification does not place any restriction on the type Payload will mimic the OpenAPI Specs for each method, i.e POST, PUT and DELETE. The data object will contain the information about the resource, including - metadata object - reporter_data object -- resource_data object or relationship_data object
The reporter_data will be the reporter who made the api call for which this event is referencing. +- resource_data object or relationship_data object + +The reporter_data will be the reporter who made the api call for which this event is referencing. #### dataschema (URI) ##### Cloud Event Intent -Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI.
Constraints: +Identifies the schema that data adheres to. Incompatible changes to the schema SHOULD be reflected by a different URI. + +Constraints: - OPTIONAL - If present, MUST be a non-empty URI @@ -108,24 +117,27 @@ Not Used #### subject (String) ##### Cloud Event Intent -This describes the subject of the event in the context of the event producer (identified by source). In publish-subscribe scenarios, a subscriber will typically subscribe to events emitted by a source, but the source identifier alone might not be sufficient as a qualifier for any specific event if the source context has internal sub-structure.

Identifying the subject of the event in context metadata (opposed to only in the data payload) is particularly helpful in generic subscription filtering scenarios where middleware is unable to interpret the data content. In the above example, the subscriber might only be interested in blobs with names ending with '.jpg' or '.jpeg' and the subject attribute allows for constructing a simple and efficient string-suffix filter for that subset of events. +This describes the subject of the event in the context of the event producer (identified by source). In publish-subscribe scenarios, a subscriber will typically subscribe to events emitted by a source, but the source identifier alone might not be sufficient as a qualifier for any specific event if the source context has internal sub-structure. + +Identifying the subject of the event in context metadata (opposed to only in the data payload) is particularly helpful in generic subscription filtering scenarios where middleware is unable to interpret the data content. In the above example, the subscriber might only be interested in blobs with names ending with '.jpg' or '.jpeg' and the subject attribute allows for constructing a simple and efficient string-suffix filter for that subset of events. ##### Kessel Inventory Intent -We use a string composed of __`resources/resource_type/id where id is the ID of the resource created by the asset inventory service.`__
Example: -``` -/resources/k8s-cluster/A234-1234-1234 -``` - or
__`resource-relationships/relationship_type/id where id is the ID of the resource-relationship created by the asset inventory service`__
Example: - ``` - /resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234 - ``` +We use a string composed of _`resources/resource_type/id where id is the ID of the resource created by the asset inventory service.`_ + +Example: +- `/resources/k8s-cluster/A234-1234-1234` + +or _`resource-relationships/relationship_type/id`_ where id is the ID of the resource-relationship created by the asset inventory service. + +Example: +- `/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234` ## Examples ### Resources -### Create a Cluster -``` +#### Create a Cluster +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources.k8s-cluster.created, @@ -184,9 +196,9 @@ We use a string composed of __`resources/resource_type/id where id is the ID of ``` -### Update a Cluster +#### Update a Cluster -``` +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources.k8s-cluster.updated”, @@ -242,8 +254,8 @@ We use a string composed of __`resources/resource_type/id where id is the ID of } ``` -### Delete a Cluster -``` +#### Delete a Cluster +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources.k8s-cluster.deleted”, @@ -266,8 +278,8 @@ We use a string composed of __`resources/resource_type/id where id is the ID of ``` -### Create a Policy -``` +#### Create a Policy +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources.k8s-policy.created”, @@ -306,8 +318,8 @@ We use a string composed of __`resources/resource_type/id where id is the ID of } ``` -### Update a Policy -``` +#### Update a Policy +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources.k8s-policy.updated” @@ -346,8 +358,8 @@ We use a string composed of __`resources/resource_type/id where id is the ID of } ``` -### Delete a Policy -``` +#### Delete a Policy +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources.k8s-policy.deleted” @@ -373,8 +385,8 @@ We use a string composed of __`resources/resource_type/id where id is the ID of ### Resource Relationships -### Create a Relationship -``` +#### Create a Relationship +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.created”, @@ -407,8 +419,8 @@ We use a string composed of __`resources/resource_type/id where id is the ID of ``` -### Update a Relationship -``` +#### Update a Relationship +```json { "specversion" : "1.0", “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.updated”, @@ -441,8 +453,8 @@ We use a string composed of __`resources/resource_type/id where id is the ID of ``` -### Delete a Relationship -``` +#### Delete a Relationship +```json { "specversion" : "1.0", From b28d62fe46cc232195266a5c45e080219cdb08c4 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Thu, 19 Sep 2024 13:26:40 -0700 Subject: [PATCH 05/12] correct json format Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 172 ++++++++++----------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index 9af690e..b085583 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -140,7 +140,7 @@ Example: ```json { "specversion" : "1.0", - “type”: “redhat.inventory.resources.k8s-cluster.created, + "type": "redhat.inventory.resources.k8s-cluster.created", "source" : "inventory-api-uri", "id" : "A234-1234-1234", "subject": "/resources/k8s-cluster/A234-1234-1234", @@ -148,9 +148,9 @@ Example: "datacontenttype" : "application/json", "data" : { "metadata": { - “id” : “some id generated by inventory” - “resource_type” : “k8s-cluster” - “last_reported” : "2018-04-05T17:31:00Z", + "id" : "some id generated by inventory", + "resource_type" : "k8s-cluster", + "last_reported" : "2018-04-05T17:31:00Z", "workspace": "workspace name", "labels": [ { @@ -160,21 +160,21 @@ Example: ] }, "reporter_data": { - “reporter_instance_id” : “an id of the reporter” - “last_reported” : "2018-04-05T17:31:00Z", - "reporter_type": “REPORTER_TYPE_ACM”, - "console_href": "some https://referring the local-res-id", + "reporter_instance_id" : "an id of the reporter", + "last_reported" : "2018-04-05T17:31:00Z", + "reporter_type" : "REPORTER_TYPE_ACM", + "console_href" : "some https://referring the local-res-id", "api_href": "some https://referring the local-res-id", "local_resource_id": "id-as-supplied-by-reporter", "reporter_version": "2.12" }, "resource_data": { "external_cluster_id": "cluster-guid/ARN etc", - "cluster_status": “CLUSTER_STATUS_READY”, + "cluster_status": "CLUSTER_STATUS_READY", "kube_version": "v1.30.1", - "kube_vendor": “KUBE_VENDOR_OPENSHIFT”, + "kube_vendor": "KUBE_VENDOR_OPENSHIFT", "vendor_version": "4.16", - "cloud_platform": “CLOUD_PLATFORM_AWS_UPI”, + "cloud_platform": "CLOUD_PLATFORM_AWS_UPI", "nodes": [ { "name": "ip-10-0-0-1.ec2.internal", @@ -201,7 +201,7 @@ Example: ```json { "specversion" : "1.0", - “type”: “redhat.inventory.resources.k8s-cluster.updated”, + "type": "redhat.inventory.resources.k8s-cluster.updated", "source" : "inventory-api-uri", "id" : "A234-1234-1234", "subject": "/resources/k8s-cluster/A234-1234-1234", @@ -209,9 +209,9 @@ Example: "datacontenttype" : "application/json", "data" : { "metadata": { - “id” : “some id generated by inventory” - “resource_type” : “k8s-cluster” - “last_reported” : "2018-04-05T17:31:00Z", + "id" : "some id generated by inventory", + "resource_type" : "k8s-cluster", + "last_reported" : "2018-04-05T17:31:00Z", "workspace": "workspace name", "labels": [ { @@ -221,9 +221,9 @@ Example: ] }, "reporter_data": { - “reporter_instance_id” : “an id of the reporter” - “last_reported” : "2018-04-05T17:31:00Z", - "reporter_type": “REPORTER_TYPE_ACM”, + "reporter_instance_id" : "an id of the reporter", + "last_reported" : "2018-04-05T17:31:00Z", + "reporter_type": "REPORTER_TYPE_ACM", "console_href": "some https://referring the local-res-id", "api_href": "some https://referring the local-res-id", "local_resource_id": "id-as-supplied-by-reporter", @@ -231,11 +231,11 @@ Example: }, "resource_data": { "external_cluster_id": "cluster-guid/ARN etc", - "cluster_status": “CLUSTER_STATUS_READY”, + "cluster_status": "CLUSTER_STATUS_READY", "kube_version": "v1.30.1", - "kube_vendor": “KUBE_VENDOR_OPENSHIFT”, + "kube_vendor": "KUBE_VENDOR_OPENSHIFT", "vendor_version": "4.16", - "cloud_platform": “CLOUD_PLATFORM_AWS_UPI”, + "cloud_platform": "CLOUD_PLATFORM_AWS_UPI", "nodes": [ { "name": "ip-10-0-0-1.ec2.internal", @@ -258,7 +258,7 @@ Example: ```json { "specversion" : "1.0", - “type”: “redhat.inventory.resources.k8s-cluster.deleted”, + "type": "redhat.inventory.resources.k8s-cluster.deleted", "source" : "inventory-api-uri", "id" : "A234-1234-1234", "subject": "/resources/k8s-cluster/A234-1234-1234", @@ -266,11 +266,11 @@ Example: "datacontenttype" : "application/json", "data" : { "metadata": { - “id” : “some id generated by inventory” + "id" : "some id generated by inventory" }, "reporter_data": { - “reporter_instance_id” : “an id of the reporter” - "reporter_type": “ACM”, + "reporter_instance_id" : "an id of the reporter", + "reporter_type": "ACM", "local_resource_id": "id-as-supplied-by-reporter", } } @@ -281,17 +281,17 @@ Example: #### Create a Policy ```json { - "specversion" : "1.0", - “type”: “redhat.inventory.resources.k8s-policy.created”, - "source" : "inventory-api-uri", - "id" : "A234-1234-1234", - "subject": "/resources/k8s-policy/A234-1234-1234", - "time" : "2018-04-05T17:31:00Z", - "datacontenttype" : "application/json", - "data" :{ + "specversion" : "1.0", + "type": "redhat.inventory.resources.k8s-policy.created", + "source" : "inventory-api-uri", + "id" : "A234-1234-1234", + "subject": "/resources/k8s-policy/A234-1234-1234", + "time" : "2018-04-05T17:31:00Z", + "datacontenttype" : "application/json", + "data" : { "metadata": { - "id": “some id generated by inventory”, - "resource_type": “k8s-policy”, + "id": "some id generated by inventory", + "resource_type": "k8s-policy", "last_reported": “2018-04-05T17:31:00Z”, "workspace": "workspace name", "labels": [ @@ -301,19 +301,19 @@ Example: } ] }, - "reporter_data": { - “reporter_instance_id” : “an id of the reporter” - “last_reported” : "2018-04-05T17:31:00Z", - "reporter_type": “REPORTER_TYPE_ACM”, - "console_href": "some https://referring the local-res-id", - "api_href": "some https://referring the local-res-id", - "local_resource_id": "id-as-supplied-by-reporter", - "reporter_version": "2.12" + "reporter_data": { + "reporter_instance_id" : "an id of the reporter", + "last_reported" : "2018-04-05T17:31:00Z", + "reporter_type": "REPORTER_TYPE_ACM", + "console_href": "some https://referring the local-res-id", + "api_href": "some https://referring the local-res-id", + "local_resource_id": "id-as-supplied-by-reporter", + "reporter_version": "2.12" }, - "resource_data": { - "Disabled": “False” - "severity": “SEVERITY_LOW” - } + "resource_data": { + "Disabled": "False", + "severity": "SEVERITY_LOW" + } } } ``` @@ -322,7 +322,7 @@ Example: ```json { "specversion" : "1.0", - “type”: “redhat.inventory.resources.k8s-policy.updated” + "type": "redhat.inventory.resources.k8s-policy.updated", "source" : "inventory-api-uri", "id" : "A234-1234-1234", "subject": "/resources/k8s-policy/A234-1234-1234", @@ -330,9 +330,9 @@ Example: "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": “some id generated by inventory”, - "resource_type": “k8s-policy”, - "last_reported": “2018-04-05T17:31:00Z”, + "id": "some id generated by inventory", + "resource_type": "k8s-policy", + "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", "labels": [ { @@ -342,17 +342,17 @@ Example: ] }, "reporter_data": { - “reporter_instance_id” : “an id of the reporter” - “last_reported” : "2018-04-05T17:31:00Z", - "reporter_type": “REPORTER_TYPE_ACM”, + "reporter_instance_id" : "an id of the reporter", + "last_reported" : "2018-04-05T17:31:00Z", + "reporter_type": "REPORTER_TYPE_ACM", "console_href": "some https://referring the local-res-id", "api_href": "some https://referring the local-res-id", "local_resource_id": "id-as-supplied-by-reporter", "reporter_version": "2.12" }, "resource_data": { - "Disabled": “False” - "severity": “SEVERITY_LOW” + "Disabled": "False", + "severity": "SEVERITY_LOW" } } } @@ -362,7 +362,7 @@ Example: ```json { "specversion" : "1.0", - “type”: “redhat.inventory.resources.k8s-policy.deleted” + "type": "redhat.inventory.resources.k8s-policy.deleted", "source" : "inventory-api-uri", "id" : "A234-1234-1234", "subject": "/resources/k8s-policy/A234-1234-1234", @@ -370,13 +370,13 @@ Example: "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": “some id generated by inventory”, - "resource_type": “k8s-policy”, + "id": "some id generated by inventory", + "resource_type": "k8s-policy", "workspace": "workspace name", }, "reporter_data": { - "reporter_instance_id": “an id of the reporter” , - "reporter_type": “ACM”, + "reporter_instance_id": "an id of the reporter" , + "reporter_type": "ACM", "local_resource_id": "id-as-supplied-by-reporter" } } @@ -389,30 +389,30 @@ Example: ```json { "specversion" : "1.0", - “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.created”, + "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.created", "source": "inventory-api-uri", "id": "A234-1234-1234", - "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234, + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ "metadata": { - “id": “some id generated by inventory”, - "relationship_type": “k8s-policy_is-propagated-to_k8s-cluster”, - "last_reported": “2018-04-05T17:31:00Z”, + "id": "some id generated by inventory", + "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", + "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", }, "reporter_data": { - "reporter_type": “ACM”, + "reporter_type": "ACM", "subject_local_resource_id": "policy-id-as-supplied-by-reporter", "object_local_resource_id": "cluster-id-as-supplied-by-reporter", "reporter_version": "2.12", - “reporter_instance_id”: “an id of the reporter”, + "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": “COMPLIANT”, + "status": "COMPLIANT”, “k8s_policy_id”: “id-in-inventory”, - “k8s_cluster_id”: “id-in-inventory”, + “k8s_cluster_id”: “id-in-inventory", } } } @@ -423,30 +423,30 @@ Example: ```json { "specversion" : "1.0", - “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.updated”, + "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.updated", "source": "inventory-api-uri", "id": "A234-1234-1234", - "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234, + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ "metadata": { - “id": “some id generated by inventory”, - "relationship_type": “k8s-policy_is-propagated-to_k8s-cluster”, - "last_reported": “2018-04-05T17:31:00Z”, + "id": "some id generated by inventory", + "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", + "last_reported": “2018-04-05T17:31:00Z”, "workspace": "workspace name", }, "reporter_data": { - "reporter_type": “ACM”, + "reporter_type": "ACM", "subject_local_resource_id": "policy-id-as-supplied-by-reporter", "object_local_resource_id": "cluster-id-as-supplied-by-reporter", "reporter_version": "2.12", - “reporter_instance_id”: “an id of the reporter”, + "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": “COMPLIANT”, + "status": "COMPLIANT”, “k8s_policy_id”: “id-in-inventory”, - “k8s_cluster_id”: “id-in-inventory”, + “k8s_cluster_id”: “id-in-inventory", } } } @@ -458,24 +458,24 @@ Example: { "specversion" : "1.0", - “type”: “redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.deleted”, + "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.deleted", "source": "inventory-api-uri", "id": "A234-1234-1234", - "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234, + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ - "metadata": { - “id": “some id generated by inventory”, - "relationship_type": “k8s-policy_is-propagated-to_k8s-cluster”, + "metadata": { + "id": "some id generated by inventory", + "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", "workspace": "workspace name", }, "reporter_data": { - "reporter_type": “ACM”, + "reporter_type": "ACM", "subject_local_resource_id": "policy-id-as-supplied-by-reporter", "object_local_resource_id": "cluster-id-as-supplied-by-reporter", "reporter_version": "2.12", - “reporter_instance_id”: “an id of the reporter”, + "reporter_instance_id": "an id of the reporter", } } } From add062fa9eb47bb14b55befc96a9a6e1d3844653 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Thu, 19 Sep 2024 13:35:50 -0700 Subject: [PATCH 06/12] correct json format Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index b085583..44c9f3a 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -292,7 +292,7 @@ Example: "metadata": { "id": "some id generated by inventory", "resource_type": "k8s-policy", - "last_reported": “2018-04-05T17:31:00Z”, + "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", "labels": [ { @@ -433,7 +433,7 @@ Example: "metadata": { "id": "some id generated by inventory", "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", - "last_reported": “2018-04-05T17:31:00Z”, + "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", }, "reporter_data": { From b757ee0d486efa432706828f73e00a87008a3ee0 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Thu, 19 Sep 2024 13:37:49 -0700 Subject: [PATCH 07/12] correct json format Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index 44c9f3a..224d87a 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -410,9 +410,9 @@ Example: "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": "COMPLIANT”, - “k8s_policy_id”: “id-in-inventory”, - “k8s_cluster_id”: “id-in-inventory", + "status": "COMPLIANT", + "k8s_policy_id": "id-in-inventory", + "k8s_cluster_id": "id-in-inventory", } } } @@ -444,9 +444,9 @@ Example: "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": "COMPLIANT”, - “k8s_policy_id”: “id-in-inventory”, - “k8s_cluster_id”: “id-in-inventory", + "status": "COMPLIANT", + "k8s_policy_id": "id-in-inventory", + "k8s_cluster_id": "id-in-inventory", } } } From bf75f957c686d0fadb1b911db06e55d921479a40 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Fri, 20 Sep 2024 10:16:31 -0700 Subject: [PATCH 08/12] differentiating the id values for clarity Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index 224d87a..088c38a 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -142,7 +142,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources.k8s-cluster.created", "source" : "inventory-api-uri", - "id" : "A234-1234-1234", + "id" : "Z789-6789-67894", "subject": "/resources/k8s-cluster/A234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -203,7 +203,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources.k8s-cluster.updated", "source" : "inventory-api-uri", - "id" : "A234-1234-1234", + "id" : "Z789-6789-67895", "subject": "/resources/k8s-cluster/A234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -260,7 +260,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources.k8s-cluster.deleted", "source" : "inventory-api-uri", - "id" : "A234-1234-1234", + "id" : "Z789-6789-67896", "subject": "/resources/k8s-cluster/A234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -284,7 +284,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources.k8s-policy.created", "source" : "inventory-api-uri", - "id" : "A234-1234-1234", + "id" : "Z789-6789-67891", "subject": "/resources/k8s-policy/A234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -324,7 +324,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources.k8s-policy.updated", "source" : "inventory-api-uri", - "id" : "A234-1234-1234", + "id" : "Z789-6789-67892", "subject": "/resources/k8s-policy/A234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -364,7 +364,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources.k8s-policy.deleted", "source" : "inventory-api-uri", - "id" : "A234-1234-1234", + "id" : "Z789-6789-67893", "subject": "/resources/k8s-policy/A234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -391,7 +391,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.created", "source": "inventory-api-uri", - "id": "A234-1234-1234", + "id": "Z789-6789-678944", "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -425,7 +425,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.updated", "source": "inventory-api-uri", - "id": "A234-1234-1234", + "id": "Z789-6789-678945", "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", @@ -460,7 +460,7 @@ Example: "specversion" : "1.0", "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.deleted", "source": "inventory-api-uri", - "id": "A234-1234-1234", + "id": "Z789-6789-678946", "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", From 5a0c0d0fe409f6d695532708de0be5b510b48328 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Fri, 20 Sep 2024 10:56:47 -0700 Subject: [PATCH 09/12] differentiating the id values for clarity and fixed enums Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index 088c38a..dc8325c 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -148,7 +148,7 @@ Example: "datacontenttype" : "application/json", "data" : { "metadata": { - "id" : "some id generated by inventory", + "id" : "A234-1234-1234", "resource_type" : "k8s-cluster", "last_reported" : "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -162,7 +162,7 @@ Example: "reporter_data": { "reporter_instance_id" : "an id of the reporter", "last_reported" : "2018-04-05T17:31:00Z", - "reporter_type" : "REPORTER_TYPE_ACM", + "reporter_type" : "ACM", "console_href" : "some https://referring the local-res-id", "api_href": "some https://referring the local-res-id", "local_resource_id": "id-as-supplied-by-reporter", @@ -170,11 +170,11 @@ Example: }, "resource_data": { "external_cluster_id": "cluster-guid/ARN etc", - "cluster_status": "CLUSTER_STATUS_READY", + "cluster_status": "READY", "kube_version": "v1.30.1", - "kube_vendor": "KUBE_VENDOR_OPENSHIFT", + "kube_vendor": "OPENSHIFT", "vendor_version": "4.16", - "cloud_platform": "CLOUD_PLATFORM_AWS_UPI", + "cloud_platform": "AWS_UPI", "nodes": [ { "name": "ip-10-0-0-1.ec2.internal", @@ -209,7 +209,7 @@ Example: "datacontenttype" : "application/json", "data" : { "metadata": { - "id" : "some id generated by inventory", + "id" : "A234-1234-1234", "resource_type" : "k8s-cluster", "last_reported" : "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -223,7 +223,7 @@ Example: "reporter_data": { "reporter_instance_id" : "an id of the reporter", "last_reported" : "2018-04-05T17:31:00Z", - "reporter_type": "REPORTER_TYPE_ACM", + "reporter_type": "ACM", "console_href": "some https://referring the local-res-id", "api_href": "some https://referring the local-res-id", "local_resource_id": "id-as-supplied-by-reporter", @@ -231,11 +231,11 @@ Example: }, "resource_data": { "external_cluster_id": "cluster-guid/ARN etc", - "cluster_status": "CLUSTER_STATUS_READY", + "cluster_status": "READY", "kube_version": "v1.30.1", - "kube_vendor": "KUBE_VENDOR_OPENSHIFT", + "kube_vendor": "OPENSHIFT", "vendor_version": "4.16", - "cloud_platform": "CLOUD_PLATFORM_AWS_UPI", + "cloud_platform": "AWS_UPI", "nodes": [ { "name": "ip-10-0-0-1.ec2.internal", @@ -266,7 +266,7 @@ Example: "datacontenttype" : "application/json", "data" : { "metadata": { - "id" : "some id generated by inventory" + "id" : "A234-1234-1234" }, "reporter_data": { "reporter_instance_id" : "an id of the reporter", @@ -290,7 +290,7 @@ Example: "datacontenttype" : "application/json", "data" : { "metadata": { - "id": "some id generated by inventory", + "id": "A234-1234-1234", "resource_type": "k8s-policy", "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -304,7 +304,7 @@ Example: "reporter_data": { "reporter_instance_id" : "an id of the reporter", "last_reported" : "2018-04-05T17:31:00Z", - "reporter_type": "REPORTER_TYPE_ACM", + "reporter_type": "ACM", "console_href": "some https://referring the local-res-id", "api_href": "some https://referring the local-res-id", "local_resource_id": "id-as-supplied-by-reporter", @@ -312,7 +312,7 @@ Example: }, "resource_data": { "Disabled": "False", - "severity": "SEVERITY_LOW" + "severity": "LOW" } } } @@ -330,7 +330,7 @@ Example: "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": "some id generated by inventory", + "id": "A234-1234-1234", "resource_type": "k8s-policy", "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -344,7 +344,7 @@ Example: "reporter_data": { "reporter_instance_id" : "an id of the reporter", "last_reported" : "2018-04-05T17:31:00Z", - "reporter_type": "REPORTER_TYPE_ACM", + "reporter_type": "ACM", "console_href": "some https://referring the local-res-id", "api_href": "some https://referring the local-res-id", "local_resource_id": "id-as-supplied-by-reporter", @@ -352,7 +352,7 @@ Example: }, "resource_data": { "Disabled": "False", - "severity": "SEVERITY_LOW" + "severity": "LOW" } } } @@ -370,7 +370,7 @@ Example: "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": "some id generated by inventory", + "id": "A234-1234-1234", "resource_type": "k8s-policy", "workspace": "workspace name", }, @@ -397,7 +397,7 @@ Example: "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": "some id generated by inventory", + "id": "A234-1234-1234", "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -410,7 +410,7 @@ Example: "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": "COMPLIANT", + "status": "NO_VIOLATION", "k8s_policy_id": "id-in-inventory", "k8s_cluster_id": "id-in-inventory", } @@ -431,7 +431,7 @@ Example: "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": "some id generated by inventory", + "id": "A234-1234-1234", "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -444,7 +444,7 @@ Example: "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": "COMPLIANT", + "status": "NO_VIOLATION", "k8s_policy_id": "id-in-inventory", "k8s_cluster_id": "id-in-inventory", } @@ -466,7 +466,7 @@ Example: "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": "some id generated by inventory", + "id": "A234-1234-1234", "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", "workspace": "workspace name", }, From 8b426fee4a26438f7b974d46e15ef7892f3f7995 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Fri, 20 Sep 2024 11:05:38 -0700 Subject: [PATCH 10/12] differentiating the id values for clarity and fixed enums Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index dc8325c..27552a4 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -410,7 +410,7 @@ Example: "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": "NO_VIOLATION", + "status": "NO_VIOLATIONS", "k8s_policy_id": "id-in-inventory", "k8s_cluster_id": "id-in-inventory", } @@ -444,7 +444,7 @@ Example: "reporter_instance_id": "an id of the reporter", }, "relationship_data": { - "status": "NO_VIOLATION", + "status": "NO_VIOLATIONS", "k8s_policy_id": "id-in-inventory", "k8s_cluster_id": "id-in-inventory", } From f8729bb001244dc757cb3574057aadebca8f8dd1 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Fri, 20 Sep 2024 11:31:59 -0700 Subject: [PATCH 11/12] differentiating the id values to explain relationships better Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index 27552a4..dfc1623 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -285,12 +285,12 @@ Example: "type": "redhat.inventory.resources.k8s-policy.created", "source" : "inventory-api-uri", "id" : "Z789-6789-67891", - "subject": "/resources/k8s-policy/A234-1234-1234", + "subject": "/resources/k8s-policy/B234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" : { "metadata": { - "id": "A234-1234-1234", + "id": "B234-1234-1234", "resource_type": "k8s-policy", "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -325,12 +325,12 @@ Example: "type": "redhat.inventory.resources.k8s-policy.updated", "source" : "inventory-api-uri", "id" : "Z789-6789-67892", - "subject": "/resources/k8s-policy/A234-1234-1234", + "subject": "/resources/k8s-policy/B234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": "A234-1234-1234", + "id": "B234-1234-1234", "resource_type": "k8s-policy", "last_reported": "2018-04-05T17:31:00Z", "workspace": "workspace name", @@ -365,12 +365,12 @@ Example: "type": "redhat.inventory.resources.k8s-policy.deleted", "source" : "inventory-api-uri", "id" : "Z789-6789-67893", - "subject": "/resources/k8s-policy/A234-1234-1234", + "subject": "/resources/k8s-policy/B234-1234-1234", "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ "metadata": { - "id": "A234-1234-1234", + "id": "B234-1234-1234", "resource_type": "k8s-policy", "workspace": "workspace name", }, @@ -411,8 +411,8 @@ Example: }, "relationship_data": { "status": "NO_VIOLATIONS", - "k8s_policy_id": "id-in-inventory", - "k8s_cluster_id": "id-in-inventory", + "k8s_policy_id": "B234-1234-1234", + "k8s_cluster_id": "A234-1234-1234", } } } @@ -445,8 +445,8 @@ Example: }, "relationship_data": { "status": "NO_VIOLATIONS", - "k8s_policy_id": "id-in-inventory", - "k8s_cluster_id": "id-in-inventory", + "k8s_policy_id": "B234-1234-1234", + "k8s_cluster_id": "A234-1234-1234", } } } From c151863542b992f2d590817a50443d0aef6b41f6 Mon Sep 17 00:00:00 2001 From: Joydeep Banerjee Date: Fri, 20 Sep 2024 11:49:01 -0700 Subject: [PATCH 12/12] differentiating the id values to explain relationships better Signed-off-by: Joydeep Banerjee --- src/content/docs/start-here/kafka-event.md | 174 ++++++++++----------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/src/content/docs/start-here/kafka-event.md b/src/content/docs/start-here/kafka-event.md index dfc1623..ea8a572 100644 --- a/src/content/docs/start-here/kafka-event.md +++ b/src/content/docs/start-here/kafka-event.md @@ -272,7 +272,7 @@ Example: "reporter_instance_id" : "an id of the reporter", "reporter_type": "ACM", "local_resource_id": "id-as-supplied-by-reporter", - } + } } } @@ -329,31 +329,31 @@ Example: "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ - "metadata": { - "id": "B234-1234-1234", - "resource_type": "k8s-policy", - "last_reported": "2018-04-05T17:31:00Z", - "workspace": "workspace name", - "labels": [ - { - "key": "apps.open-cluster-management.io/reconcile-rate", - "value": "high" - } - ] - }, - "reporter_data": { - "reporter_instance_id" : "an id of the reporter", - "last_reported" : "2018-04-05T17:31:00Z", - "reporter_type": "ACM", - "console_href": "some https://referring the local-res-id", - "api_href": "some https://referring the local-res-id", - "local_resource_id": "id-as-supplied-by-reporter", - "reporter_version": "2.12" - }, - "resource_data": { - "Disabled": "False", - "severity": "LOW" - } + "metadata": { + "id": "B234-1234-1234", + "resource_type": "k8s-policy", + "last_reported": "2018-04-05T17:31:00Z", + "workspace": "workspace name", + "labels": [ + { + "key": "apps.open-cluster-management.io/reconcile-rate", + "value": "high" + } + ] + }, + "reporter_data": { + "reporter_instance_id" : "an id of the reporter", + "last_reported" : "2018-04-05T17:31:00Z", + "reporter_type": "ACM", + "console_href": "some https://referring the local-res-id", + "api_href": "some https://referring the local-res-id", + "local_resource_id": "id-as-supplied-by-reporter", + "reporter_version": "2.12" + }, + "resource_data": { + "Disabled": "False", + "severity": "LOW" + } } } ``` @@ -369,16 +369,16 @@ Example: "time" : "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ - "metadata": { - "id": "B234-1234-1234", - "resource_type": "k8s-policy", - "workspace": "workspace name", - }, - "reporter_data": { - "reporter_instance_id": "an id of the reporter" , - "reporter_type": "ACM", - "local_resource_id": "id-as-supplied-by-reporter" - } + "metadata": { + "id": "B234-1234-1234", + "resource_type": "k8s-policy", + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_instance_id": "an id of the reporter" , + "reporter_type": "ACM", + "local_resource_id": "id-as-supplied-by-reporter" + } } } ``` @@ -392,28 +392,28 @@ Example: "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.created", "source": "inventory-api-uri", "id": "Z789-6789-678944", - "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/C234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ - "metadata": { - "id": "A234-1234-1234", - "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", - "last_reported": "2018-04-05T17:31:00Z", - "workspace": "workspace name", - }, - "reporter_data": { - "reporter_type": "ACM", - "subject_local_resource_id": "policy-id-as-supplied-by-reporter", - "object_local_resource_id": "cluster-id-as-supplied-by-reporter", - "reporter_version": "2.12", - "reporter_instance_id": "an id of the reporter", - }, - "relationship_data": { - "status": "NO_VIOLATIONS", - "k8s_policy_id": "B234-1234-1234", - "k8s_cluster_id": "A234-1234-1234", - } + "metadata": { + "id": "C234-1234-1234", + "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", + "last_reported": "2018-04-05T17:31:00Z", + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_type": "ACM", + "subject_local_resource_id": "policy-id-as-supplied-by-reporter", + "object_local_resource_id": "cluster-id-as-supplied-by-reporter", + "reporter_version": "2.12", + "reporter_instance_id": "an id of the reporter", + }, + "relationship_data": { + "status": "NO_VIOLATIONS", + "k8s_policy_id": "B234-1234-1234", + "k8s_cluster_id": "A234-1234-1234", + } } } ``` @@ -426,28 +426,28 @@ Example: "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.updated", "source": "inventory-api-uri", "id": "Z789-6789-678945", - "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/C234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", "data" :{ - "metadata": { - "id": "A234-1234-1234", - "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", - "last_reported": "2018-04-05T17:31:00Z", - "workspace": "workspace name", - }, - "reporter_data": { - "reporter_type": "ACM", - "subject_local_resource_id": "policy-id-as-supplied-by-reporter", - "object_local_resource_id": "cluster-id-as-supplied-by-reporter", - "reporter_version": "2.12", - "reporter_instance_id": "an id of the reporter", - }, - "relationship_data": { - "status": "NO_VIOLATIONS", - "k8s_policy_id": "B234-1234-1234", - "k8s_cluster_id": "A234-1234-1234", - } + "metadata": { + "id": "C234-1234-1234", + "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", + "last_reported": "2018-04-05T17:31:00Z", + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_type": "ACM", + "subject_local_resource_id": "policy-id-as-supplied-by-reporter", + "object_local_resource_id": "cluster-id-as-supplied-by-reporter", + "reporter_version": "2.12", + "reporter_instance_id": "an id of the reporter", + }, + "relationship_data": { + "status": "NO_VIOLATIONS", + "k8s_policy_id": "B234-1234-1234", + "k8s_cluster_id": "A234-1234-1234", + } } } ``` @@ -461,21 +461,21 @@ Example: "type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.deleted", "source": "inventory-api-uri", "id": "Z789-6789-678946", - "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/A234-1234-1234", + "subject": "/resources-relationships/k8s-policy_is-propagated-to_k8s-cluster/C234-1234-1234", "time": "2018-04-05T17:31:00Z", "datacontenttype" : "application/json", - "data" :{ - "metadata": { - "id": "A234-1234-1234", - "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", - "workspace": "workspace name", - }, - "reporter_data": { - "reporter_type": "ACM", - "subject_local_resource_id": "policy-id-as-supplied-by-reporter", - "object_local_resource_id": "cluster-id-as-supplied-by-reporter", - "reporter_version": "2.12", - "reporter_instance_id": "an id of the reporter", + "data" :{ + "metadata": { + "id": "C234-1234-1234", + "relationship_type": "k8s-policy_is-propagated-to_k8s-cluster", + "workspace": "workspace name", + }, + "reporter_data": { + "reporter_type": "ACM", + "subject_local_resource_id": "policy-id-as-supplied-by-reporter", + "object_local_resource_id": "cluster-id-as-supplied-by-reporter", + "reporter_version": "2.12", + "reporter_instance_id": "an id of the reporter", } } }