Sources

Resource Operation Description
DELETE DELETE /v1/teams/(team_id)/sources/(source_id) Delete a source.
GET GET /v1/sources Return the available sources.
  GET /v1/teams/(team_id)/sources/(source_id) Get a source from a team.
  GET /v1/teams/(team_id)/sources List the sources of a team.
  GET /v1/sources/(source_name) Return a specific source.
POST POST /v1/teams/(team_id)/sources Add a new source.
PUT PUT /v1/teams/(team_id)/sources/(source_id) Edit an existing source.
GET /v1/sources

Return the available sources.

Example request:

GET /sources HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{
  "sources": [{
    "name": "OpenTSDB",
    "description": "Use an OpenTSDB database to launch your queries.",
    "type": "object",
    "required": ["url", "credentials"],
    "schema": {
      "properties": {
        "credentials": {
          "description": "The credentials used authenticate the queries.",
          "title": "Credentials",
          "type": "string"
        },
        "url": {
          "description": "The url used to query the database.",
          "title": "Url",
          "type": "string"
        }
      },
    },
    "form": [{
      "key": "url",
      "placeholder": "http://127.0.0.1"
    }, {
      "key": "credentials",
      "placeholder": "foo:bar"
    }]
  }]
}
Response Headers:
 
Status Codes:
  • 200 OK – list of available sources
GET /v1/teams/(team_id)/sources/(source_id)

Get a source from a team.

Example request:

GET /teams/66859c4a-3e0a-4968-a5a4-4c3b8662acb7/sources/672d82d7-1970-48cd-a690-20f5daf303cf HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{
   "checks": [{
     "created_at": "2018-05-17T11:52:25Z",
     "id": "86ee5bdb-7088-400c-8654-a162f18b0710",
     "name": "Server Ping",
     "parameters": {
       "metric": "depc.tutorial.ping",
       "threshold": 20
     },
     "source_id": "672d82d7-1970-48cd-a690-20f5daf303cf",
     "type": "Threshold",
     "updated_at": "2018-11-12T17:41:11Z"
   }],
   "configuration": {},
   "createdAt": "2018-05-16T11:38:46Z",
   "id": "672d82d7-1970-48cd-a690-20f5daf303cf",
   "name": "My source",
   "plugin": "Fake",
   "updatedAt": "2019-01-15T13:33:22Z"
}
Response Headers:
 
Status Codes:
  • 200 OK – the list of sources
PUT /v1/teams/(team_id)/sources/(source_id)

Edit an existing source.

Example request:

PUT /v1/teams/66859c4a-3e0a-4968-a5a4-4c3b8662acb7/sources/e2c1c635-2d7c-4881-83d1-e4e7027ac7a2 HTTP/1.1
Host: example.com
Accept: application/json

{
  "name": "My edited source"
}

Example response:

HTTP/1.1 200 OK

{
  "checks": [],
  "configuration": {},
  "createdAt": "2019-01-21T14:08:22Z",
  "id": "e2c1c635-2d7c-4881-83d1-e4e7027ac7a2",
  "name": "My edited source",
  "plugin": "Fake",
  "updatedAt": "2019-01-21T14:21:24Z"
}
Response Headers:
 
Status Codes:
  • 200 OK – the edited source
DELETE /v1/teams/(team_id)/sources/(source_id)

Delete a source.

Example request:

DELETE /v1/teams/66859c4a-3e0a-4968-a5a4-4c3b8662acb7/sources/e2c1c635-2d7c-4881-83d1-e4e7027ac7a2 HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{}
Response Headers:
 
Status Codes:
  • 200 OK – the source has been deleted
GET /v1/teams/(team_id)/sources

List the sources of a team.

Example request:

GET /teams/66859c4a-3e0a-4968-a5a4-4c3b8662acb7/sources HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{
  "sources": [
     {
       "checks": [{
         "created_at": "2018-05-17T11:52:25Z",
         "id": "86ee5bdb-7088-400c-8654-a162f18b0710",
         "name": "Server Ping",
         "parameters": {
           "metric": "depc.tutorial.ping",
           "threshold": 20
         },
         "source_id": "672d82d7-1970-48cd-a690-20f5daf303cf",
         "type": "Threshold",
         "updated_at": "2018-11-12T17:41:11Z"
       }],
       "configuration": {},
       "createdAt": "2018-05-16T11:38:46Z",
       "id": "672d82d7-1970-48cd-a690-20f5daf303cf",
       "name": "My source",
       "plugin": "Fake",
       "updatedAt": "2019-01-15T13:33:22Z"
    }
  ]
}
Response Headers:
 
Status Codes:
  • 200 OK – the list of sources
POST /v1/teams/(team_id)/sources

Add a new source.

Example request:

POST /v1/teams/66859c4a-3e0a-4968-a5a4-4c3b8662acb7/sources HTTP/1.1
Host: example.com
Accept: application/json

{
  "name": "My source",
  "plugin": "Fake",
  "configuration": {}
}

Example response:

HTTP/1.1 201 CREATED

{
  "checks": [],
  "configuration": {},
  "createdAt": "2019-01-21T14:08:22Z",
  "id": "e2c1c635-2d7c-4881-83d1-e4e7027ac7a2",
  "name": "My source",
  "plugin": "Fake",
  "updatedAt": "2019-01-21T14:08:22Z"
}
Response Headers:
 
Status Codes:
GET /v1/sources/(source_name)

Return a specific source.

Example request:

GET /sources/OpenTSDB HTTP/1.1
Host: example.com
Accept: application/json

Example response:

HTTP/1.1 200 OK

{
  "name": "OpenTSDB",
  "description": "Use an OpenTSDB database to launch your queries.",
  "type": "object",
  "required": ["url", "credentials"],
  "schema": {
    "properties": {
      "credentials": {
        "description": "The credentials used authenticate the queries.",
        "title": "Credentials",
        "type": "string"
      },
      "url": {
        "description": "The url used to query the database.",
        "title": "Url",
        "type": "string"
      }
    },
  },
  "form": [{
    "key": "url",
    "placeholder": "http://127.0.0.1"
  }, {
    "key": "credentials",
    "placeholder": "foo:bar"
  }]
}
Response Headers:
 
Status Codes: