Skip to content

Commit

Permalink
Update API examples
Browse files Browse the repository at this point in the history
re AB#9112
  • Loading branch information
j-hartley committed Mar 2, 2024
1 parent c1b2c20 commit 68b0e16
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 112 deletions.
13 changes: 3 additions & 10 deletions datatrails-common-api/assets/v2/assets/assetresponse.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ message AssetResponse {
"\"identity\": \"assets/add30235-1424-4fda-840a-d5ef82c4c96f\", "
"\"behaviours\": [\"RecordEvidence\"], "
"\"attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture from yesterday\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ],"
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
" \"arc_display_type\": \"Garden Fence\", "
" \"arc_display_name\": \"My Garden Fence\", "
" \"colour\": \"Plain wood\" "
"}, "
"\"confirmation_status\": \"PENDING\", "
"\"tracked\": \"TRACKED\", "
Expand Down
13 changes: 3 additions & 10 deletions datatrails-common-api/assets/v2/assets/createasset.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,9 @@ message CreateAssetRequest {
example:"{ "
"\"behaviours\": [\"RecordEvidence\"], "
"\"attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture from yesterday\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ],"
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
" \"arc_display_type\": \"Garden Fence\", "
" \"arc_display_name\": \"My Garden Fence\", "
" \"colour\": \"Plain wood\" "
"}, "
"\"proof_mechanism\": \"SIMPLE_HASH\","
"\"public\": false"
Expand Down
19 changes: 4 additions & 15 deletions datatrails-common-api/assets/v2/assets/createevent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,12 @@ message CreateEventRequest {
"\"operation\": \"Record\", "
"\"behaviour\": \"RecordEvidence\", "
"\"event_attributes\": { "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture from yesterday\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ]"
" \"arc_display_type\": \"Paint\", "
" \"arc_description\": \"Painted the fence\""
"}, "
"\"asset_attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
"}, "
"\"timestamp_declared\": \"2019-11-27T14:44:19Z\", "
"\"principal_declared\": { "
" \"issuer\": \"job.idp.server/1234\", \"subject\":\"bob@job\" "
" } "
" \"colour\": \"Midnight Blue\" "
"} "
"}"
};

Expand Down
13 changes: 3 additions & 10 deletions datatrails-common-api/assets/v2/assets/eventresponse.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,11 @@ message EventResponse {
"\"operation\": \"Record\", "
"\"behaviour\": \"RecordEvidence\", "
"\"event_attributes\": { "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture from yesterday\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ]"
" \"arc_display_type\": \"Paint\", "
" \"arc_description\": \"Painted the fence\" "
"}, "
"\"asset_attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
" \"colour\": \"Midnight Blue\" "
"}, "
"\"timestamp_accepted\": \"2019-11-27T14:44:19Z\", "
"\"timestamp_declared\": \"2019-11-27T14:44:19Z\", "
Expand Down
13 changes: 3 additions & 10 deletions datatrails-common-api/assets/v2/assets/eventresponsejsonapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,11 @@ message EventResponseJSONAPI {
"\"operation\": \"Record\", "
"\"behaviour\": \"RecordEvidence\", "
"\"event_attributes\": { "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture from yesterday\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ]"
" \"arc_display_type\": \"Paint\", "
" \"arc_description\": \"Painted the fence\" "
"}, "
"\"asset_attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
" \"colour\": \"Midnight Blue\" "
"}, "
"\"timestamp_accepted\": \"2019-11-27T14:44:19Z\", "
"\"timestamp_declared\": \"2019-11-27T14:44:19Z\", "
Expand Down
28 changes: 7 additions & 21 deletions datatrails-common-api/assets/v2/assets/listassets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,9 @@ message ListAssetsResponse {
" \"identity\": \"assets/add30235-1424-4fda-840a-d5ef82c4c96f\", "
" \"behaviours\": [\"RecordEvidence\"], "
" \"attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture from yesterday\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ],"
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
" \"arc_display_type\": \"Garden Fence\", "
" \"arc_display_name\": \"My Garden Fence\", "
" \"colour\": \"Plain wood\""
" }, "
" \"confirmation_status\": \"PENDING\", "
" \"tracked\": \"TRACKED\", "
Expand All @@ -125,22 +118,15 @@ message ListAssetsResponse {
" \"identity\": \"assets/cef61346-2453-5aeb-921c-e6fa93d5b032\", "
" \"behaviours\": [\"RecordEvidence\"], "
" \"attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/2865ca31-d01f-5e6f-4621-de562470732e\","
" \"arc_hash_value\": \"12bc4819d90b6fe911b091a7c05134b65edfce045e09b048caaa7916ecdd458c\","
" \"arc_display_name\": \"Picture\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ],"
" \"arc_home_location_identity\": \"locations/53165a2c-6054-dd68-f093-a0e1e21304fd\""
" \"arc_display_type\": \"IoT Device\", "
" \"arc_display_name\": \"My IoT Device\", "
" \"arc_firmware_version\": \"3.2.1\""
" }, "
" \"confirmation_status\": \"PENDING\", "
" \"tracked\": \"TRACKED\", "
" \"owner\": \"0x601f5A7D3e6dcB55e87bf2F17bC8A27AaCD3511\","
" \"at_time\": \"2019-11-27T14:44:19Z\", "
" \"proof_mechanism\": \"KHIPU\","
" \"proof_mechanism\": \"SIMPLE_HASH\","
" \"public\": false,"
" \"tenant_identity\": \"tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9\" "
" }"
Expand Down
25 changes: 5 additions & 20 deletions datatrails-common-api/assets/v2/assets/listevents.proto
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,11 @@ message ListEventsResponse {
" \"operation\": \"Record\", "
" \"behaviour\": \"RecordEvidence\", "
" \"event_attributes\": { "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture from yesterday\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ]"
" \"arc_display_type\": \"Paint\", "
" \"arc_description\": \"Painted the fence\" "
" }, "
" \"asset_attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
" \"colour\": \"Midnight Blue\" "
" }, "
" \"timestamp_accepted\": \"2019-11-27T14:44:19Z\", "
" \"timestamp_declared\": \"2019-11-27T14:44:19Z\", "
Expand All @@ -188,18 +181,10 @@ message ListEventsResponse {
" \"operation\": \"Record\", "
" \"behaviour\": \"RecordEvidence\", "
" \"event_attributes\": { "
" \"arc_attachments\": ["
" {"
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
" \"arc_display_name\": \"Picture\","
" \"arc_hash_alg\": \"sha256\""
" }"
" ]"
" \"arc_display_type\": \"Update Firmware\" "
" }, "
" \"asset_attributes\": { "
" \"arc_firmware_version\": \"3.2.1\", "
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
" \"arc_firmware_version\": \"3.2.1\" "
" }, "
" \"timestamp_accepted\": \"2019-07-27T14:44:19Z\", "
" \"timestamp_declared\": \"2019-07-27T14:44:19Z\", "
Expand Down
31 changes: 15 additions & 16 deletions datatrails-common-api/assets/v2/assets/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ service Assets {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: [ "Assets & Events" ]
summary: "List Archivist assets"
description: "Retrieves a list of Archivist assets"
summary: "List Assets"
description: "Retrieves a list of Assets"
responses: {
key: "206";
value: {
Expand Down Expand Up @@ -105,8 +105,8 @@ service Assets {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: [ "Assets & Events" ]
summary: "Create an Archivist asset"
description: "Creates an Archivist asset"
summary: "Create an Asset"
description: "Creates an Asset"
responses: {
key: "401";
value: {
Expand All @@ -116,8 +116,7 @@ service Assets {
responses: {
key: "402";
value: {
description: "Returned when the user either has not enabled blockchain storage or"
"the number of assets would exceed the user's quota"
description: "Returned when the number of assets would exceed the user's quota"
}
}
responses: {
Expand All @@ -141,8 +140,8 @@ service Assets {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: [ "Assets & Events" ]
summary: "Retrieves a specific Archivist asset"
description: "Retrieves a specific Archivist asset"
summary: "Retrieves a specific Asset"
description: "Retrieves a specific Asset"
responses: {
key: "401";
value: {
Expand Down Expand Up @@ -176,8 +175,8 @@ service Assets {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: [ "Assets & Events" ]
summary: "Retrieves the public url for a specific Archivist asset."
description: "Retrieves the public url for a specific Archivist asset."
summary: "Retrieves the public url for a specific Asset."
description: "Retrieves the public url for a specific Asset."
responses: {
key: "401";
value: {
Expand Down Expand Up @@ -211,8 +210,8 @@ service Assets {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: [ "Assets & Events" ]
summary: "Retrieves Archivist event"
description: "Retrieves a specific Archivist event"
summary: "Retrieves Event"
description: "Retrieves a specific Event"
responses: {
key: "401";
value: {
Expand Down Expand Up @@ -246,8 +245,8 @@ service Assets {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: [ "Assets & Events" ]
summary: "Retrieves the public url for a specific Archivist event."
description: "Retrieves the public url for a specific Archivist event."
summary: "Retrieves the public url for a specific Event."
description: "Retrieves the public url for a specific Event."
responses: {
key: "401";
value: {
Expand Down Expand Up @@ -281,8 +280,8 @@ service Assets {
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: [ "Assets & Events" ]
summary: "List Archivist events"
description: "Lists Archivist events"
summary: "List Events"
description: "Lists Events"
responses: {
key: "206";
value: {
Expand Down

0 comments on commit 68b0e16

Please sign in to comment.