0.1.0 • Published 8 years ago

tide-client v0.1.0

Weekly downloads
4
License
GPL-3.0
Repository
github
Last release
8 years ago

node-tide-client

About

Build Status

Build Status

Description

A nodejs tide client

Author

ContainerShip Developers - developers@containership.io

Installation

npm install tide-client

Usage

Instantiation

Create a new TideClient

var TideClient = require("tide-client");
var tide_client = new TideClient({
    base_url: "127.0.0.1",  // base url of tide server
    port: 80,               // port tide server is listening on
    api_version: "v1",      // api version of tide server
    timeout: 5000           // request timeout
});

Get Jobs

Get all jobs

tide_client.get_jobs(function(err, jobs){
    if(err)
        throw err;

    console.log(jobs);
});

Get Job

Get a specific job

tide_client.get_job("jobname", function(err, job){
    if(err)
        throw err;

    console.log(job);
});

Add Job

Add a new job

tide_client.add_job({
    id: "jobname",
    application: {
        image: "owner/image:latest",
        cpus: 0.1,
        memory: 64
    },
    instances: 1,
    schedule: "0 0 0 * * *"
}, function(err){
    if(err)
        throw err;
});

Edit Job

Edit an existing job

tide_client.edit_job("jobname", {
    schedule: "0 0 4 * * *"
}, function(err){
    if(err)
        throw err;
});

Remove Job

Remove a job

tide_client.remove_job("jobname", function(err){
    if(err)
        throw err;
});

Contributing

Pull requests and issues are encouraged!