Home

/clusters/resources/{resource_type}/{query_type}?to={time}&from={time}&interval={polling_interval}

Gets average number of jobs by type.

Request
GET http://unravel-host:3000/api/v1/clusters/resources/{resource_type}/{query_type}?to={time}&from={time}&interval={polling_interval}
Path parameters

Name

Type

Description

resource_type

string

Resource type.

Valid values:

cpu: vcore usage in bytes
memory: memory usage in bytes

query_type

string

Query type.

Valid values:

allocated:
total
Query parameters

Required parameters are highlighted.

Name

Type

Description

interval interval

string

Polling interval.

Valid values are 1m, 5m, 10m, 30m, |1hk

from from

string

Start time in Unix epoch format.

to to

string

End time in Unix epoch format.

Response body
{
   epoch-timestamp : count
}
Examples
Allocated vcores

Request:

curl -X GET "http://myserver.com:3000/api/v1/clusters/resources/cpu/allocated?to=1538666160&interval=30m&from=1536273311" -H "accept: application/json" -H  "Authorization: JWT token"

Response:

{
    "1535360400000": "12", 
    "1535364000000": "3.125", 
    "1535367600000": "5.0303030303"
}
Total memory

Request:

curl -X GET "http://localhost:3000/api/v1/clusters/resources/memory/total?to=1536273841&interval=1h&from=1536187441" -H "accept: application/json" -H  "Authorization: JWT token"

Response:

{
    "1535364000000": 47460,
    "1535367600000": 45087,
    "1535371200000": 37968
}