krrrr38 / mackerel-client-scala

Mackerel Scala API Client

GitHub

mackerel-client-scala

Build Status codecov.io Maven Central 2.11.x Maven Central 2.10.x License: MIT

mackerel-client-scala - Mackerel Scala API Client

Description

mackerel-client-scala is Scala Client for Mackerel API.

Usage

libraryDependencies += "com.krrrr38" %% "mackerel-client-scala" % "0.3.0"

or SNAPSHOT version

resolvers += Opts.resolver.sonatypeSnapshots

libraryDependencies += "com.krrrr38" %% "mackerel-client-scala" % "0.3.1-SNAPSHOT"

Synopsis

import com.krrrr38.mackerel4s.MackerelClient
import com.krrrr38.mackerel4s.model.MackereResponseError
val mackerel = new MackerelClient("api-key", "user-agent")
mackerel.listHosts.setService("service-name").run onComplete {
  case Success(res) => ...
  case Failure(ex: MackereResponseError) => s.statusCode ...
  case Failure(ex) => ...
}

Status

category api action status
Services List of Services GET /api/v0/services
Roles List of Roles GET /api/v0/services/<serviceName>/roles
Hosts Registering host information POST /api/v0/hosts
Getting host information GET /api/v0/hosts/<hostId>
Updating host information PUT /api/v0/hosts/<hostId>
Updating host status POST /api/v0/hosts/<hostId>/status
Retiring a host POST /api/v0/hosts/<hostId>/retire
List of hosts GET /api/v0/hosts
Metrics Posting metrics POST /api/v0/tsdb
Getting host metrics GET /api/v0/hosts/<hostId>/metrics
Getting latest metrics GET /api/v0/tsdb/latest
Posting graph definitions POST /api/v0/graph-defs/create
Posting service metrics POST /api/v0/services/<serviceName>/tsdb
Getting service metrics GET /api/v0/services/<serviceName>/metrics
Posting monitoring check results POST /api/v0/monitoring/checks/report
Monitors Register monitor configurations POST /api/v0/monitors
Get monitor configurations GET /api/v0/monitors
Update monitor configurations PUT /api/v0/monitors/<monitorId>
Delete monitor configurations DELETE /api/v0/monitors/<monitorId>
Alerts Getting Alerts GET /api/v0/alerts
Closing Alerts POST /api/v0/alerts/<alertId>/close
Dashboards Creating Dashboards POST /api/v0/dashboards 🚫
Getting Dashboards GET /api/v0/dashboards/<dashboardId> 🚫
Updating Dashboards PUT /api/v0/dashboards/<dashboardId> 🚫
Deleting Dashboards DELETE /api/v0/dashboards/<dashboardId> 🚫
List of Dashboards GET /api/v0/dashboards 🚫
Users List of users GET /api/v0/users 🚫
Delete users DELETE /api/v0/users/<userId> 🚫

Contribution

  1. Fork (https://github.com/krrrr38/mackerel-client-scala)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test with sbt test(sbt clean coverage test) and confirm that it passes
  6. Create new Pull Request