Skip to content

Commit

Permalink
Merge pull request #6 from project-kessel/multiple-changes
Browse files Browse the repository at this point in the history
updated doc
  • Loading branch information
randymgeorge authored Oct 16, 2024
2 parents 4a0168c + 41f6c03 commit b7ecb1c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 35 deletions.
49 changes: 31 additions & 18 deletions src/content/docs/start-here/inventory-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,36 @@ The request body is the resource type. This top level json object is comprised o
Required data is marked with an asterisk (*).

#### Metadata
This object represents the attributes that are common for all resources, no matter the type. Most of the metadata is generated by the Asset Inventory service, i.e.
This object represents the attributes that are common for all resources, no matter the type. The information that a reporter provides for this object is:
- ___org_id*___
- ___workspace_id___
- ___labels___

Most of the metadata is generated by the Asset Inventory service, i.e.
- ___id___ - this is the GUID for the resource instance
- ___resource_type___ - this is derived from the top level object of the request body.
- ___first_reported___
- ___last_reported___
- ___first_reported_by___
- ___last_reported_by___

The only metadata that a Reporter can provide is:
- ___workspace*___
- ___labels___
#### Reporter_data
- ___created_at___
- ___updated_at___
- ___deleted_at___

#### Reporter_data
This object represents data that is specific to the reporter who called the Asset Inventory API in order to report on this resource. The information that a reporter provides for this object is:
- ___reporter_type*___
- ___reporter_version___
- ___local_resource_id*___
- ___console_href___
- ___api_href___

Similar to the metadata, some of this information is created by the Asset Inventory service, i.e.
- ___reporter_instance_id___ - created from attributes in the authentication token


The _reporter_type_ and _reporter_version_, along with the system generated _reporter_instance_id_, help to identify the reporter.

The _local_resource_id_ is the identification of the resource within the Reporter’s domain.

The two hrefs are used if a consumer of an event (or query) from Asset Inventory and they wanted to consume additional domain-specific information about the resource. For example, ACM reports on a cluster. One could use an href to query into ACM to find out some health information of that cluster.
<br><br>NOTE: These hrefs only provide how to access this information. One still has to have the appropriate credentials of the Reporter in order to access the data referenced by these URLs.
<br><br>
Similar to the metadata, some of this information is created by the Asset Inventory service, i.e.
- ___reporter_instance_id___ - created from attributes in the authentication token
- ___first_reported___
- ___last_reported___


