This project has retired. For details please refer to its Attic page.
Chukwa Agent REST API

Chukwa Agent REST API


Chukwa Agent provides REST interfaces that allow management of data stream movement. The primary resources are:


The resources and the entities that are passed to them are defined using JAXB and are represented in either XML or JSON formats depending on the ContentType and Accept HTTP headers. The definition of the types is given in the JavaDoc.


Typical usage would be to create a new adaptor from a pre-defined one and change the necessary configuration parameters. Then configure parser to process the data stream.

Summary

ResourceMethodDescription
http://[host]:[port]/rest/v2/adaptorGET

POST

Get all adaptors

Adds an adaptor to the agent and returns the adaptor info
http://[host]:[port]/rest/v2/adaptor/{adaptorId}DELETE

GET

Remove an adaptor from the agent

Get a single adaptor

Grammars

agent-schema.xsd

Resources


http://[host]:[port]/rest/v2/adaptor

JAX-RS controller to handle all HTTP request to the Agent that deal with adaptors.

Methods
GETgetAdaptors()

Get all adaptors

request
unspecified
responses
representations
Status: 200Content-Type: application/json
List all configured adaptors

Example
{
  "adaptorInfo" : [ {
    "id" : "adaptor_93df4746476c9a4b624f6755b122f9dc",
    "dataType" : "JobSummary",
    "adaptorClass" : "org.apache.hadoop.chukwa.datacollection.adaptor.SocketAdaptor",
    "adaptorParams" : "9098",
    "offset" : 1680,
    "adaptorRates" : [ {
      "rate" : 100.123,
      "intervalInSeconds" : 60
    }, {
      "rate" : 100.123,
      "intervalInSeconds" : 300
    }, {
      "rate" : 100.123,
      "intervalInSeconds" : 600
    } ]
  }, {
    "id" : "adaptor_c79bf882974a14286cffe29d3d4cf0d6",
    "dataType" : "SystemMetrics",
    "adaptorClass" : "org.apache.hadoop.chukwa.datacollection.adaptor.sigar.SystemMetrics",
    "adaptorParams" : "5",
    "offset" : 5678,
    "adaptorRates" : [ {
      "rate" : 9.09,
      "intervalInSeconds" : 60
    }, {
      "rate" : 7.55,
      "intervalInSeconds" : 300
    }, {
      "rate" : 6.44,
      "intervalInSeconds" : 600
    } ]
  } ],
  "adaptorCount" : 2
}

POSTaddAdaptor()

Adds an adaptor to the agent and returns the adaptor info

request
representations
Content-Type: application/json

Example
{
  "dataType" : "JobSummary",
  "adaptorClass" : "org.apache.hadoop.chukwa.datacollection.adaptor.SocketAdaptor",
  "adaptorParams" : "9098",
  "offset" : 0
}

Content-Type: application/xml
Example for application/xml is available in /rest/v2/application.wadl
responses
representations
Status: 200Content-Type: application/json
Adaptor has been registered

Example
{
  "id" : "adaptor_93df4746476c9a4b624f6755b122f9dc",
  "dataType" : "JobSummary",
  "adaptorClass" : "org.apache.hadoop.chukwa.datacollection.adaptor.SocketAdaptor",
  "adaptorParams" : "9098",
  "offset" : 1680,
  "adaptorRates" : [ {
    "rate" : 100.123,
    "intervalInSeconds" : 60
  }, {
    "rate" : 100.123,
    "intervalInSeconds" : 300
  }, {
    "rate" : 100.123,
    "intervalInSeconds" : 600
  } ]
}

Status: 400Content-Type: text/plain
Example for text/plain is available in /rest/v2/application.wadl

http://[host]:[port]/rest/v2/adaptor/{adaptorId}

Methods
DELETEremoveAdaptor()

Remove an adaptor from the agent

request
path parameters
adaptorIdstringid of the adaptor to return

responses
representations
Status: 200Content-Type: text/plain
Example for text/plain is available in /rest/v2/application.wadl
GETgetAdaptor()

Get a single adaptor

request
path parameters
adaptorIdstringid of the adaptor to return

responses
representations
Status: 200Content-Type: application/json
Adaptor status and data transfer rate in 1, 5, 10 minutes averages

Example
{
  "id" : "adaptor_93df4746476c9a4b624f6755b122f9dc",
  "dataType" : "JobSummary",
  "adaptorClass" : "org.apache.hadoop.chukwa.datacollection.adaptor.SocketAdaptor",
  "adaptorParams" : "9098",
  "offset" : 1680,
  "adaptorRates" : [ {
    "rate" : 100.123,
    "intervalInSeconds" : 60
  }, {
    "rate" : 100.123,
    "intervalInSeconds" : 300
  }, {
    "rate" : 100.123,
    "intervalInSeconds" : 600
  } ]
}