An API server for managing a Source Spec Registry
make install
make test
python server.py
DATABASE_URL
: A SQLAlchemy compatible database connection string (where registry is stored)AUTH_SERVER
: The domain name for the authentication serverDPP_URL
: URL for the datapackage pipelines service (e.g.http://host:post/
)
/source/{owner}/{dataset-id}/{revision-number}
Note: Also, you can get info about latest and latest successful revisions by hitting following endpoints
- latest -
/source/{owner}/{dataset-id}/latest
- successful -
/source/{owner}/{dataset-id}/successful
GET
{
"id": "<revision-id>",
"spec_contents": <source-specifications>,
"modified": <last-modified>,
"state": <QUEUED|INPROGRESS|SUCCEEDED|FAILED>,
"logs": <full-logs>,
"error_log": [ <error-log-lines> ],
"stats": {
"bytes": <number>,
"count_of_rows": <number>,
"dataset_name": <string>,
"hash": <datapackage-hash>
},
"pipelines": {
"<pipeline-id-1>": {
"title": "Creating CSV",
"status": "SUCCEEDED",
"stats": null,
"error_log": []
},
"<pipeline-id-2>": {
"title": "Creating JSON",
"status": "INPROGRESS",
"stats": {},
"error_log": []
},
"<pipeline-id-3>": {
"title": "Creating ZIP",
"status": "FAILED",
"stats": {},
"error_log": [
'error',
'logs'
]
}
}
}
state definition:
QUEUED
: Flow created but not runningINPROGRESS
: Flow is runningSUCCEEDED
: Finished successfullyFAILED
: Failed to run
/source/upload
POST
Auth-Token
- permission token (received from conductor)- Content-type - application/json
A valid spec in JSON form. You can find example Flow-Spec in README of planer API
{
"success": true,
"dataset_id": "<dataset-identifier>",
"flow_id": "<dataset-identifier-with-revision-number>",
"errors": [
"<error-message>"
]
}
/source/update
POST
Payload in JSON form.
{
"pipeline": "<pipeline-id>",
"event": "queue/start/progress/finish",
"success": true/false (when applicable),
"errors": [list-of-errors, when applicable]
}
{
"success": success/pending/fail,
"id": "<identifier>"
"errors": [
"<error-message>"
]
}