GithubHelp home page GithubHelp logo

isabella232 / specstore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datopian/specstore

0.0 0.0 0.0 96 KB

License: MIT License

Shell 0.21% Python 98.48% Makefile 0.48% Dockerfile 0.83%

specstore's Introduction

DataHQ Spec Store

Build Status

An API server for managing a Source Spec Registry

Quick start

Clone the repo and install

make install

Run tests

make test

Run server

python server.py

Env Vars

  • DATABASE_URL: A SQLAlchemy compatible database connection string (where registry is stored)
  • AUTH_SERVER: The domain name for the authentication server
  • DPP_URL: URL for the datapackage pipelines service (e.g. http://host:post/)

API

Status

/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

Method

GET

Response

{
  "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 running
  • INPROGRESS: Flow is running
  • SUCCEEDED: Finished successfully
  • FAILED: Failed to run

Upload

/source/upload

Method

POST

Headers

  • Auth-Token - permission token (received from conductor)
  • Content-type - application/json

Body

A valid spec in JSON form. You can find example Flow-Spec in README of planer API

Response

{
  "success": true,
  "dataset_id": "<dataset-identifier>",
  "flow_id": "<dataset-identifier-with-revision-number>",
  "errors": [
      "<error-message>"
  ]
}

Update

/source/update

Method

POST

Body

Payload in JSON form.

{
  "pipeline": "<pipeline-id>",
  "event": "queue/start/progress/finish",
  "success": true/false (when applicable),
  "errors": [list-of-errors, when applicable]
}

Response

{
  "success": success/pending/fail,
  "id": "<identifier>"
  "errors": [
      "<error-message>"
  ]
}

specstore's People

Contributors

zelima avatar akariv avatar anuveyatsu avatar mikanebu avatar rufuspollock avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.