Code Monkey home page Code Monkey logo

crontainer's Introduction

Crontainer - a container based cron system

API

The API supports

  • Getting a list of jobs in the system.
    Done via a HTTP GET request
  • Get info about a single job Done via a HTTP GET request
  • Creating New jobs
    Done via HTTP POST request with json body
  • Deleting Jobs Done via HTTP DELETE request with resource in the url

API Examples

GET Jobs Request

curl "http://localhost:8675/jobs"

GET Schedule Request

curl "http://localhost:8675/schedule"

Response

{
  "0": [],
  "1496284800": [
    {
      "CronPattern": "*/5 * * * *",
      "ImageName": "alpine",
      "RunCommand": [
        "echo",
        "foo",
        "bar"
      ],
      "NextRun": 1496284800,
      "State": 1,
      "Hash": "19861539a1c0dcf0c72fa80e37a86904ccee2e60"
    },
    {
      "CronPattern": "*/10 * * * *",
      "ImageName": "alpine",
      "RunCommand": [
        "echo",
        "foo",
        "baz"
      ],
      "NextRun": 1496284800,
      "State": 1,
      "Hash": "0c76f5dfd7c1b440715b23016e3ca277c9540fd3"
    }
  ]
}

GET Job Request

curl "http://localhost:8675/job"

Response

{
  "CronPattern": "*/1 * * * *",
  "ImageName": "alpine",
  "RunCommand": [
    "echo",
    "hello",
    "world"
  ],
  "NextRun": 1496281500,
  "State": 1,
  "Hash": "7c251e80adab3e1606c65b781be68ba9c05e0b18"
}

POST Request

curl -X "POST" "http://localhost:8675" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d $'{
  "CronPattern": "*/1 * * * *",
  "RunCommand": [
    "echo",
    "hello",
    "world"
  ],
  "State": 1,
  "ImageName": "alpine"
}'

DELETE Job

curl -X "DELETE" "http://localhost:8675/job/7c251e80adab3e1606c65b781be68ba9c05e0b18"

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.