Usage¶
ComputeStacks will automatically aggregate this data at the end of the month. You may elect to receive that data as a webhook, configured under Advanced Settings in the admin.
List Usage Items¶
| Description | Endpoint |
|---|---|
| Find via subscription | GET /admin/subscriptions/{subscription_id}/billing_usages |
| Find all by user | GET /admin/users/{user_id}/billing_usages |
Schema
billing_usages: Arrayid: Integerperiod_start: DateTimeperiod_end: DateTimeexternal_id: Stringrate: Decimalrate_period: Integer- This value will tell you what term the rate is, and is used to determine the hourly price. For example, if
rateis an hourly price,rate_periodwill be1. If monthly,rate_periodwill be 730.(rate / rate_period) == hourly rate
- This value will tell you what term the rate is, and is used to determine the hourly price. For example, if
qty: Decimal - Billable QTY (less what would be included in their package)qty_total: Decimal - Total QTY recordedtotal: Decimalprocessed: Booleanprocessed_on: DateTimecreated_at: DateTimeupdated_at: DateTimesubscription_product: Objectid: Integerexternal_id: Stringstart_on: DateTimeactive: Booleanphase_type: Stringcreated_at: DateTimeupdated_at: DateTimeproduct: Objectid: Integerlabel: Stringresource_kindunit: Stringunit_type: Stringexternal_id: DateTimepackage: Objectid: Integercpu: Decimalmemory: Integerstorage: Integerbandwidth: Integerlocal_disk: Integermemory_swap: Integermemory_swappiness: Integerbackup: Integer
user: Objectid: Integerfull_name: Stringemail: Stringexternal_id: Stringlabels: Object
View Usage Item¶
GET /admin/subscriptions/{subscription_id}/billing_usages/{id}
Schema
billing_usages: Objectid: Integerperiod_start: DateTimeperiod_end: DateTimeexternal_id: Stringrate: Decimalrate_period: Integerqty: Decimal - Billable QTY (less what would be included in their package)qty_total: Decimal - Total QTY recordedtotal: Decimalprocessed: Booleanprocessed_on: DateTimecreated_at: DateTimeupdated_at: DateTimesubscription_product: Objectid: Integerexternal_id: Stringstart_on: DateTimeactive: Booleanphase_type: Stringcreated_at: DateTimeupdated_at: DateTimeproduct: Objectid: Integerlabel: Stringresource_kindunit: Stringunit_type: Stringexternal_id: DateTimepackage: Objectid: Integercpu: Decimalmemory: Integerstorage: Integerbandwidth: Integerlocal_disk: Integermemory_swap: Integermemory_swappiness: Integerbackup: Integer
user: Objectid: Integerfull_nameemail: Stringexternal_id: Stringlabels: Object
Delete Usage Item¶
DELETE /admin/subscriptions/{subscription_id}/billing_usages/{id}