Home

Chargeback reports

/chargeback/cb/app?gte={date}&lte={date}

Gets chargeback reports by application type. Gives the count of all applications in all queues for all users across all clusters.

Compatibility

This endpoint is available on Unravel 4.5.1.0+. If you're using an older version of Unravel, see /search/cb/appt?from={date}&to={date}.

Request
GET http://unravel-host:3000/api/v1/chargeback/cb/app?gte={date}&lte={date}
Path parameters

None.

Query parameters

Required parameters are highlighted.

Name

Type

Description

gte

string

Start date. Format: YYYY-MM-DD or Unix epoch value.

lte

string

End date. Format: YYYY-MM-DD or Unix epoch value.

Response body

The response body contains one array per application type. The table below describes the contents of the array.

Name

Type

Description

ms

integer

Memory usage in seconds.

count

integer

Application count.

v1

string

Application type (mr, spark).

vs

integer

Vcore usage in seconds.

Examples

Request:

curl -X GET "http://myserver.com:3000/api/v1/chargeback/cb/appt?gte=2019-01-02&lte=2019-04-02" -H  "accept: application/json" -H  "Authorization: JWT token"

Response body:

[
  {
    "type": "mr",
    "appCount": 39,
    "cpuHours": "4.14",
    "memoryHours": "2Y 11M 3D 14h 27m 33s"
  },
  {
    "type": "tez",
    "appCount": 39,
    "cpuHours": "87.16",
    "memoryHours": "82Y 8M 26D 9h 14m 12s"
  },
  {
    "type": "spark",
    "appCount": 29,
    "cpuHours": "2.14",
    "memoryHours": "5M 13D 5h 9m 26s"
  }
]
/chargeback/cb/appt/queue

Gets chargeback reports by queue.

Compatibility

This endpoint is available on Unravel 4.5.0.9+. If you're using an older version of Unravel, see /search/cb/appt/queue.

Request
GET http://unravel-host:3000/api/v1/chargeback/cb/appt/queue?gte={date}&lte={date}
Path parameters

None.

Query parameters

Required parameters are highlighted.

Name

Type

Description

gte

string

Start date. Format: YYYY-MM-DD or Unix epoch value.

lte

string

End date. Format: YYYY-MM-DD or Unix epoch value.

Response body

The response body contains one array per application type. The table below describes the contents of the array.

Name

Type

Description

count

integer

Application count.

v1

string

Application type (mr, spark).

cb

array

Array of users or queues (depending on command) containing:

ms: Memory usage in milliseconds.
count: Application count.
v2: username or queue name.
vs: Vcore usage in seconds.
Examples

Request:

curl -X GET "http://myserver.com:3000/api/v1/chargeback/cb/appt/queue?gte=2019-01-02&lte=2019-04-02" -H  "accept: application/json" -H  "Authorization: JWT token"

Response body:

[
  {
    "type": "mr",
    "appCount": 37,
    "cpuHours": "3.66",
    "queue": "root.hdfs",
    "memoryHours": "2Y 8M 8D 16h 44m 45s"
  },
  {
    "type": "mr",
    "appCount": 2,
    "cpuHours": "0.48",
    "queue": "root.hbase",
    "memoryHours": "2M 24D 21h 42m 48s"
  },
  {
    "type": "tez",
    "appCount": 38,
    "cpuHours": "87.14",
    "queue": "root.hdfs",
    "memoryHours": "82Y 8M 18D 13h 30m 38s"
  },
  {
    "type": "tez",
    "appCount": 1,
    "cpuHours": "0.02",
    "queue": "root.unravel",
    "memoryHours": "7D 19h 43m 34s"
  },
  {
    "type": "spark",
    "appCount": 24,
    "cpuHours": "1.60",
    "queue": "root.hdfs",
    "memoryHours": "3M 27D 22h 4m 31s"
  },
  {
    "type": "spark",
    "appCount": 3,
    "cpuHours": "0.52",
    "queue": "root.user1",
    "memoryHours": "1M 14D 10h 47m 48s"
  },
  {
    "type": "spark",
    "appCount": 2,
    "cpuHours": "0.01",
    "queue": "root.unravel",
    "memoryHours": "20h 17m 7s"
  }
]
/chargeback/cb/appt/user?gte={date}&lte={date}

Gets chargeback reports by user.

Compatibility

This endpoint is available on Unravel 4.5.1.0+. If you're using an older version of Unravel, see /search/cb/appt/user?from={date}&to={date}.

Request
GET http://unravel-host:3000/api/v1/chargeback/cb/appt/user?gte={date}&lte={date}
Path parameters

None.

Query parameters

Required parameters are highlighted.

Name

Type

Description

gte

string

Start date. Format: YYYY-MM-DD or Unix epoch value.

lte

string

End date. Format: YYYY-MM-DD or Unix epoch value.

Response body

The response body contains one array per application type. The table below describes the contents of the array.

Name

Type

Description

count

integer

Application count.

v1

string

Application type (mr, spark).

cb

array

Array of users or queues (depending on command) containing:

ms: Memory usage in milliseconds.
count: Application count.
v2: username or queue name.
vs: Vcore usage in seconds.
Examples

Request:

curl -X GET "http://myserver.com:3000/api/v1/chargeback/cb/appt/user?gte=2019-01-02&lte=2019-04-02" -H  "accept: application/json" -H  "Authorization: JWT token"

Response body:

[
  {
    "type": "mr",
    "appCount": 37,
    "cpuHours": "3.66",
    "user": "hdfs",
    "memoryHours": "2Y 8M 8D 16h 44m 45s"
  },
  {
    "type": "mr",
    "appCount": 2,
    "cpuHours": "0.48",
    "user": "hbase",
    "memoryHours": "2M 24D 21h 42m 48s"
  },
  {
    "type": "tez",
    "appCount": 38,
    "cpuHours": "87.14",
    "user": "hdfs",
    "memoryHours": "82Y 8M 18D 13h 30m 38s"
  },
  {
    "type": "tez",
    "appCount": 1,
    "cpuHours": "0.02",
    "user": "unravel",
    "memoryHours": "7D 19h 43m 34s"
  },
  {
    "type": "spark",
    "appCount": 24,
    "cpuHours": "1.60",
    "user": "hdfs",
    "memoryHours": "3M 27D 22h 4m 31s"
  },
  {
    "type": "spark",
    "appCount": 3,
    "cpuHours": "0.52",
    "user": "user1",
    "memoryHours": "1M 14D 10h 47m 48s"
  },
  {
    "type": "spark",
    "appCount": 2,
    "cpuHours": "0.01",
    "user": "unravel",
    "memoryHours": "20h 17m 7s"
  }
]