Skip to content

Commit fbb569c

Browse files
committed
Additional, incremental progress on attachments
Signed-off-by: steve lasker <stevenlasker@hotmail.com>
1 parent cb811bf commit fbb569c

6 files changed

Lines changed: 103 additions & 102 deletions

File tree

content/developers/api-reference/asset-events-api/index.md

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ In a future release, Events will be created independently from Assets.
8787
-H "@$HOME/.datatrails/bearer-token.txt" \
8888
-H "Content-type: application/json" \
8989
-d "@/tmp/event.json" \
90-
https://app.datatrails.ai/archivist/v2/assets/$ASSET_ID/events \
90+
https://app.datatrails.ai/archivist/v2/$ASSET_ID/events \
9191
| jq
9292
```
9393
@@ -138,17 +138,8 @@ In a future release, Events will be created independently from Assets.
138138
139139
### DataTrails Reserved Attributes
140140
141-
The DataTrails platform as reserved attributes starting with `arc_`.
142-
Asset-Events have the following reserved attributes:
143-
144-
- **`arc_display_type`**: The value used to display in the DataTrails Application.
145-
- **`arc_primary_image`**: A attribute containing a dictionary of references to a Blob, used to display in the DataTrails Application.
146-
- **`arc_attribute_type`**: When set within a nested attribute, the value of `"arc_attachment"` identifies a reference to a [DataTrails Blob](/developers/api-reference/blobs-api/)
147-
- **`arc_display_name"`**: When set to `"arc_primary_image"`, the blob is displayed in the DataTrails application.
148-
- **`arc_blob_hash_value`**: When `arc_attribute_type` = `"arc_attachment"`, the value must equal the hash value within the associated `arc_blob_identity`.
149-
- **`arc_blob_identity`**: A reference to a [Blob](/developers/api-reference/blobs-api/)
150-
- **`arc_blob_hash_alg`**: The algorithm of the `arc_blob_hash_value` (eg: "SHA256")
151-
- **`arc_file_name`**: When `arc_attribute_type` = `"arc_attachment"`, the file name of the blob.
141+
The DataTrails platform has reserved attributes starting with `arc_` to perform specific capabilities.
142+
See [Reserved Attributes](/glossary/reserved-attributes/) for more info.
152143
153144
### Event Primary Image
154145
@@ -171,10 +162,10 @@ Asset-Events can use the [Blobs API](/developers/api-reference/blobs-api/) to as
171162
172163
Example:
173164
174-
ASSET_ID=assets/a1234567-8901
175-
BLOB_ID=blobs/b1234567-8901
165+
ASSET_ID=assets/a1234567-890a
166+
BLOB_ID=blobs/b1234567-890b
176167
BLOB_FILE=conformance.pdf
177-
BLOB_HASH=h1234567
168+
BLOB_HASH=h1234567hh
178169
179170
- Associate a Blob as the Event Primary Image:
180171
@@ -187,9 +178,9 @@ Asset-Events can use the [Blobs API](/developers/api-reference/blobs-api/) to as
187178
"arc_primary_image": {
188179
"arc_attribute_type": "arc_attachment",
189180
"arc_display_name": "arc_primary_image",
190-
"arc_blob_hash_value": "$BLOB_HASH",
191181
"arc_blob_identity": "$BLOB_ID",
192182
"arc_blob_hash_alg": "SHA256",
183+
"arc_blob_hash_value": "$BLOB_HASH",
193184
"arc_file_name": "$BLOB_FILE"
194185
}
195186
}
@@ -204,7 +195,7 @@ Asset-Events can use the [Blobs API](/developers/api-reference/blobs-api/) to as
204195
-H "@$HOME/.datatrails/bearer-token.txt" \
205196
-H "Content-type: application/json" \
206197
-d "@/tmp/event.json" \
207-
https://app.datatrails.ai/archivist/v2/assets/$ASSET_ID/events \
198+
https://app.datatrails.ai/archivist/v2/$ASSET_ID/events \
208199
| jq
209200
```
210201
@@ -260,7 +251,7 @@ There are two [Document Profile Events](/developers/developer-patterns/document-
260251
-H "@$HOME/.datatrails/bearer-token.txt" \
261252
-H "Content-type: application/json" \
262253
-d "@/tmp/event.json" \
263-
https://app.datatrails.ai/archivist/v2/assets/$ASSET_ID/events \
254+
https://app.datatrails.ai/archivist/v2/$ASSET_ID/events \
264255
| jq
265256
```
266257
@@ -347,7 +338,7 @@ There are two [Document Profile Events](/developers/developer-patterns/document-
347338
-H "@$HOME/.datatrails/bearer-token.txt" \
348339
-H "Content-type: application/json" \
349340
-d "@/tmp/event.json" \
350-
https://app.datatrails.ai/archivist/v2/assets/$ASSET_ID/events \
341+
https://app.datatrails.ai/archivist/v2/$ASSET_ID/events \
351342
| jq
352343
```
353344
@@ -390,19 +381,19 @@ There are two [Document Profile Events](/developers/developer-patterns/document-
390381
}
391382
```
392383
393-
### Event Record Retrieval
384+
## Asset Event Record Retrieval
394385
395-
Event records in DataTrails are tokenized at creation time and referred to in all future API calls by a permanent unique identity of the form:
386+
Asset Event records in DataTrails are tokenized at creation time and referred to in all future API calls by a permanent unique identity of the form:
396387
397388
```bash
398-
assets/$ASSET_ID/events/$EVENT_ID
389+
assets/a1234567-890a/events/$EVENT_ID
399390
```
400391
401392
If you do not know the Event’s identity you can fetch Event records using other information you do know.
402393
403-
#### Fetch All Events
394+
### Fetch All Asset Events
404395
405-
- To fetch all Event records, simply `GET` the Events resources:
396+
- To fetch all Asset Event records, simply `GET` the Events resources:
406397
407398
```bash
408399
curl -X GET \
@@ -411,31 +402,31 @@ If you do not know the Event’s identity you can fetch Event records using othe
411402
| jq
412403
```
413404
414-
#### Fetch Events for a Specific Asset
405+
### Fetch Asset Events for a Specific Asset
415406
416407
- If you know the unique identity of the Asset record simply `GET` the resource:
417408
418409
```bash
419410
curl -X GET \
420411
-H "@$HOME/.datatrails/bearer-token.txt" \
421-
"https://app.datatrails.ai/archivist/v2/assets/$ASSET_ID/events?page_size=5" \
412+
"https://app.datatrails.ai/archivist/v2/$ASSET_ID/events?page_size=5" \
422413
| jq
423414
```
424415
425-
#### Fetch Specific Events by Identity
416+
### Fetch Specific Asset Events by Identity
426417
427418
- If you know the unique identity of the Asset and Event record simply `GET` the resource:
428419
429420
```bash
430421
curl -X GET \
431422
-H "@$HOME/.datatrails/bearer-token.txt" \
432-
"https://app.datatrails.ai/archivst/v2/assets/$ASSET_ID/events/$EVENT_ID" \
423+
"https://app.datatrails.ai/archivst/v2/$ASSET_ID/events/$EVENT_ID" \
433424
| jq
434425
```
435426
436-
#### Fetch Event by Type
427+
### Fetch Asset Event by Type
437428
438-
- To fetch all Events of a specific type, `GET` the Events resource and filter on `arc_display_type`:
429+
- To fetch all Asset Events of a specific type, `GET` the Events resource and filter on `arc_display_type`:
439430
440431
```bash
441432
curl -g -X GET \
@@ -444,9 +435,9 @@ If you do not know the Event’s identity you can fetch Event records using othe
444435
| jq
445436
```
446437
447-
#### Fetch Event by Asset Attribute
438+
### Fetch Asset Event by Asset Attribute
448439
449-
- To fetch all Events of a specific Asset attribute, `GET` the Events resource and filter on `asset_attributes` at the Asset level:
440+
- To fetch all Asset Events of a specific Asset attribute, `GET` the Events resource and filter on `asset_attributes` at the Asset level:
450441
451442
```bash
452443
curl -g -X GET \
@@ -455,9 +446,9 @@ If you do not know the Event’s identity you can fetch Event records using othe
455446
| jq
456447
```
457448
458-
#### Fetch Events by Filtering for Presence of a Field
449+
### Fetch Asset Events by Filtering for Presence of an Attribute
459450
460-
- To fetch all Events with a field set to any value, `GET` the Events resource and filter on most available fields. For example:
451+
- To fetch all Asset Events with an Attribute set to any value, `GET` the Asset-Events resource and filter on most available attributes.
461452
462453
```bash
463454
curl -g -X GET \
@@ -468,9 +459,9 @@ If you do not know the Event’s identity you can fetch Event records using othe
468459
469460
Returns all Events which have `arc_display_type` that is not empty.
470461
471-
#### Fetch Events Which are Missing a Field
462+
### Fetch Asset Events Which are Missing a Field
472463
473-
- To fetch all Events with a field which is not set to any value, `GET` the Events resource and filter on most available fields. For example:
464+
- To fetch all Asset Events with a field which is not set to any value, `GET` the Events resource and filter on most available fields.
474465
475466
```bash
476467
curl -g -X GET \
@@ -479,11 +470,11 @@ If you do not know the Event’s identity you can fetch Event records using othe
479470
| jq
480471
```
481472
482-
Returns all Events which do not have `arc_display_type` or in which `arc_display_type` is empty.
473+
Returns all Asset Events which do not have `arc_display_type` or in which `arc_display_type` is empty.
483474
484-
#### Fetch Events by Minimum Confirmation Status
475+
### Fetch Asset Events by Minimum Confirmation Status
485476
486-
- To fetch all Events with a specified confirmation status or higher, `GET` the Events resource and filter on `minimum_trust`.
477+
- To fetch all Asset Events with a specified confirmation status or higher, `GET` the Events resource and filter on `minimum_trust`.
487478
488479
```bash
489480
curl -g -X GET \
@@ -492,7 +483,7 @@ If you do not know the Event’s identity you can fetch Event records using othe
492483
| jq
493484
```
494485
495-
- To fetch all Events which have a `confirmation_status` level of COMMITTED, CONFIRMED or UNEQUIVOCAL.
486+
- To fetch all Asset Events which have a `confirmation_status` level of COMMITTED, CONFIRMED or UNEQUIVOCAL.
496487
497488
```bash
498489
curl -g -X GET \
@@ -501,7 +492,7 @@ If you do not know the Event’s identity you can fetch Event records using othe
501492
| jq
502493
```
503494
504-
Returns all Events which have a `confirmation_status` level of CONFIRMED or UNEQUIVOCAL.
495+
Returns all Asset Events which have a `confirmation_status` level of CONFIRMED or UNEQUIVOCAL.
505496
506497
## Events OpenAPI Docs
507498

content/developers/api-reference/assets-api/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ The image must first be uploaded with the [Blobs API](/developers/api-reference/
108108
109109
Example:
110110
111-
ASSET_ID=assets/a1234567-8901
112-
BLOB_ID=blobs/b1234567-8901
111+
ASSET_ID=assets/a1234567-890a
112+
BLOB_ID=blobs/b1234567-890b
113113
BLOB_FILE=cat.jpg
114-
BLOB_HASH=h1234567
114+
BLOB_HASH=h1234567h
115115
116116
```bash
117117
cat > /tmp/asset.json <<EOF

content/developers/api-reference/attachments-api/index.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,39 @@ The steps include:
3232

3333
### Asset-Event Attachments
3434

35-
Assets support attachments by creating an [Asset-Event](/developers/api-reference/asset-events-api/) with nested `arc_` attributes.
35+
Assets support attachments by creating an [Asset-Event](/developers/api-reference/asset-events-api/) with nested `arc_` [Reserved Attributes](/glossary/reserved-attributes/).
3636

3737
- `"arc_attribute_type": "arc_attachment"`
38-
- `"arc_blob_identity": "blobs/b1234567-8901"`
38+
- `"arc_blob_identity": "blobs/b1234567-890b"`
3939
- `"arc_blob_hash_alg": "SHA256"`
40-
- `"arc_blob_hash_value": "h1234567"`
40+
- `"arc_blob_hash_value": "h1234567h"`
4141
- `"arc_file_name": "conformance.pdf"`
4242
- `"arc_display_name": "Conformance Report"`
4343

4444
For example:
4545

4646
```json
4747
{
48-
"identity": "assets/a1234567-8901/events/e1234567-8901",
49-
"asset_identity": "assets/a1234567-8901",
48+
"identity": "assets/a1234567-890a/events/e1234567-890e",
49+
"asset_identity": "assets/a1234567-890a",
5050
"event_attributes": {
5151
"arc_description": "Conformance approved for version 1.6",
5252
"arc_display_type": "Conformance Report",
5353
"conformance_report": {
5454
"arc_attribute_type": "arc_attachment",
55-
"arc_blob_identity": "blobs/b1234567-8901",
55+
"arc_blob_identity": "blobs/b1234567-890b",
5656
"arc_blob_hash_alg": "SHA256",
57-
"arc_blob_hash_value": "h1234567",
57+
"arc_blob_hash_value": "h1234567h",
5858
"arc_file_name": "conformance.pdf",
5959
"arc_display_name": "Conformance Report"
60+
},
61+
"security_report": {
62+
"arc_attribute_type": "arc_attachment",
63+
"arc_blob_identity": "blobs/b890123-456b",
64+
"arc_blob_hash_alg": "SHA256",
65+
"arc_blob_hash_value": "h8901234h",
66+
"arc_file_name": "security-report.pdf",
67+
"arc_display_name": "Security Report"
6068
}
6169
},
6270
"..."
@@ -89,10 +97,10 @@ The DataTrails platform evaluates `"arc_attribute_type": "arc_attachment"` to re
8997

9098
Example:
9199

92-
ASSET_ID=assets/a1234567-8901
93-
BLOB_ID=blobs/b1234567-8901
100+
ASSET_ID=assets/a1234567-890a
101+
BLOB_ID=blobs/b1234567-890b
94102
BLOB_FILE=conformance.pdf
95-
BLOB_HASH=h1234567
103+
BLOB_HASH=h1234567h
96104

97105
### Create an Asset-Event Attachment
98106

@@ -134,14 +142,14 @@ The DataTrails platform evaluates `"arc_attribute_type": "arc_attachment"` to re
134142
135143
```json
136144
{
137-
"identity": "assets/a1234567-8901/events/e1234567-8901",
138-
"asset_identity": "assets/a1234567-8901",
145+
"identity": "assets/a1234567-890a/events/e1234567-890e",
146+
"asset_identity": "assets/a1234567-890a",
139147
"event_attributes": {
140148
"arc_description": "Safety conformance approved for version 1.6.",
141149
"conformance_report": {
142150
"arc_attribute_type": "arc_attachment",
143-
"arc_blob_hash_value": "h1234567",
144-
"arc_blob_identity": "blobs/b1234567-8901",
151+
"arc_blob_hash_value": "h1234567h",
152+
"arc_blob_identity": "blobs/b1234567-890b",
145153
"arc_blob_hash_alg": "SHA256",
146154
"arc_file_name": "cat.jpg",
147155
"arc_display_name": "Conformance Report"

content/developers/api-reference/events-api/index.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,10 @@ Additional YAML examples can be found in the articles in the [Overview](/platfor
9393
9494
### DataTrails Reserved Attributes
9595
96-
The DataTrails platform as reserved attributes starting with `arc_`.
97-
Asset-Events have the following reserved attributes:
98-
99-
- **`arc_display_type`**: The value used to display in the DataTrails Application.
100-
- **`arc_primary_image`**: A attribute containing a dictionary of references to a Blob, used to display in the DataTrails Application.
101-
- **`arc_attribute_type`**: When set within a nested attribute, the value of `"arc_attachment"` identifies a reference to a [DataTrails Blob](/developers/api-reference/blobs-api/)
102-
- **`arc_display_name"`**: When set to `"arc_primary_image"`, the blob is displayed in the DataTrails application.
103-
- **`arc_blob_hash_value`**: When `arc_attribute_type` = `"arc_attachment"`, the value must equal the hash value within the associated `arc_blob_identity`.
104-
- **`arc_blob_identity`**: A reference to a [Blob](/developers/api-reference/blobs-api/)
105-
- **`arc_blob_hash_alg`**: The algorithm of the `arc_blob_hash_value` (eg: "SHA256")
106-
- **`arc_file_name`**: When `arc_attribute_type` = `"arc_attachment"`, the file name of the blob.
96+
### DataTrails Reserved Attributes
97+
98+
The DataTrails platform has reserved attributes starting with `arc_` to perform specific capabilities.
99+
See [Reserved Attributes](/glossary/reserved-attributes/) for more info.
107100
108101
### Event Primary Image
109102
@@ -121,9 +114,9 @@ Events can use the [Blobs API](/developers/api-reference/blobs-api/) to associat
121114
122115
Example:
123116
124-
BLOB_ID=blobs/b1234567-8901
117+
BLOB_ID=blobs/b1234567-890b
125118
BLOB_FILE=conformance.pdf
126-
BLOB_HASH=h1234567
119+
BLOB_HASH=h1234567h
127120
128121
- Associate a Blob as the Event Primary Image:
129122

0 commit comments

Comments
 (0)