Giter Club home page Giter Club logo

target-rest's Introduction

Target REST API

This is a Singer target that sends JSON-formatted data to the REST API following the Singer spec.

Configuration

Example configuration with all possible configuration keys is below. The only required key is api_url. Other keys are optional.

{
    "api_url": "https://some_url.com/v1/endpoint",
    "disable_collection": true,
    "batch_size": null,
    "auth_token": null,
    "allowed_keys": ["a", "b"],
    "request_timeout": 10
}

Description of configuration keys:

  • api_url - REST API endpoint URL. The only required configuration key.
  • disable_collection - disable sending anonymous usage data to singer.io if set to true
  • batch_size - number of JSON lines that should be send in one batch. If set to null or not specified the batch size is set to 1
  • auth_token - authorization token
  • allowed_keys - keys from input JSON that should be propagated to the REST API
  • request_timeout - time for one request in seconds

Testing

There are no automatic tests yet, but you can find the instructions for manual testing in the folder test

TODOs

  • Handle server authentification
  • Handle bad URL and issues with REST server
  • Make batching safer It is probably fine now but someone should check it
  • Implement reaction to singer message ActivateVersionMessage Now it is just ignored but to implement this could be tricky. We would need specific enpoint that will delete all previously send records and check record version.
  • Think about better way to handle the last batch that is smaller then batch_size (for cases when data_size % batch_size != 0)
  • Better handling of REST server response codes < 400 For example response codes like 204 - No content is treated like everithing is fine but it can mean some problems
  • Implement allowed_keys and request_timeout from configuration

target-rest's People

Contributors

lukoucky avatar martinazapletalova avatar

Watchers

Martin Stava avatar Honza Hovorka avatar Daniel Kraus avatar  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.