You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

HTTP API

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

Repair API

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

GET /api/repair/requests/<id>

POST /api/repair/requests

POST /api/repair/requests/<id>/fulfill

PUT /api/repair/requests/<id>/cleaned

PUT /api/repair/requests/<id>/replaced

PUT /api/repair/requests/<id>/audit

Fulfillment API

GET /api/repair/fulfillments?<to=?,from=?,status=?>

GET /api/repair/fulfillemnts/<id>

PUT /api/repair/fulfillments/<id>/ready

PUT /api/repair/fulfillments/<id>/cleaned

PUT /api/repair/fulfillments/<id>/status

PUT /api/repair/fulfillemnts/<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",
"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.

{
"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-file",
"type" "ace|node-to-node|ingest",
"credentials": { ... },
"status": "staging|ready|complete|failed",
"cleaned" true|false
}

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",
"url": "node_i@node_v.edu:/homes/node_i/path/to/repair"
}

Credentials Node-to-Node

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



  • No labels