HTTP API

The REST API is split in to two main parts, repair and fulfillment.

Repair API

GET /api/repairs/?<requested=?,collection=?,depositor=?,offers=?>

GET /api/repairs/<id>

POST /api/repairs/

POST /api/repairs/<id>/fulfill

PUT /api/repairs/<id>/cleaned

PUT /api/repairs/<id>/replaced

PUT /api/repairs/<id>/audit

PUT /api/repairs/<id>/ready

PUT /api/repairs/<id>/status
PUT /api/repairs/<id>/validated

PUT /api/repairs/<id>/complete

Models

Repair Request

A repair request, sent out by a node who notices they have corrupt files in a collection

{
"depositor": "depositor-with-corrupt-collection",
"collection": "collection-with-corrupt-files",
"files": ["file_0", "file_1", ..., "file_n"]
}

Repair

A repair structure, returned by the Ingest server after a repair request is received

{
"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",
"files": ["file_0", "file_1", ..., "file_n"],
"from": "node-with-valid-files",
"type" "ace|node-to-node|ingest",
"credentials": { ... }
}

Credentials ACE

{
"type": "ace",
"api-key": "ace-api-key",
"url": "https://node_v/ace-am" # ?? Not sure if really needed
}

Credentials Node-to-Node

{
"type": "node-to-node",
"link": "node_i@node_v.edu:/homes/node_i/path/to/repair"
}

Credentials Ingest

{
"type": "ingest",
"link": "node_i@chron.ucsd.edu:/path/to/repair"
}



  • No labels