...
The REST API is split in to two main parts, repair and fulfillment.
Repair API
GET /api/repairrepairs/requests?<requested=?,collection=?,depositor=?,offers=?>
GET /api/repair/requestsrepairs/<id>
POST /api/repairrepairs/requests
POST /api/repair/requestsrepairs/<id>/fulfill
PUT /api/repair/requestsrepairs/<id>/cleaned
PUT
/api/repair/requestsrepairs/<id>/replaced
PUT
/api/repairrepairs/requests/<id>/audit
Fulfillment API
GET /api/repair/fulfillments?<to=?,from=?,status=?>
GET /api/repair/fulfillemnts/<id>
PUT /api/repair/fulfillmentsrepairs/<id>/ready
PUT
PUT /api/
...
repairs/
...
<id>/
...
status
PUT
/api/
...
repairs/<id>/validated
PUT /api/repairrepairs/fulfillemnts/<id>/complete
Models
Repair Request
A repair request, sent out by a node who notices they have corrupt files in a collection
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "id": 1, "fulfillment": 3, "createdAt": "2017-03-15T19:22:29Z", "updatedAt": "2017-03-15T19:22:29Z", "cleaned": true|false, "replaced": true|false, "validated": true|false, "audit": "pre|auditing|success|fail", "status": "requested|staging|ready|transferred|repaired|failed", "to": "node-with-corrupt-file", "requester": "user-from-node", "depositor": "depositor-with-corrupt-collection", "collection": "collection-with-corrupt-files", "status": "requested|fulfilling|repaired|failed", "audit": "pre|auditing|success|fail", "cleaned": true|false, "replaced": true|false, "files": ["file_0", "file_1", ..., "file_n"] } |
Fulfillment
A fulfillment for a repair, returned by the Ingest server after a node notifies it can fulfill a repair request. Credentials are only visible to the requesting node and administrators.
Code Block | ||||
---|---|---|---|---|
| ||||
{ "id": 3, "repair": 1, "createdAt": "2017-03-15T19:22:29Z", "updatedAt": "2017-03-15T19:22:29Z", "to": "node-with-corrupt-file", "from": "node-with-valid-filefiles", "type" "ace|node-to-node|ingest", "credentials": { ... }, "status": "staging|ready|complete|failed", "cleaned": true|false, "validated": true|false } |
Credentials ACE
Code Block | ||||
---|---|---|---|---|
| ||||
{ "type": "ace", "api-key": "ace-api-key", "url": "https://node_v/ace-am" # ?? Not sure if really needed } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "type": "node-to-node", "urllink": "node_i@node_v.edu:/homes/node_i/path/to/repair" } |
Credentials
...
Ingest
Code Block | ||||
---|---|---|---|---|
| ||||
{ "type": "ingest", "urllink": "node_i@chron.ucsd.edu:/path/to/repair" } |
...