BillsResource and BillRegistersResource
The Bills and BillRegisters resources represent public cloud bills in the platform for display on the billing dashboard (see Hybrid). You can configure Abiquo to obtain billing data from providers such as Amazon and Azure (see Display cloud provider billing data) . You can enter a fixed estimate for display on the dashboard, or a daily cost. If you supply a daily cost, Abiquo can calculate an estimate of your bill for display on the dashboard.
Bills resource
The bills resource represents bills from cloud providers such as Amazon, Azure, and custom providers.
List provider bills
After you configure the dashboard widgets for Amazon and/or Azure, or enter bill data from custom providers, you can retrieve bill entities from this resource. The most recent bills display in the UI on the billing dashboard
Synopsis: GET /statistics/enterpriseresources/{enterprise}/bills
Roles required: BILLS_VIEW
Request headers: Accept: application/vnd.abiquo.bills+json; version=5.4; application/vnd.abiquo.bills+xml; version=5.4; Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
provider | false | Supply the name of a provider to obtain only the bills from that provider | |
startwith | false | 0 | first bill to return |
has | false | text string to filter the results - return results with this text string in the name | |
by | false | name | order result by this field |
limit | false | 25 | total number of elements in the result set |
asc | false | true | If true, sort order is ascending |
Request message body entity:
Response message body entity: See bills media type at Abiquo API Reference
Request example:
Create a provider bill
Add a provider bill to the platform for display on billing dashboard. When you add a bill, the platform will delete the estimate data for the billing period.
Synopsis: POST /statistics/enterpriseresources/{enterprise}/bills
Roles required: BILLS_MANAGE
Request headers: Accept: application/vnd.abiquo.bill+json; version=5.4; application/vnd.abiquo.bill+xml; version=5.4; Content-type: application/vnd.abiquo.bill+json; version=5.4; application/vnd.abiquo.bill+xml; version=5.4;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
Request message body entity:
Response message body entity: See bills media type at Abiquo API Reference
Request example:
Bill Resource
Get a provider bill
Synopsis: GET /statistics/enterpriseresources/{enterprise}/bills/{bill}
Roles required: BILLS_VIEW
Request headers: Accept: application/vnd.abiquo.bill+json; version=5.4; application/vnd.abiquo.bill+xml; version=5.4; Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
Request message body entity:
Response message body entity: See bills media type at Abiquo API Reference
Request example:
Delete a provider bill
Synopsis: DELETE /statistics/enterpriseresources/{enterprise}/bills/{bill}
Roles required: BILLS_MANAGE
Request headers: Accept: ; Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
Request message body entity:
Response message body entity:
Request example:
List billing providers
The billing provider names identify the providers in the platform. It returns the hypervisor type of all the allowed datacenters for a tenant. For public cloud this request returns the provider name, and in private cloud the hypervisor type, in the format ABIQUO-{hypervisor type}. This request is used by the API to display budget data and billing dashboards.
Synopsis: GET /statistics/enterpriseresources/{enterprise}/bills/action/providers
Roles required: BILLS_VIEW
Request headers: Accept: application/vnd.abiquo.billproviders+json; version=5.4; application/vnd.abiquo.billproviders+xml; version=5.4; Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
Request message body entity:
Response message body entity: See bill providers media type at Abiquo API Reference
Request example:
BillRegisters Resource
The BillRegisters resource represents provider data for billing estimates. You can create provider estimates for the billing period, or cost records for each day (or other periodic entries), or both.
If you enter a provider estimate, the platform will output the current value as the estimate.
If you enter cost records, the platform will calculate an estimate based on all the values you have entered for the current billing period.
List billing estimate and cost records for a provider
List the estimates and/or cost records for the given provider for the current period
Synopsis: GET /statistics/enterpriseresources/{enterprise}/billregisters
Roles required: BILLS_VIEW
Request headers: Accept: application/vnd.abiquo.bills+json; version=5.4; application/vnd.abiquo.bills+xml; version=5.4; Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
provider | true | Supply the name of a provider to obtain estimates and/or cost records from that provider |
Request message body entity:
Response message body entity: See bills media type at Abiquo API Reference
Request examples:
Get cost records for Azure
Create a billing estimate or cost record
You can use this method to add a billing estimate or a cost record, or both.
Create a billing estimate for a fixed amount
Set the "estimated" attribute, which will be the current estimate until you create another billing estimate. Note that you can also set a cost at the same time (using the price attribute). The platform will ignore the price, unless you later enter an estimated value of 0. In this case, the platform will calculate the estimate using all values of the price attribute for the period.
Create a cost record that the platform will use to calculate a billing estimate
Use the price attribute to set the cost. Set the "estimated" attribute to 0. Enter the cost values periodically, for example, using a script that runs daily.
The platform will delete billing estimates when you add a bill as described in the Bills Resource documentation.
Synopsis: POST /statistics/enterpriseresources/{enterprise}/billregisters
Roles required: BILLS_MANAGE
Request headers: Accept: application/vnd.abiquo.bill+json; version=5.4; application/vnd.abiquo.bill+xml; version=5.4; Content-type: application/vnd.abiquo.bill+json; version=5.4; application/vnd.abiquo.bill+xml; version=5.4;;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
Request message body entity:
Response message body entity: See bill media type at Abiquo API Reference
Request examples:
Create a provider estimate with a fixed amount
Add a cost record for the day ending at 2018/05/28 11:00:00 +0000.
Get a current estimate for a provider as displayed on the dashboard
Synopsis: GET /statistics/enterpriseresources/{enterprise}/billregisters/action/estimate
Roles required: BILLS_VIEW
Request headers: Accept: text/plain Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
provider | true | Supply the name of a provider to obtain estimates and/or cost records from that provider |
Request message body entity:
Response message body entity: text/plain
Request example:
BillRegister Resource
Get a billing estimate or cost record
Obtain a fixed estimate record or a cost record for the current period.
Synopsis: GET /statistics/enterpriseresources/{enterprise}/billregisters/{billregister}
Roles required: BILLS_VIEW
Request headers: Accept: application/vnd.abiquo.bill+json; version=5.4; application/vnd.abiquo.bill+xml; version=5.4; Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
Request message body entity:
Response message body entity: See bill media type at Abiquo API Reference
Request example:
Delete a billing estimate or cost record
The platform will delete billing estimate and cost records when you add a bill after the end of the billing period, or you can delete them manually with this method.
Synopsis: DELETE /statistics/enterpriseresources/{enterprise}/billregisters/{billregister}
Roles required: BILLS_MANAGE
Request headers: Accept: ; Content-type: ;
Request parameters:
Parameter | Required | Default value | Description |
---|---|---|---|
Request message body entity:
Response message body entity:
Request example:
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved