Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

LambStatus API v0

Kishin Yagami edited this page Aug 5, 2017 · 10 revisions

This is the API documentation of the LambStatus API v0. The API is still experimental and likely to change. See the change log to check the recent changes.

Authentication

The API calls require an API key in the call header. To get a key, visit the "Settings" page at first. There should be one or more API keys.

If there is no key, create a new one by clicking the "+" icon and then the "SAVE" button.

Pass your API key in a x-api-key header. Here is the curl example:

curl -H 'x-api-key: mxtk2dgnHA1eiY33EL1MI5PUPKrwJvlD3XdW3t3O' https://gytm4qzbx9.execute-api.eu-central-1.amazonaws.com/prod/v0/metrics/data

Rate limiting

Each API token is limited to 10 requests / second.

Metrics

Submit data points

If the metric is "Self" type, you can submit data points via this endpoint.

Request:
  Endpoint: POST https://[your API ID].execute-api.eu-central-1.amazonaws.com/prod/v0/metrics/data
  Body:
    {
      "[metric id]": [
        {
          "timestamp": string (the format must be `YYYY-MM-DDThh:mm:ss.sssZ`),
          "value": number
        },
        ...
      ],
      ...
    }
   Body Example:
    {
      "0rbZByN44Jyd": [
        {
          "timestamp": "2017-06-05T00:00:00.000Z",
          "value": 1
        },
        {
          "timestamp": "2017-06-05T00:01:00.000Z",
          "value": 2
        }
      ],
      "JoNelzrwJzmc": [
        {
          "timestamp": "2017-06-05T00:00:00.000Z",
          "value": 10
        }
      ]
    }

Response (successful case):
  Code: 200
  Body:
    Same format as request body. However, its contents is the ACTUAL values
    saved in the storage. Some data points may be omitted or the second part
    of a timestamp may be discarded due to constraints below.

Response (auth failure case):
  Code: 403
  Body:
    {
      "message": string
    }

Response (other failure case):
  Code: 400
  Body:
    {
      "errors":
        [
          "message": string,
          ...
        ]
    }

Note that there are several constraints:

  • The second part of the timestamp is discarded. For example, the timestamp 2017-06-05T00:00:11.111Z is saved as 2017-06-05T00:00:00.000Z
  • The data points are saved by the minutes. If there are multiple points in one minute, only the latest point is saved.
  • The number of data points per request must be equal to or less than 3000.
Clone this wiki locally