-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathotm-bridge.html
1086 lines (1047 loc) · 49.7 KB
/
otm-bridge.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>OTM Bridge API Specification</title>
<script
src='https://www.w3.org/Tools/respec/respec-w3c'
class='remove'></script>
<script class='remove'>
var respecConfig = {
specStatus: "base",
editors: [{
name: "Bill Branan",
company: "LYRASIS",
companyURL: "https://lyrasis.org"
},{
name: "Sibyl Schaefer",
company: "University of California, San Diego",
companyURL: "https://ucsd.edu"
}],
gitHub: "ucsdlib/otm-specs",
shortName: "otm-bridge-api",
wg: "One to Many Working Group",
wgURI: "https://wiki.lyrasis.org/display/OTM",
edDraftURI: "https://github.com/ucsdlib/otm-specs/blob/master/otm-bridge.html",
maxTocLevel: 3,
localBiblio: {
"RFC7617": {
title: "The 'Basic' HTTP Authentication Scheme",
href: "https://tools.ietf.org/html/rfc7617"
}
},
otherLinks: [{
key: "OTM Specifications",
data: [{
value: "One to Many (OTM) Specifications Overview",
href: "."
},
{
value: "OTM Preservation Workflow",
href: "preservation-workflow.html"
},
{
value: "OTM Gateway API Specification",
href: "otm-gateway.html"
},
{
value: "OTM Appendix - Audit Events",
href: "audit-appendix.html"
},
{
value: "OTM Appendix - Hyrax Workflow",
href: "hyrax-workflow.html"
}]
}]
};
</script>
<link rel="stylesheet" href="otm-styles.css">
</head>
<body>
<p class='copyright'>This document is licensed under a
<a class='subfoot' href='https://creativecommons.org/licenses/by/4.0/' rel='license'>
Creative Commons Attribution 4.0 License
</a>.
</p>
<section id='abstract'>
<p>
The One To Many (OTM) Bridge API Specification is one of two APIs used to support communication between digital
content repository systems (Repository) and distributed digital preservation systems (DDP). An application
implementing the OTM Bridge API (Bridge) will receive requests to deposit, restore, or delete content in a DDP from
an application implementing the <a href="otm-gateway.html">OTM Repository Gateway API (Gateway)</a>. The purpose of
the Bridge is to perform the transfer and workflow tasks required to collect and distribute content managed by DDP
systems. The Bridge is intended to provide a consistent interface for applications needing to interact with DDP
systems as well as a consistent interface for DDP systems that would like to accept content from a variety of content
repositories. The Bridge application is expected to be hosted by a DDP service as an extension of their service
offering.
</p>
</section>
<section>
<h2>Status of This Document</h2>
<p>This document is a draft of a specification, created as part of the One to Many grant, funded by the Andrew W.
Mellon Foundation.</p>
</section>
<section id="conformance">
</section>
<section>
<h2><dfn>Base Endpoints</dfn></h2>
<section>
<h3><dfn>Bridge Details</dfn></h3>
<p>Provides information about the Bridge application. Can also be used to verify that the Bridge application is
available at the expected URL.</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/</code></li>
<li>Response Body: <code>JSON</code>
<ul>
<li><code>bridge-version</code>: The current version of the Bridge application</li>
<li><code>checksum-types-supported</code>: The checksum types that are supported by the Bridge</li>
</ul>
</li>
<pre class="example">
{
"bridge-version" : "1.0.0",
"checksum-types-supported" : [ "MD5", "SHA-256", "SHA-512" ]
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<p>Expected client(s): Gateway, DDP</p>
</section>
</section>
<section>
<h2><dfn>Account Management Endpoints</dfn></h2>
<section>
<h3><dfn>Add Account</dfn></h3>
<p>Allows the DDP to create a new user account in the Bridge. After this call it will be possible for the OTM Gateway
to register with the Bridge. This call can also be used to reset the access credentials for an account.</p>
<ul>
<li>Request Type: <code>PUT</code></li>
<li>Request Path: <code>/account/{account-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>account-id</code>: Account identifier</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li><code>account-id</code>: Account identifier</li>
<li><code>account-username</code>: Credentials to allow calls to the Bridge for this account</li>
<li><code>account-password</code>: Credentials to allow calls to the Bridge for this account</li>
</ul>
</li>
<pre class="example">
{
"account-id" : "university-of-example",
"account-username" : "example-username",
"account-password" : "5ecret!"
}
</pre>
<li>Response Code: <code>201</code> (on success)</li>
</ul>
<p>Expected client(s): DDP</p>
</section>
<section>
<h3><dfn>List Accounts</dfn></h3>
<p>Allows the DDP to list all accounts known by the Bridge</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/account</code></li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Account ID: Account identifier</li>
</ul>
</li>
<pre class="example">
{
"university-of-example", # Account ID
"example-state-university" # Account ID
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<p>Expected client(s): DDP</p>
</section>
<section>
<h3><dfn>Register</dfn></h3>
<p>Allows a Gateway to register itself with the Bridge. The information provided in this registration will allow the
Bridge to make calls back to the Gateway, such as to pull content listed in a deposit request. This call must be made
prior to calls to deposit content. This call may also be made to update the Gateway registration information.</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/register</code></li>
<li>Request Body: <code>JSON</code>
<ul>
<li><code>gateway-url</code>:
Base endpoint URL where the Bridge can call back to this Gateway API</li>
<li><code>gateway-username</code>:
Credentials to allow the Bridge to make calls back to the Gateway API</li>
<li><code>gateway-password</code>:
Credentials to allow the Bridge to make calls back to the Gateway API</li>
</ul>
</li>
<pre class="example">
{
"gateway-url" : "https://example.com/gateway",
"gateway-username" : "example-username",
"gateway-password" : "5ecret!"
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>In order for a call to this endpoint to be successful an account with associated credentials must already exist
in the Bridge. This must have been created in advance by a Bridge administrator (see <a>Add Account</a>).</li>
<li>This endpoint may be called both to perform an initial registration and to provide updates to registration
information. Calls made by the Bridge after a registration update will use the updated details.</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
</section>
<section>
<h2><dfn>Deposit Endpoints</dfn></h2>
<section>
<h3><dfn>Deposit Content</dfn></h3>
<p>Requests that a set of content be deposited into the DDP</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/deposit ? deposit-format=</code></li>
<li>Request Query Parameters:
<ul>
<li><code>deposit-format</code>: (Optional) Format of content being deposited (e.g. "bagit-profile-v1.2")</li>
</ul>
</li>
<li>Request Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies a filegroup. Filegroups are generic groupings of files that can be used to capture
structure such as in a digital object or work.</li>
<li><code>version</code>: The version of a filegroup</li>
<li><code>files</code>: List of files included in the filegroup</li>
<li>File ID: Identifies a file within a filegroup</li>
<li><code>size</code>: Size of a file in bytes</li>
<li>Checksum: Type of checksum and checksum of the file (a list of supported checksum types are provided in
<a>Bridge Details</a>)</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # Filegroup ID
"version" : "2019-12-31T23:59:60Z",
"files" : {
"file-1" : { # File ID
"size" : "654321",
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
"file-2" : { # File ID
"size" : "654321",
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
}, # Additional files listed here
}
},
"filegroup-2" : { # Filegroup ID
"version" : "2019-12-31T23:59:60Z",
"files" : {
"file-3" : { # File ID
"size" : "654321",
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
"file-4" : { # File ID
"size" : "654321",
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
}, # Additional files listed here
}
}, # Additional filegroups listed here
}
</pre>
<li>Response Code: <code>201</code> (on success)</li>
</ul>
<ul class="note">
<li>Each filegroup in the request body is considered an independent deposit which can be referred to in subsequent
requests by the filegroup identifier.</li>
<li>The Bridge uses the Gateway's <a href="otm-gateway.html#transfer-file">Transfer File</a> endpoint, and the
credentials provided in the Register step to retrieve each file.</li>
<li>Provided filegroup IDs and file IDs must be URL-safe to support the Bridge requesting those files from the
Gateway and the reverse in the restore context</li>
<li>Provided filegroup IDs must not include slash ("/" or "\") characters. File IDs may include slashes.</li>
<li>There is no guarantee that all filegroups in a single deposit request will be deposited into the DDP at the
same time. This allows the Bridge to manage transfers based on available resources (so as to not over-run local
disk, for example).</li>
<li>The Bridge and DDP will consider the version value as opaque and not attempt to assign any meaning to the
value.</li>
<li>Not including "version" in the JSON is acceptable and is functionally the same as <code>"version" : ""</code>.
This "empty" version is equivalent to any other version.</li>
<li>When new filegroup versions are deposited, the Bridge may choose to retrieve and submit to the DDP only those
files which have changed between versions (based on file ID and checksum).</li>
<li>The deposit-format parameter allows the depositor to specify the format of the content being deposited. The
Bridge implementation may choose to only support deposits of certain types. Agreements between the depositor and
the DDP should specify which types are to be used for deposit.</li>
<li>In the event of deposit or Bridge failure, incomplete deposits may require a resubmission. Systems interacting
with the Bridge, such as the Gateway, should support the capability to restart a deposit.</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
<section>
<h3><dfn>List Deposits</dfn></h3>
<p>Retrieves a listing of all initiated and in-process deposits. This list includes all deposits that have been
requested (via <a>Deposit Content</a>) but have not yet completed the deposit process (which occurs when the DDP
calls <a>Complete Deposit</a>)</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/deposit ? status=</code></li>
<li>Request Query Parameters:
<ul>
<li><code>status</code>: (Optional) Limit list to deposits with a specific <a>deposit status</a></li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies the filegroup being deposited</li>
<li><code>version</code>: The version of a filegroup</li>
<li><code>file-count</code>: The number of files in a deposit</li>
<li><code>status</code>: The current <a>deposit status</a> of the deposit</li>
<li><code>details</code>: Additional details about the state of the deposit</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # Filegroup ID
"version : "2019-12-31T23:59:60Z",
"file-count" : "2",
"status" : "ACCEPTED",
"details" : ""
}, # Additional filegroups listed here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>List requests made by a depositor will return only those deposits which were initiated by that depositing
entity</li>
<li>List requests made by the DDP (to determine if there are deposits which are ready for processing) will return
results for all depositors</li>
<li>An optional query parameter could be added to allow a DDP to limit the response based on depositor</li>
<li>This list will grow large if many deposits are initiated at once and may require paged results</li>
<li>This list will not include all historical deposits, but only those that are in the process of being
deposited</li>
</ul>
<p>Expected client(s): Gateway, DDP</p>
</section>
<section>
<h3><dfn>Get Deposit Status</dfn></h3>
<p>Allows the Gateway to ask for status of a specific deposit</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/deposit/{filegroup-id}/status</code></li>
<li>Request Path Parameters:
<ul>
<li><code>filegroup-id</code>: The ID of the filegroup being deposited</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies the filegroup being deposited</li>
<li><code>version</code>: The version of a filegroup</li>
<li><code>file-count</code>: The number of files in a deposit</li>
<li><code>status</code>: The current <a>deposit status</a> of the deposit</li>
<li><code>details</code>: Additional details about the state of the deposit</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # Filegroup ID
"version : "2019-12-31T23:59:60Z",
"file-count" : "2",
"status" : "ACCEPTED",
"details" : ""
}
}
</pre>
<li>Response Code:
<ul>
<li><code>200</code> (on success)</li>
<li><code>404</code> (if the provided Filegroup ID does not exist in the system)</li>
</ul>
</li>
</ul>
<ul class="note">
<li>This endpoint is intended to provide status on deposits which have not yet completed. The length of time that a
deposit in the completed status remains available to query via this endpoint may vary.</li>
<li>An additional property may be included in the response JSON for completed deposits to provide the <a>Get
Content Details</a> URL for this deposit.</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
<section>
<h3><dfn>Complete Deposit</dfn></h3>
<p>Allows the DDP to inform the Bridge that a deposit has completed</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/deposit/{filegroup-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>filegroup-id</code>: Identifier of the filegroup for which deposit has completed</li>
</ul>
</li>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<p>Expected client(s): DDP</p>
</section>
</section>
<section>
<h2><dfn>Discovery Endpoints</dfn></h2>
<section>
<h3><dfn>List Content</dfn></h3>
<p>Retrieves a list of all deposited filegroup IDs</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/list</code></li>
<li>Response Body: <code>JSON</code>
<ul>
<li><code>Filegroup ID</code>: Identifier of deposited filegroup</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1", # Filegroup ID
"filegroup-2", # Filegroup ID
# Additional filegroups listed here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
<section>
<h3><dfn>Get Content Details</dfn></h3>
<p>Retrieves details about a deposited filegroup, including versions and associated files</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/list/{filegroup-id}/{file-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>filegroup-id</code>: The identifier of the filegroup for which information is requested</li>
<li><code>file-id</code>: (Optional) The identifier of the file for which information is requested</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li><code>filegroup</code>: Filegroup identifier</li>
<li>Version: The version of the filegroup</li>
<li>File ID: Identifies a file within a filegroup</li>
<li><code>size</code>: Size of a file in bytes</li>
<li>Checksum: Type of checksum and checksum of the file (a list of supported checksum types are provided in
<a>Bridge Details</a>)</li>
</ul>
</li>
<pre class="example">
{
"filegroup" : "filegroup-1",
"2019-12-31T23:59:60Z" : { # Version
"file-1" : { # File ID
"size" : "654321",
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
"file-2" : { # File ID
"size" : "654321",
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
}, # Additional files listed here
}, # Additional filegroup versions here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>When a file-id is included, the file matching that ID is the only one returned in files list</li>
<li>Multiple checksums may be returned for each file (e.g. MD5 and SHA-512)</li>
<li>This list would not include deleted versions or files. A tombstone capability is possible, but not currently
part of this specification.</li>
<li>The checksum type provided is at the discretion of the DDP and may or may not match the checksum type used when
content was deposited</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
</section>
<section>
<h2><dfn>Audit Endpoints</dfn></h2>
<section>
<h3><dfn>Add Audit Event</dfn></h3>
<p>Update audit index by providing additional audit details</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/audit</code></li>
<li>Response Body: <code>JSON</code>
<ul>
<li>ID: Identifier of Filegroup or File to which this audit event is to be applied</li>
<li><code>event-type</code>: Type of event</li>
<li><code>event</code>: Event details</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # ID
"event-type" : "replication",
"files" : [ "file-1", "file-2", "file-3" ],
"event" : {
"version" : "2019-12-31T23:59:60Z",
"timestamp" : "2020-01-01T23:59:60Z",
"replicated-to" : "example-storage-node"
}
}, # Additional events listed here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>The types of events and expected details of each event type are listed in the <a
href="audit-appendix.html">Audit Events Appendix</a></li>
<li>The Bridge maintains audit details provided through this endpoint as a cache for the DDP to support convenient
retrieval. This audit information is expected to remain in the DDP such that a rebuild of this cache could be
performed if the Bridge were to fail. The DDP is not required to maintain this data in a format that facilitates
easy access, but should be able to provide it upon request to facilitate a rebuild.</li>
</ul>
<p>Expected client(s): DDP</p>
</section>
<section>
<h3><dfn>Get Audit Log</dfn></h3>
<p>Retrieves an audit history report. The report will list audit events associated with a single file or set of files
in a filegroup.</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/audit/{filegroup-id}/{file-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>filegroup-id</code>: The identifier of the filegroup for which an audit report is requested</li>
<li><code>file-id</code>: (Optional) The identifier of the file for which an audit report is requested. If this
is not provided the audit report is requested based on the filegroup-id.</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies the filegroup for which audit data is requested</li>
<li>File ID: Identifies the file for which audit data is requested</li>
<li><code>date</code>: Date and time that the event occurred</li>
<li><code>type</code>: Type of event that occurred</li>
<li><code>details</code>: Details of the event that occurred</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : [ # Filegroup ID
{
"file-1" : [ # File ID
{
"date" : "2019-12-31T23:59:60Z",
"type" : "replication",
"details" : "Replication to the UCSD storage node"
}, # Additional events for this file listed here
], # Additional files listed here
}
]
}
</pre>
<li>Response Code:
<ul>
<li><code>200</code> (on success)</li>
<li><code>404</code> (if no audit information exists for the requested Filegroup ID or File ID)</li>
</ul>
</li>
</ul>
<ul class="note">
<li>It may be desirable to provide paged results for large result sets</li>
<li>The types of events and expected details of each event type are listed in the <a
href="audit-appendix.html">Audit Events Appendix</a></li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
</section>
<section>
<h2><dfn>Restore Endpoints</dfn></h2>
<section>
<h3><dfn>Restore Content</dfn></h3>
<p>Requests that content be made available for restore</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/restore</code></li>
<li>Request Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies the filegroup from which the file should be restored</li>
<li><code>version</code>: The version of a filegroup from which the file should be restored</li>
<li><code>files</code>: List of files to be restored</li>
<li>File ID: Identifies a file to be restored</li>
<li>Checksum: Type of checksum and checksum of the file (a list of supported checksum types are provided in
<a>Bridge Details</a>). Including the checksum is optional and is used only to verify that the correct file is
being restored</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # Filegroup ID
"version" : "2019-12-31T23:59:60Z",
"files" : {
"file-1" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
"file-2" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
}
}, # Additional filegroups listed here
}
</pre>
<li>Response Code: <code>202</code> (on success)</li>
<li>Response Body: <code>JSON</code>
<ul>
<li><code>restore-id</code>: The identifier for this restore action</li>
</ul>
</li>
<pre class="example">
{
"restore-id" : "54321"
}
</pre>
</ul>
<p>Expected client(s): Gateway</p>
</section>
<section>
<h3><dfn>List Restores</dfn></h3>
<p>Retrieves a listing of all in-process restores</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/restore ? status=</code></li>
<li>Request Query Parameters:
<ul>
<li><code>status</code>: (Optional) Limit list to restore actions with a specific <a>restore status</a></li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Restore ID: Identifier for restore action</li>
<li><code>file-count</code>: The number of files to be restored</li>
<li><code>status</code>: The current <a>restore status</a> of the restore action</li>
<li><code>details</code>: Additional details about the state of the restore action</li>
<li><code>expiration</code>: The date on which the restored content will expire (and no longer be available for
retrieval). This value may be empty until a restore action completes.</li>
</ul>
</li>
<pre class="example">
{
"restore-1" : { # Restore ID
"file-count" : "12",
"status" : "COMPLETE",
"details" : "",
"expiration" : "2020-12-31T23:59:60Z"
}, # Additional restore actions listed here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>Use is anticipated by both the Gateway (to check on restore requests) and the DDP (to determine if there are
restore requests which are ready for processing)</li>
<li>Restore IDs returned by this method are those that have been initiated, are in-process, or have completed but
not yet expired</li>
<li>Restored content will only be made available on the Bridge for a limited time. After this time, content will be
removed and the status of the restore will be changed to expired.</li>
</ul>
<p>Expected client(s): Gateway, DDP</p>
</section>
<section>
<h3><dfn>Get Restore</dfn></h3>
<p>Provides details of the restore request to allow the request to be fulfilled by the DDP</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/restore/{restore-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>restore-id</code>: The identifier of the restore action</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies the filegroup from which files are to be restored</li>
<li><code>version</code>: The version of a filegroup from which files are to be restored</li>
<li><code>files</code>: List of files to be restored</li>
<li>File ID: Identifies a file to be restored</li>
<li>Checksum: Type of checksum and checksum of the file. The checksum is only included if it was part of the
original restore request.</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # Filegroup ID
"version" : "2019-12-31T23:59:60Z",
"files" : {
"file-1" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
"file-2" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
}
}, # Additional filegroups listed here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>The response body of this call is expected to be equivalent to the request body from the original <a>Restore
Content</a> request</li>
</ul>
<p>Expected client(s): DDP</p>
</section>
<section>
<h3><dfn>Get Restore Status</dfn></h3>
<p>Allows the repository to ask for status of a specific content restore action</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/restore/{restore-id}/status</code></li>
<li>Request Path Parameters:
<ul>
<li><code>restore-id</code>: The identifier of the restore action</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li><code>file-count</code>: The number of files to be restored</li>
<li><code>status</code>: The current <a>restore status</a> of the restore action</li>
<li><code>details</code>: Additional details about the state of the restore action</li>
<li><code>expiration</code>: The date on which the restored content will expire (and no longer be available for
retrieval). This value may be empty until a restore action completes.</li>
</ul>
</li>
<pre class="example">
{
"file-count" : "12",
"status" : "COMPLETE",
"details" : "",
"expiration" : "2020-12-31T23:59:60Z"
}
</pre>
<li>Response Code:
<ul>
<li><code>200</code> (on success)</li>
<li><code>404</code> (if the provided Restore ID does not exist in the system)</li>
</ul>
</li>
</ul>
<ul class="note">
<li>Restored content will only be made available on the Bridge for a limited time. After this time, content will be
removed and the status of the restore will be changed to expired.</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
<section>
<h3><dfn>Get Restored Content</dfn></h3>
<p>Allows for the retrieval of restored content from the Bridge</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/restore/{restore-id}/{filegroup-id}/{file-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>restore-id</code>: The identifier of the restore action</li>
<li><code>filegroup-id</code>: The identifier of the filegroup</li>
<li><code>file-id</code>: The identifier of the file to retrieve</li>
</ul>
</li>
<li>Response: File stream of the restored file</li>
<li>Response Headers:
<ul>
<li><code>Digest</code>: Checksum type and value of the restored file, <a
href="https://tools.ietf.org/html/rfc3230#section-4.3.2">as defined in RFC3230</a></li>
<li><code>Content-Length</code>: Size in bytes of the restored file</li>
</ul>
</li>
<li>Response Code:
<ul>
<li><code>200</code> (on success)</li>
<li><code>307</code> (if the requested content is available at an alternative URI, a <code>Location</code>
header is required)</li>
<li><code>404</code> (if the provided Restore ID, Filegroup ID, or File ID does not exist in the system)</li>
</ul>
</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
<section>
<h3><dfn>Complete Restore</dfn></h3>
<p>Allows the DDP to inform the Bridge that a restore has completed</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/restore/{restore-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>restore-id</code>: Identifier of the completed restore action</li>
</ul>
</li>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<p>Expected client(s): DDP</p>
</section>
</section>
<section>
<h2><dfn>Delete Endpoints</dfn></h2>
<section>
<h3><dfn>Delete Content</dfn></h3>
<p>Removes one or more files from DDP storage</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/delete</code></li>
<li>Request Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies the filegroup from which the file should be deleted</li>
<li><code>version</code>: The version of a filegroup from which the file should be deleted</li>
<li><code>files</code>: List of files to be deleted</li>
<li>File ID: Identifies a file to be deleted</li>
<li>Checksum: Type of checksum and checksum of the file to be deleted (a list of supported checksum types are
provided in <a>Bridge Details</a>). Including the checksum is optional and is used only to verify that the
correct file is being deleted</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # Filegroup ID
"version" : "2019-12-31T23:59:60Z",
"files" : {
"file-1" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
"file-2" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
}
}
}, # Additional filegroups listed here
}
</pre>
<li>Response Code: <code>202</code> (on success)</li>
<li>Response Body: <code>JSON</code>
<ul>
<li><code>delete-id</code>: The identifier for this delete action</li>
</ul>
</li>
<pre class="example">
{
"delete-id" : "54321"
}
</pre>
</ul>
<ul class="note">
<li>It would be possible to retain enough information to be able to provide a tombstone-type response for File IDs
which were at some point in the system but have been removed.</li>
<li>It would be possible to allow the "files" section to be omitted if all files in a given filegroup version are
to be deleted.</li>
<li>It would be possible to allow the value associated with a filegroup ID to be omitted if all files in all
versions of a filegroup are to be deleted. In the provided example, the alternative request would be:
<code>"filegroup-1" : {}</code></li></li>
</ul>
</section>
<section>
<h3><dfn>List Deletes</dfn></h3>
<p>Retrieves a listing of all in-process deletes</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/delete ? status=</code></li>
<li>Request Query Parameters:
<ul>
<li><code>status</code>: (Optional) Limit list to delete actions with a specific <a>delete status</a></li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Delete ID: Identifier for delete action</li>
<li><code>file-count</code>: The number of files to be deleted</li>
<li><code>status</code>: The current <a>delete status</a> of the delete action</li>
<li><code>details</code>: Additional details about the state of the delete action</li>
</ul>
</li>
<pre class="example">
{
"delete-1" : { # Delete ID
"file-count" : "7",
"status" : "ACCEPTED",
"details" : ""
}, # Additional delete actions listed here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>Use is anticipated by both the Gateway (to check on delete requests) and the DDP (to determine if there are
delete requests which are ready for processing)</li>
<li>Delete IDs returned by this method are only those that have been initiated or are in-process</li>
</ul>
<p>Expected client(s): Gateway, DDP</p>
</section>
<section>
<h3><dfn>Get Delete</dfn></h3>
<p>Provides details of the delete request to allow the request to be fulfilled by the DDP</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/delete/{delete-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>delete-id</code>: The identifier of the delete action</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Filegroup ID: Identifies the filegroup from which files are to be deleted</li>
<li><code>version</code>: The version of a filegroup from which files are to be deleted</li>
<li><code>files</code>: List of files to be deleted</li>
<li>File ID: Identifies a file to be deleted</li>
<li>Checksum: Type of checksum and checksum of the file. The checksum is only included if it was part of the
original delete request.</li>
</ul>
</li>
<pre class="example">
{
"filegroup-1" : { # Filegroup ID
"version" : "2019-12-31T23:59:60Z",
"files" : {
"file-1" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
"file-2" : { # File ID
"MD5" : "d41d8cd98f00b204e9800998ecf8427e" # Checksum
},
}
}, # Additional filegroups listed here
}
</pre>
<li>Response Code: <code>200</code> (on success)</li>
</ul>
<ul class="note">
<li>The response body of this call is expected to be equivalent to the request body from the original <a>Delete
Content</a> request</li>
</ul>
<p>Expected client(s): DDP</p>
</section>
<section>
<h3><dfn>Get Delete Status</dfn></h3>
<p>Allows the repository to ask for status of a content delete action</p>
<ul>
<li>Request Type: <code>GET</code></li>
<li>Request Path: <code>/delete/{delete-id}/status</code></li>
<li>Request Path Parameters:
<ul>
<li><code>delete-id</code>: The identifier of the delete action</li>
</ul>
</li>
<li>Response Body: <code>JSON</code>
<ul>
<li>Delete ID: Identifier for delete action</li>
<li><code>file-count</code>: The number of files to be deleted</li>
<li><code>status</code>: The current <a>delete status</a> of the delete action</li>
<li><code>details</code>: Additional details about the state of the delete action</li>
</ul>
</li>
<pre class="example">
{
"delete-1" : {
"file-count" : "7",
"status" : "ACCEPTED",
"details" : ""
}
}
</pre>
<li>Response Code:
<ul>
<li><code>200</code> (on success)</li>
<li><code>404</code> (if the provided Delete ID does not exist in the system)</li>
</ul>
</li>
</ul>
<p>Expected client(s): Gateway</p>
</section>
<section>
<h3><dfn>Complete Delete</dfn></h3>
<p>Allows the DDP to inform the Bridge that a delete has completed</p>
<ul>
<li>Request Type: <code>POST</code></li>
<li>Request Path: <code>/delete/{delete-id}</code></li>
<li>Request Path Parameters:
<ul>
<li><code>delete-id</code>: Identifier of the completed delete action</li>
</ul>
</li>
<li>Response Code: <code>200</code> (on success)</li>
</ul>