Resource Status Tracking (HTTP API)

Last updated

Was this helpful?

get
GET /api/v2/resources/states/deviations HTTP/1.1
Host: 
Accept: */*
200

List of resource state deviations, allowing to identify resources that have diverged from their expected states

{
  "data": [
    {
      "resource": {
        "id": "myService-myResource",
        "name": "myResource"
      },
      "state": {
        "desired": "connected",
        "current": "connected"
      },
      "runnerInfo": {
        "name": "protocol-mapper",
        "status": "healthy"
      },
      "deviated": true,
      "info": "Host not reachable"
    }
  ],
  "meta": {
    "pagination": {
      "totalPages": 1,
      "totalRows": 1,
      "pageNumber": 1,
      "totalRowsInPage": 1,
      "nextPage": 1,
      "rowsPerPage": 1
    }
  }
}
get
GET /api/v2/resources/states/deviations/count HTTP/1.1
Host: 
Accept: */*
200

Number of resources currently in a deviated state. If no filter is applied the number represents the system wide deviations.

{
  "data": [
    {
      "serviceId": "myService",
      "count": 42
    }
  ],
  "meta": {
    "pagination": {
      "totalPages": 1,
      "totalRows": 1,
      "pageNumber": 1,
      "totalRowsInPage": 1,
      "nextPage": 1,
      "rowsPerPage": 1
    }
  }
}
get
GET /api/v2/resources/states HTTP/1.1
Host: 
Accept: */*
200

List of resources including their state and status. If no ServiceIDs and no ResourceIDs are provided, it acts as a wildcard request. Filtering for ResourceIds takes precedence over filtering for ServiceIds. Meaning as soon as ResourceIDs are provided, the ServiceIDs will be ignored.

{
  "data": [
    {
      "resource": {
        "id": "myService-myResource",
        "name": "myResource"
      },
      "state": {
        "desired": "connected",
        "current": "connected"
      },
      "runnerInfo": {
        "name": "protocol-mapper",
        "status": "healthy"
      },
      "deviated": true,
      "info": "Host not reachable"
    }
  ],
  "meta": {
    "pagination": {
      "totalPages": 1,
      "totalRows": 1,
      "pageNumber": 1,
      "totalRowsInPage": 1,
      "nextPage": 1,
      "rowsPerPage": 1
    }
  }
}