API reference

Usage

Your and your organization's dev use against the policy's budgets.

GET/v1/dev/usage

Get your usage

The caller's and the organisation's dev use against the policy's budget, in ci's cost unit.

One unit is one vCPU-second, ci's cost unit; a session costs max(cpus, memory GiB / 8) units a second of its admitted weight, reserved 15 minutes ahead and released when it ends. person is the caller's accountable person in the current UTC day, org the organisation in the current UTC month. reserved_units is the paid time still ahead of live sessions, used_units the rest of the window. limit_units and remaining_units are null without a budget. Use is reported whether or not a budget is set.

Permission: dev:policy.read

Response200 OK

orgobjectRequired
org.limit_unitsinteger or nullRequired
org.remaining_unitsinteger or nullRequired
limit_units minus used and reserved, never below 0
org.reserved_unitsintegerRequired
paid time still ahead of live sessions
org.resets_atstring (date-time)Required
org.used_unitsintegerRequired
personobjectRequired
person.limit_unitsinteger or nullRequired
person.remaining_unitsinteger or nullRequired
limit_units minus used and reserved, never below 0
person.reserved_unitsintegerRequired
paid time still ahead of live sessions
person.resets_atstring (date-time)Required
person.used_unitsintegerRequired
unitstringRequired
One of vcpu_seconds

Errors

curl "$CIRESK_API/v1/dev/usage" \
  -H "Authorization: Bearer $CIRESK_KEY"