Skip to content

muddydixon/node-mackerel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mackerel node.js client Build Status

This module is node.js client for Mackerel.io

Install

$ npm install mackerel

Usage

Get Api Key by "Detail" page via dashboard

Mackerel = require "mackerel"
mackerel = new Mackerel("your api key")

# use Promise
mackerel.getHosts()
.then(({res, body})->
  console.log body.hosts # hosts info array
)

# or callback function
mackerel.getHosts((err, res, body)->
  console.log body.hosts # hosts info array
)

APIs

  • getHosts([callback])
  • addHost(data[, callback])
  • getHostInfo(id[, callback])
  • updateHostInfo(id, data[, callback])
  • changeHostStatus(id, status[, callback])
  • retireHost(id[, callback])
  • postMetric(data[, callback])
  • postServiceMetric(service, data[, callback])

See detail: mackerel api specification

TODOs

  • stream post metric

Author

@muddydixon [email protected]

License

Apache License Version 2.0

Contribute

git clone [email protected]:muddydixon/node-mackerel.git
cd node-mackerel
npm install
# and write code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published