Coder Social home page Coder Social logo

marathon-node's Introduction

marathon-node CircleCI

Node.js client library for Mesos Marathon's REST API powered by Bluebird promises.

const opts = {};
const marathon = require('marathon-node')(MARATHON_URL, opts);
marathon.app
  .getList()
  .then(console.log)
  .catch(console.error);

Options

Options passed to request lib. Overview of all the options is here.

HTTP Authentication example:

const opts = {
    auth: {
        user: 'foo',
        pass: 'baz'
    }
};

Other options:

  • logTime - if true, logs requests time to console

Marathon Event Bus

To manage event stream EventSource client is used.

Example:

const marathon = require('marathon-node')(MARATHON_URL, opts);

const eventSourceOpts = {
    eventType: ['status_update_event'], // (string|array) Marathon will stream only this kind of events. (optional, Marathon >= 1.3.7)
    proxy: 'http://your.proxy.com' // (string) Proxy host (optional)
};
const es = marathon.events.createEventSource(eventSourceOpts);
es.addEventListener('status_update_event', event => console.log('status_update_event'));
es.on('open', () => console.log('opened'));
es.on('error', err => console.error(err));

You can find more info in the official documentation Marathon Event Bus docs.

Methods

Apps (marathon.apps.methodName)

  • getList(parameters)
  • getOne(id)
  • getVersions(id)
  • getVersion(id, version)
  • getTasks(id)
  • create(body)
  • update(id, body, force)
  • restart(id, force)
  • destroy(id)
  • killTasks(id, parameters)
  • killTask(id, task, scale)

Groups (marathon.groups.methodName)

  • getList()
  • create(body)
  • getOne(id)
  • update(id, body, force)
  • destroy(id, force)

Tasks (marathon.tasks.methodName)

  • getList()
  • kill(body, scale, wipe)

Deployments (marathon.deployments.methodName)

  • getList()
  • destroy(id)

Event Stream (marathon.events.methodName)

  • attach() (deprecated)
  • createEventSource(opts)

Event Subscriptions (marathon.subscriptions.methodName)

  • getList()
  • create(callbackUrl)

Queue (marathon.queue.methodName)

  • get()
  • resetDelay(appId)

Server Info (marathon.info.methodName)

  • get()

Leader (marathon.leader.methodName)

  • get()
  • abdicate()

Miscellaneous (marathon.misc.methodName)

  • ping()

marathon-node's People

Contributors

castanhob avatar ellenaua avatar pnedelko avatar yarikos avatar

Watchers

 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.