Resource Service

This service groups the requests associated with remote Resource access and verification.

1 2 3 4 5 service ResourceService { rpc Get(SignedGetRequest) returns (SignedGetResponse) {} rpc Share (SignedResourceMetadataRequest) returns (SignedShareResourceResponse) {} rpc Verify(SignedVerifyRequest) return (SignedVerifyResponse) {} }

Get Resource

The Get Resource task is a request to read (Get) a resource data from a remote Node. The requested resource is identified in the params field. A resource includes a version field which correspond to the version of the resource data, every change in the content of the data will increment the resource version.

Request Message

The message identify the resource this Node is requesting information for. Multiple resources can be requested from the same Organization. If an Organization receives a request to Get resource it does not manage, it ignores them returning only resource information it manages. Once can request a specific version of the resource or leave the version blank to receive the latest version.

1 2 3 4 5 6 7 8 9 10 message SignedGetResourceRequest { GetResourceRequest request = 1; common.Signature signature = 2; } message GetResourceRequest { common.Envelope envelope = 1; common.ResourceID resourceId = 2; string acceptType = 3; uint32 version = 4; }
Response Message

The response includes the requested data for each resource. If any of the requested resources cannot be retrieved, an error message is returned with a status code and status message

1 2 3 4 5 6 7 8 9 10 11 12 message SignedGetResourceResponse { GetResourceResponse response = 1; common.Signature signature = 2; } message GetResourceResponse { common.Envelope envelope = 1; common.ResourceID resourceId = 2; string acceptType = 3; bytes resource = 4; uint32 version = 5; }

Share Resource

An Organization can Share / Push resources updates to other Organizations. This is an another method which the Organization can use to distribute its resources information.

Request Message

The message includes the resource ID and resource payload in the default content-type

1 2 3 4 5 6 7 8 9 10 11 message SignedResourceMetadataRequest { ResourceMetadata request = 1; common.Signature signature = 2; } message ResourceMetadata { common.Envelope envelope = 1; common.ResourceID resourceId = 2; repeated string acceptTypes = 3; uint32 version = 4; }
Response Message

The response code reflects if the recipient got the Resource Payload or if there was an error.

1 2 3 4 5 6 7 8 9 message SignedShareResourceResponse { ShareResourceResponse response = 1; common.Signature signature = 2; } message ShareResourceResponse { common.Envelope envelope = 1; common.Status status = 2; }

Verify Resource

To verify that a resource data received its authentic and current, an Organization can send a Broadcast request to receive the current hash of resource ID. The sender will then verify the received hashes from the responders with its own calculated hash. The verification algorithm is not specified, but an Organization is expected to store a hash of the current resource data into its cluster underlying DLT.

Request Message
1 2 3 4 5 6 7 message VerifyRequest { Envelope envelope = 1; // target the cluster VerifyRequestPayload = 2; } message VerifyRequestPayload { ResourceID resource = 1; }
Response Message

The response is collected from all the members of the cluster.

1 2 3 4 5 6 7 8 9 mesage VerifyResponse { Envelope envelope = 1; Status status = 2; VerifyResponsePayload = 3; } message VerifyResponsePayload { ResourceID resource = 1; bytes hash = 2; // the hash viewd by other members of the cluster }