##### Multiple Reporters
Expand Down Expand Up @@ -129,16 +128,30 @@ The JSON for the resource-relationship is similar to resources, i.e.
```

#### Metadata
The metadata differs in that all of the metadata is generated by the Asset Inventory service.
This object represents the attributes that are common for all resource relationships, no matter the type. The information that a reporter provides for this object is:
- ___org_id*___

Most of the metadata is generated by the Asset Inventory service, i.e.
- ___id___ - this is the GUID for the relationship instance
- ___relationship_type___ - this is derived from the top level object of the request body.
- ___created_at___
- ___updated_at___
- ___deleted_at___

#### Reporter_data
The report_data differs in that there are no hrefs provided for the relationship. In addition, the Reporter must pass a _local_resource_id_ for both the subject and the object resources in the relationship.
This object represents data that is specific to the reporter who called the Asset Inventory API in order to report on this relationship. The report_data differs in that there are no hrefs provided for the relationship. In addition, the Reporter must pass a _local_resource_id_ for both the subject and the object resources in the relationship.

- ___reporter_type___
- ___reporter_type*___
- ___reporter_version___
- ___subject_local_resource_id*___
- ___object_local_resource_id*___

Similar to the metadata, some of this information is created by the Asset Inventory service, i.e.
- ___reporter_instance_id___ - created from attributes in the authentication token


#### Reporter_data

##### Multiple Reporters
The semantics of multiple reporters is the same as with resources.

Expand Down
42 changes: 25 additions & 17 deletions src/content/docs/start-here/kafka-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ Example:
"data" : {
"metadata": {
"id" : "A234-1234-1234",
"org_id" : "IdP's id for the organization",
"resource_type" : "k8s-cluster",
"last_reported" : "2018-04-05T17:31:00Z",
"workspace": "workspace name",
"created_at" : "2018-04-05T17:31:00Z",
"workspace_id": "id of the workspace",
"labels": [
{
"key": "env",
Expand All @@ -161,7 +162,6 @@ Example:
},
"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",
Expand Down Expand Up @@ -209,10 +209,11 @@ Example:
"datacontenttype" : "application/json",
"data" : {
"metadata": {
"id" : "A234-1234-1234",
"id" : "A234-1234-1234",
"org_id" : "IdP's id for the organization",
"resource_type" : "k8s-cluster",
"last_reported" : "2018-04-05T17:31:00Z",
"workspace": "workspace name",
"updated_at" : "2018-04-05T17:31:00Z",
"workspace_id": "id of the workspace",
"labels": [
{
"key": "env",
Expand All @@ -222,7 +223,6 @@ Example:
},
"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",
Expand Down Expand Up @@ -266,7 +266,10 @@ Example:
"datacontenttype" : "application/json",
"data" : {
"metadata": {
"id" : "A234-1234-1234"
"id" : "A234-1234-1234"
"org_id" : "IdP's id for the organization",
"resource_type" : "k8s-cluster",
"deleted_at" : "2018-04-05T17:31:00Z"
},
"reporter_data": {
"reporter_instance_id" : "an id of the reporter",
Expand All @@ -291,9 +294,10 @@ Example:
"data" : {
"metadata": {
"id": "B234-1234-1234",
"org_id" : "IdP's id for the organization",
"resource_type": "k8s-policy",
"last_reported": "2018-04-05T17:31:00Z",
"workspace": "workspace name",
"created_at": "2018-04-05T17:31:00Z",
"workspace_id": "id of the workspace",
"labels": [
{
"key": "apps.open-cluster-management.io/reconcile-rate",
Expand All @@ -303,7 +307,6 @@ Example:
},
"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",
Expand Down Expand Up @@ -331,9 +334,10 @@ Example:
"data" :{
"metadata": {
"id": "B234-1234-1234",
"org_id" : "IdP's id for the organization",
"resource_type": "k8s-policy",
"last_reported": "2018-04-05T17:31:00Z",
"workspace": "workspace name",
"updated_at": "2018-04-05T17:31:00Z",
"workspace_id": "id of the workspace",
"labels": [
{
"key": "apps.open-cluster-management.io/reconcile-rate",
Expand All @@ -343,7 +347,6 @@ Example:
},
"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",
Expand Down Expand Up @@ -371,8 +374,9 @@ Example:
"data" :{
"metadata": {
"id": "B234-1234-1234",
"org_id" : "IdP's id for the organization",
"resource_type": "k8s-policy",
"workspace": "workspace name"
"deleted_at" : "2018-04-05T17:31:00Z"
},
"reporter_data": {
"reporter_instance_id": "an id of the reporter",
Expand All @@ -398,8 +402,9 @@ Example:
"data" :{
"metadata": {
"id": "C234-1234-1234",
"org_id" : "IdP's id for the organization",
"relationship_type": "k8s-policy_is-propagated-to_k8s-cluster",
"last_reported": "2018-04-05T17:31:00Z"
"created_at": "2018-04-05T17:31:00Z"
},
"reporter_data": {
"reporter_type": "ACM",
Expand All @@ -425,14 +430,15 @@ Example:
"type": "redhat.inventory.resources_relationship.k8s-policy_is-propagated-to_k8s-cluster.updated",
"source": "inventory-api-uri",
"id": "Z789-6789-678945",
"org_id" : "IdP's id for the organization",
"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": "C234-1234-1234",
"relationship_type": "k8s-policy_is-propagated-to_k8s-cluster",
"last_reported": "2018-04-05T17:31:00Z"
"updated_at": "2018-04-05T17:31:00Z"
},
"reporter_data": {
"reporter_type": "ACM",
Expand Down Expand Up @@ -465,7 +471,9 @@ Example:
"data" :{
"metadata": {
"id": "C234-1234-1234",
"org_id" : "IdP's id for the organization",
"relationship_type": "k8s-policy_is-propagated-to_k8s-cluster",
"deleted_at" : "2018-04-05T17:31:00Z"
},
"reporter_data": {
"reporter_type": "ACM",
Expand Down

0 comments on commit b7ecb1c

Please sign in to comment.