Introduction
The IBM Cloud® Usage Reports API provides details about the usage quantity and cost of resources in an account. Usage details are reported by the month in which they were incurred. Usage quantities and their corresponding costs are aggregated at the following levels:
- Individual resource instances
- Cloud Foundry organization or resource group
- Entire account (all resources)
Authentication
Access to the Usage Reporting API is enforced through both IBM Cloud Identity and Access Management (IAM) access tokens and Cloud Foundry access roles. For more information, see Managing access in IBM Cloud.
To work with the API, authenticate your app or service by including your IBM Cloud IAM access token in the API request authentication header:
-H 'Authorization: Bearer <IAM_TOKEN>'
You can retrieve an access token by first creating an API key, and then exchanging your API key for a IBM Cloud IAM token. For more information, see Getting an IBM Cloud IAM token by using an API key.
Event tracking
You can monitor API activity within your account by using the IBM Cloud Activity Tracker with LogDNA service. When an API method is called, an event is generated that you can then track and audit from within Activity Tracker with LogDNA. The specific event type is listed for each individual method. For more information about how to track Account and Billing activity, see Auditing events for account management.
Methods
Get account summary
Returns the summary for the account for a given month. Account billing managers are authorized to access this report.
Returns the summary for the account for a given month. Account billing managers are authorized to access this report.
Returns the summary for the account for a given month. Account billing managers are authorized to access this report.
Returns the summary for the account for a given month. Account billing managers are authorized to access this report.
Returns the summary for the account for a given month. Account billing managers are authorized to access this report.
GET /v4/accounts/{account_id}/summary/{billingmonth}
(usageReports *UsageReportsV4) GetAccountSummary(getAccountSummaryOptions *GetAccountSummaryOptions) (result *AccountSummary, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetAccountSummaryWithContext(ctx context.Context, getAccountSummaryOptions *GetAccountSummaryOptions) (result *AccountSummary, response *core.DetailedResponse, err error)
ServiceCall<AccountSummary> getAccountSummary(GetAccountSummaryOptions getAccountSummaryOptions)
getAccountSummary(params)
get_account_summary(self,
account_id: str,
billingmonth: str,
**kwargs
) -> DetailedResponse
Request
Instantiate the GetAccountSummaryOptions
struct and set the fields to provide parameter values for the GetAccountSummary
method.
Use the GetAccountSummaryOptions.Builder
to create a GetAccountSummaryOptions
object that contains the parameter values for the getAccountSummary
method.
Path Parameters
Account ID for which the usage report is requested
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
^\d{4}\-(0?[1-9]|1[012])$
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetAccountSummary options.
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
The getAccountSummary options.
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
parameters
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
parameters
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
curl -X GET -H "Authorization: {iam_token}" -H "Accept: application/json" "{base_url}/v4/accounts/{account_id}/summary/{billingmonth}"
getAccountSummaryOptions := usageReportsService.NewGetAccountSummaryOptions( accountID, billingMonth, ) accountSummary, response, err := usageReportsService.GetAccountSummary(getAccountSummaryOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(accountSummary, "", " ") fmt.Println(string(b))
GetAccountSummaryOptions getAccountSummaryOptions = new GetAccountSummaryOptions.Builder() .accountId(accountId) .billingmonth(billingMonth) .build(); Response<AccountSummary> response = service.getAccountSummary(getAccountSummaryOptions).execute(); AccountSummary accountSummary = response.getResult(); System.out.println("getAccountSummary() result:\n" + accountSummary.toString());
const params = { accountId: accountId, billingmonth: billingMonth, }; usageReportsService.getAccountSummary(params) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.warn(err) });
account_summary = usage_reports_service.get_account_summary( account_id=account_id, billingmonth=billing_month ).get_result() print(json.dumps(account_summary, indent=2))
Response
A summary of charges and credits for an account.
The ID of the account.
The month in which usages were incurred. Represented in yyyy-mm format.
Country
The currency in which the account is billed.
Charges related to cloud resources.
The billable charges for all cloud resources used in the account.
Non-billable charges for all cloud resources used in the account.
resources
The list of offers applicable for the account for the month.
Support-related charges.
The monthly support cost.
The type of support.
Additional support cost for the month.
support
A summary of charges and credits related to a subscription.
A summary of charges and credits for an account.
The ID of the account.
The month in which usages were incurred. Represented in yyyy-mm format.
Country.
The currency in which the account is billed.
Charges related to cloud resources.
The billable charges for all cloud resources used in the account.
Non-billable charges for all cloud resources used in the account.
Resources
The list of offers applicable for the account for the month.
The ID of the offer.
The total credits before applying the offer.
The template with which the offer was generated.
The date from which the offer is valid.
The date until the offer is valid.
Credit information related to an offer.
The available credits in the offer at the beginning of the month.
The credits used in this month.
The remaining credits in the offer.
Credits
Offers
Support-related charges.
The monthly support cost.
The type of support.
Additional support cost for the month.
Support
A summary of charges and credits related to a subscription.
The charges after exhausting subscription credits and offers credits.
The list of subscriptions applicable for the month.
The ID of the subscription.
The charge agreement number of the subsciption.
Type of the subscription.
The credits available in the subscription for the month.
The date from which the subscription was active.
The date until which the subscription is active. End time is unavailable for PayGO accounts.
The total credits available in the subscription.
The terms through which the subscription is split into.
The start date of the term.
The end date of the term.
Information about credits related to a subscription.
The total credits available for the term.
The unused credits in the term at the beginning of the month.
The credits used in this month.
The remaining credits in this term.
Credits
Terms
Subscriptions
Subscription
A summary of charges and credits for an account.
The ID of the account.
The month in which usages were incurred. Represented in yyyy-mm format.
Country.
The currency in which the account is billed.
Charges related to cloud resources.
The billable charges for all cloud resources used in the account.
Non-billable charges for all cloud resources used in the account.
resources
The list of offers applicable for the account for the month.
The ID of the offer.
The total credits before applying the offer.
The template with which the offer was generated.
The date from which the offer is valid.
The date until the offer is valid.
Credit information related to an offer.
The available credits in the offer at the beginning of the month.
The credits used in this month.
The remaining credits in the offer.
credits
offers
Support-related charges.
The monthly support cost.
The type of support.
Additional support cost for the month.
support
A summary of charges and credits related to a subscription.
The charges after exhausting subscription credits and offers credits.
The list of subscriptions applicable for the month.
The ID of the subscription.
The charge agreement number of the subsciption.
Type of the subscription.
The credits available in the subscription for the month.
The date from which the subscription was active.
The date until which the subscription is active. End time is unavailable for PayGO accounts.
The total credits available in the subscription.
The terms through which the subscription is split into.
The start date of the term.
The end date of the term.
Information about credits related to a subscription.
The total credits available for the term.
The unused credits in the term at the beginning of the month.
The credits used in this month.
The remaining credits in this term.
credits
terms
subscriptions
subscription
A summary of charges and credits for an account.
The ID of the account.
The month in which usages were incurred. Represented in yyyy-mm format.
Country.
The currency in which the account is billed.
Charges related to cloud resources.
The billable charges for all cloud resources used in the account.
Non-billable charges for all cloud resources used in the account.
resources
The list of offers applicable for the account for the month.
The ID of the offer.
The total credits before applying the offer.
The template with which the offer was generated.
The date from which the offer is valid.
The date until the offer is valid.
Credit information related to an offer.
The available credits in the offer at the beginning of the month.
The credits used in this month.
The remaining credits in the offer.
credits
offers
Support-related charges.
The monthly support cost.
The type of support.
Additional support cost for the month.
support
A summary of charges and credits related to a subscription.
The charges after exhausting subscription credits and offers credits.
The list of subscriptions applicable for the month.
The ID of the subscription.
The charge agreement number of the subsciption.
Type of the subscription.
The credits available in the subscription for the month.
The date from which the subscription was active.
The date until which the subscription is active. End time is unavailable for PayGO accounts.
The total credits available in the subscription.
The terms through which the subscription is split into.
The start date of the term.
The end date of the term.
Information about credits related to a subscription.
The total credits available for the term.
The unused credits in the term at the beginning of the month.
The credits used in this month.
The remaining credits in this term.
credits
terms
subscriptions
subscription
A summary of charges and credits for an account.
The ID of the account.
The month in which usages were incurred. Represented in yyyy-mm format.
Country.
The currency in which the account is billed.
Charges related to cloud resources.
The billable charges for all cloud resources used in the account.
Non-billable charges for all cloud resources used in the account.
resources
The list of offers applicable for the account for the month.
The ID of the offer.
The total credits before applying the offer.
The template with which the offer was generated.
The date from which the offer is valid.
The date until the offer is valid.
Credit information related to an offer.
The available credits in the offer at the beginning of the month.
The credits used in this month.
The remaining credits in the offer.
credits
offers
Support-related charges.
The monthly support cost.
The type of support.
Additional support cost for the month.
support
A summary of charges and credits related to a subscription.
The charges after exhausting subscription credits and offers credits.
The list of subscriptions applicable for the month.
The ID of the subscription.
The charge agreement number of the subsciption.
Type of the subscription.
The credits available in the subscription for the month.
The date from which the subscription was active.
The date until which the subscription is active. End time is unavailable for PayGO accounts.
The total credits available in the subscription.
The terms through which the subscription is split into.
The start date of the term.
The end date of the term.
Information about credits related to a subscription.
The total credits available for the term.
The unused credits in the term at the beginning of the month.
The credits used in this month.
The remaining credits in this term.
credits
terms
subscriptions
subscription
Status Code
Account summary was returned successfully
Unauthenticated
Unauthorized
Unexpected errors
{ "account_id": "test-account", "month": "2017-08", "resources": { "billable_cost": 52.829999980555556, "non_billable_cost": 0 }, "offers": [ { "offer_id": "offer1", "credits_total": 4576, "offer_template": "", "valid_from": "2017-01-09T00:00:00.000Z", "expires_on": "2017-08-31T00:00:00.000Z", "is_recurring": false, "credits": { "starting_balance": 4500.26754230695, "balance": 4447.437542326395, "used": 52.829999980555556 } } ], "subscription": { "overage": 0, "subscriptions": [ { "subscription_id": "sub1", "charge_agreement_number": "0123445", "type": "SUBSCRIPTION", "subscription_amount": 100, "start": "2017-02-24T14:07:04.883Z", "end": "2019-01-24T14:07:04.882Z", "terms": [ { "start": "2017-02-24T14:07:04.883Z", "end": "2018-02-24T14:07:04.000Z", "credits": { "total": 1200, "starting_balance": 1200, "used": 0, "balance": 1200 } }, { "start": "2018-02-24T14:07:04.000Z", "end": "2019-01-24T14:07:04.882Z", "credits": { "total": 1100, "starting_balance": 1100, "used": 0, "balance": 1100 } } ], "credits_total": 2300 } ] }, "support": [ { "cost": 10000, "type": "PREMIUM", "overage": 0 } ], "billing_country_code": "USA", "billing_currency_code": "USD" }
{ "account_id": "test-account", "month": "2017-08", "resources": { "billable_cost": 52.829999980555556, "non_billable_cost": 0 }, "offers": [ { "offer_id": "offer1", "credits_total": 4576, "offer_template": "", "valid_from": "2017-01-09T00:00:00.000Z", "expires_on": "2017-08-31T00:00:00.000Z", "is_recurring": false, "credits": { "starting_balance": 4500.26754230695, "balance": 4447.437542326395, "used": 52.829999980555556 } } ], "subscription": { "overage": 0, "subscriptions": [ { "subscription_id": "sub1", "charge_agreement_number": "0123445", "type": "SUBSCRIPTION", "subscription_amount": 100, "start": "2017-02-24T14:07:04.883Z", "end": "2019-01-24T14:07:04.882Z", "terms": [ { "start": "2017-02-24T14:07:04.883Z", "end": "2018-02-24T14:07:04.000Z", "credits": { "total": 1200, "starting_balance": 1200, "used": 0, "balance": 1200 } }, { "start": "2018-02-24T14:07:04.000Z", "end": "2019-01-24T14:07:04.882Z", "credits": { "total": 1100, "starting_balance": 1100, "used": 0, "balance": 1100 } } ], "credits_total": 2300 } ] }, "support": [ { "cost": 10000, "type": "PREMIUM", "overage": 0 } ], "billing_country_code": "USA", "billing_currency_code": "USD" }
Get account usage
Usage for all the resources and plans in an account for a given month. Account billing managers are authorized to access this report.
Usage for all the resources and plans in an account for a given month. Account billing managers are authorized to access this report.
Usage for all the resources and plans in an account for a given month. Account billing managers are authorized to access this report.
Usage for all the resources and plans in an account for a given month. Account billing managers are authorized to access this report.
Usage for all the resources and plans in an account for a given month. Account billing managers are authorized to access this report.
GET /v4/accounts/{account_id}/usage/{billingmonth}
(usageReports *UsageReportsV4) GetAccountUsage(getAccountUsageOptions *GetAccountUsageOptions) (result *AccountUsage, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetAccountUsageWithContext(ctx context.Context, getAccountUsageOptions *GetAccountUsageOptions) (result *AccountUsage, response *core.DetailedResponse, err error)
ServiceCall<AccountUsage> getAccountUsage(GetAccountUsageOptions getAccountUsageOptions)
getAccountUsage(params)
get_account_usage(self,
account_id: str,
billingmonth: str,
*,
names: bool = None,
accept_language: str = None,
**kwargs
) -> DetailedResponse
Auditing
Calling this method generates the following event for the Activity Tracker with LogDNA service.
View account level usage
billing.usage-report.read
Request
Instantiate the GetAccountUsageOptions
struct and set the fields to provide parameter values for the GetAccountUsage
method.
Use the GetAccountUsageOptions.Builder
to create a GetAccountUsageOptions
object that contains the parameter values for the getAccountUsage
method.
Custom Headers
Prioritize the names returned in the order of the specified languages. Language will default to English.
Path Parameters
Account ID for which the usage report is requested
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
^\d{4}\-(0?[1-9]|1[012])$
Query Parameters
Include the name of every resource, plan, resource instance, organization, and resource group.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetAccountUsage options.
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
The getAccountUsage options.
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
parameters
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
parameters
Account ID for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
curl -X GET -H "Authorization: {iam_token}" -H "Accept: application/json" "{base_url}/v4/accounts/{account_id}/usage/{billingmonth}"
getAccountUsageOptions := usageReportsService.NewGetAccountUsageOptions( accountID, billingMonth, ) accountUsage, response, err := usageReportsService.GetAccountUsage(getAccountUsageOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(accountUsage, "", " ") fmt.Println(string(b))
GetAccountUsageOptions getAccountUsageOptions = new GetAccountUsageOptions.Builder() .accountId(accountId) .billingmonth(billingMonth) .build(); Response<AccountUsage> response = service.getAccountUsage(getAccountUsageOptions).execute(); AccountUsage accountUsage = response.getResult(); System.out.println("getAccountUsage() result:\n" + accountUsage.toString());
const params = { accountId: accountId, billingmonth: billingMonth, }; usageReportsService.getAccountUsage(params) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.warn(err) });
account_usage = usage_reports_service.get_account_usage( account_id=account_id, billingmonth=billing_month ).get_result() print(json.dumps(account_usage, indent=2))
Response
The aggregated usage and charges for all the plans in the account.
The ID of the account.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics
Example:
USD
The month
Constraints: Value must match regular expression
^\d{4}\-(0?[1-9]|1[012])$
Example:
2017-08
All the resource used in the account.
The aggregated usage and charges for all the plans in the account.
The ID of the account.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Resources
The aggregated usage and charges for all the plans in the account.
The ID of the account.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
resources
The aggregated usage and charges for all the plans in the account.
The ID of the account.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
resources
The aggregated usage and charges for all the plans in the account.
The ID of the account.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
resources
Status Code
Account usage was returned successfully
Unauthenticated
Unauthorized
Unexpected errors
{ "pricing_country": "USA", "currency_code": "USD", "resources": [ { "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c", "billable_cost": 0, "non_billable_cost": 0.006890350634753705, "plans": [ { "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d", "billable": false, "pricing_region": "us", "cost": 0.006890350634753705, "usage": [ { "metric": "STANDARD_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.03, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.026, "quantity_tier": "999999999" } ], "quantity": 0.10801757220178844, "rateable_quantity": 0.10801757220178844, "cost": 0.003240527166053653 }, { "metric": "VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.02, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.018, "quantity_tier": "999999999" } ], "quantity": 0.16923565417528152, "rateable_quantity": 0.16923565417528152, "cost": 0.0033847130835056305 }, { "metric": "COLD_VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "999999999" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000012043964117765422 }, { "metric": "FLEX_MAX_CAP", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.034, "quantity_tier": "1" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000029249627143144596, "non_chargeable": true }, { "metric": "STANDARD_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0.00000491086393594742, "rateable_quantity": 0.00000491086393594742, "cost": 4.419777542352678e-7 }, { "metric": "VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0.00001244433224201202, "rateable_quantity": 0.00001244433224201202, "cost": 1.244433224201202e-7 }, { "metric": "COLD_VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.05, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.029, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.006, "quantity_tier": "1" } ], "quantity": 35, "rateable_quantity": 35, "cost": 0.00021 }, { "metric": "VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 3, "rateable_quantity": 3, "cost": 0.0000375 }, { "metric": "COLD_VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.005, "quantity_tier": "1" } ], "quantity": 10, "rateable_quantity": 10, "cost": 0.000005 }, { "metric": "VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] }, { "plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8", "billable": false, "pricing_region": "global", "cost": 0, "usage": [ { "metric": "STORAGE", "unit": "GIGABYTE", "price": [], "quantity": 0.0004301415756344795, "rateable_quantity": 0.0004301415756344795, "cost": 0 }, { "metric": "BANDWIDTH", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "RETRIEVAL", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_A_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_B_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] } ] } ], "account_id": "b09edf5642ebfad587c594f4d4a354b0", "month": "2017-09" }
{ "pricing_country": "USA", "currency_code": "USD", "resources": [ { "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c", "billable_cost": 0, "non_billable_cost": 0.006890350634753705, "plans": [ { "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d", "billable": false, "pricing_region": "us", "cost": 0.006890350634753705, "usage": [ { "metric": "STANDARD_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.03, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.026, "quantity_tier": "999999999" } ], "quantity": 0.10801757220178844, "rateable_quantity": 0.10801757220178844, "cost": 0.003240527166053653 }, { "metric": "VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.02, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.018, "quantity_tier": "999999999" } ], "quantity": 0.16923565417528152, "rateable_quantity": 0.16923565417528152, "cost": 0.0033847130835056305 }, { "metric": "COLD_VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "999999999" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000012043964117765422 }, { "metric": "FLEX_MAX_CAP", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.034, "quantity_tier": "1" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000029249627143144596, "non_chargeable": true }, { "metric": "STANDARD_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0.00000491086393594742, "rateable_quantity": 0.00000491086393594742, "cost": 4.419777542352678e-7 }, { "metric": "VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0.00001244433224201202, "rateable_quantity": 0.00001244433224201202, "cost": 1.244433224201202e-7 }, { "metric": "COLD_VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.05, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.029, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.006, "quantity_tier": "1" } ], "quantity": 35, "rateable_quantity": 35, "cost": 0.00021 }, { "metric": "VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 3, "rateable_quantity": 3, "cost": 0.0000375 }, { "metric": "COLD_VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.005, "quantity_tier": "1" } ], "quantity": 10, "rateable_quantity": 10, "cost": 0.000005 }, { "metric": "VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] }, { "plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8", "billable": false, "pricing_region": "global", "cost": 0, "usage": [ { "metric": "STORAGE", "unit": "GIGABYTE", "price": [], "quantity": 0.0004301415756344795, "rateable_quantity": 0.0004301415756344795, "cost": 0 }, { "metric": "BANDWIDTH", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "RETRIEVAL", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_A_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_B_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] } ] } ], "account_id": "b09edf5642ebfad587c594f4d4a354b0", "month": "2017-09" }
Get resource group usage
Usage for all the resources and plans in a resource group in a given month. Account billing managers or resource group billing managers are authorized to access this report.
Usage for all the resources and plans in a resource group in a given month. Account billing managers or resource group billing managers are authorized to access this report.
Usage for all the resources and plans in a resource group in a given month. Account billing managers or resource group billing managers are authorized to access this report.
Usage for all the resources and plans in a resource group in a given month. Account billing managers or resource group billing managers are authorized to access this report.
Usage for all the resources and plans in a resource group in a given month. Account billing managers or resource group billing managers are authorized to access this report.
GET /v4/accounts/{account_id}/resource_groups/{resource_group_id}/usage/{billingmonth}
(usageReports *UsageReportsV4) GetResourceGroupUsage(getResourceGroupUsageOptions *GetResourceGroupUsageOptions) (result *ResourceGroupUsage, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetResourceGroupUsageWithContext(ctx context.Context, getResourceGroupUsageOptions *GetResourceGroupUsageOptions) (result *ResourceGroupUsage, response *core.DetailedResponse, err error)
ServiceCall<ResourceGroupUsage> getResourceGroupUsage(GetResourceGroupUsageOptions getResourceGroupUsageOptions)
getResourceGroupUsage(params)
get_resource_group_usage(self,
account_id: str,
resource_group_id: str,
billingmonth: str,
*,
names: bool = None,
accept_language: str = None,
**kwargs
) -> DetailedResponse
Auditing
Calling this method generates the following event for the Activity Tracker with LogDNA service.
billing.usage-report.read
Request
Instantiate the GetResourceGroupUsageOptions
struct and set the fields to provide parameter values for the GetResourceGroupUsage
method.
Use the GetResourceGroupUsageOptions.Builder
to create a GetResourceGroupUsageOptions
object that contains the parameter values for the getResourceGroupUsage
method.
Custom Headers
Prioritize the names returned in the order of the specified languages. Language will default to English.
Path Parameters
Account ID for which the usage report is requested
Resource group for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
^\d{4}\-(0?[1-9]|1[012])$
Query Parameters
Include the name of every resource, plan, resource instance, organization, and resource group.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetResourceGroupUsage options.
Account ID for which the usage report is requested.
Resource group for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
The getResourceGroupUsage options.
Account ID for which the usage report is requested.
Resource group for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
parameters
Account ID for which the usage report is requested.
Resource group for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
parameters
Account ID for which the usage report is requested.
Resource group for which the usage report is requested.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
curl -X GET -H "Authorization: {iam_token}" -H "Accept: application/json" "{base_url}/v4/accounts/{account_id}/resource_groups/{resource_group_id}/usage/{billingmonth}"
getResourceGroupUsageOptions := usageReportsService.NewGetResourceGroupUsageOptions( accountID, resourceGroupID, billingMonth, ) resourceGroupUsage, response, err := usageReportsService.GetResourceGroupUsage(getResourceGroupUsageOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(resourceGroupUsage, "", " ") fmt.Println(string(b))
GetResourceGroupUsageOptions getResourceGroupUsageOptions = new GetResourceGroupUsageOptions.Builder() .accountId(accountId) .resourceGroupId(resourceGroupId) .billingmonth(billingMonth) .build(); Response<ResourceGroupUsage> response = service.getResourceGroupUsage(getResourceGroupUsageOptions).execute(); ResourceGroupUsage resourceGroupUsage = response.getResult(); System.out.println("getResourceGroupUsage() result:\n" + resourceGroupUsage.toString());
const params = { accountId: accountId, resourceGroupId: resourceGroupId, billingmonth: billingMonth, }; usageReportsService.getResourceGroupUsage(params) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.warn(err) });
resource_group_usage = usage_reports_service.get_resource_group_usage( account_id=account_id, resource_group_id=resource_group_id, billingmonth=billing_month ).get_result() print(json.dumps(resource_group_usage, indent=2))
Response
The aggregated usage and charges for all the plans in the resource group.
The ID of the account.
The ID of the resource group.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics
Example:
USD
The month
Constraints: Value must match regular expression
^\d{4}\-(0?[1-9]|1[012])$
Example:
2017-08
All the resource used in the account
The aggregated usage and charges for all the plans in the resource group.
The ID of the account.
The ID of the resource group.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Resources
The aggregated usage and charges for all the plans in the resource group.
The ID of the account.
The ID of the resource group.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
resources
The aggregated usage and charges for all the plans in the resource group.
The ID of the account.
The ID of the resource group.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
resources
The aggregated usage and charges for all the plans in the resource group.
The ID of the account.
The ID of the resource group.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
resources
Status Code
Resource group usage returned successfully
Unauthenticated
Unauthorized
Unexpected errors
{ "pricing_country": "USA", "currency_code": "USD", "resources": [ { "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c", "billable_cost": 0, "non_billable_cost": 0.003452381490945816, "plans": [ { "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d", "billable": false, "pricing_region": "us", "cost": 0.003452381490945816, "usage": [ { "metric": "STANDARD_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.03, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.026, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.02, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.018, "quantity_tier": "999999999" } ], "quantity": 0.16923565417528152, "rateable_quantity": 0.16923565417528152, "cost": 0.0033847130835056305 }, { "metric": "COLD_VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "999999999" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000012043964117765422 }, { "metric": "FLEX_MAX_CAP", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.034, "quantity_tier": "1" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000029249627143144596, "non_chargeable": true }, { "metric": "STANDARD_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0.00001244433224201202, "rateable_quantity": 0.00001244433224201202, "cost": 1.244433224201202e-7 }, { "metric": "COLD_VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.05, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.029, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.006, "quantity_tier": "1" } ], "quantity": 3, "rateable_quantity": 3, "cost": 0.000018 }, { "metric": "VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 3, "rateable_quantity": 3, "cost": 0.0000375 }, { "metric": "COLD_VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.005, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] }, { "plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8", "billable": false, "pricing_region": "global", "cost": 0, "usage": [ { "metric": "STORAGE", "unit": "GIGABYTE", "price": [], "quantity": 0.0004301415756344795, "rateable_quantity": 0.0004301415756344795, "cost": 0 }, { "metric": "BANDWIDTH", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "RETRIEVAL", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_A_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_B_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] } ] } ], "account_id": "b09edf5642ebfad587c594f4d4a354b0", "resource_group_id": "bce390f8721e46bdabd4ec34addecb06", "month": "2017-09" }
{ "pricing_country": "USA", "currency_code": "USD", "resources": [ { "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c", "billable_cost": 0, "non_billable_cost": 0.003452381490945816, "plans": [ { "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d", "billable": false, "pricing_region": "us", "cost": 0.003452381490945816, "usage": [ { "metric": "STANDARD_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.03, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.026, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.02, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.018, "quantity_tier": "999999999" } ], "quantity": 0.16923565417528152, "rateable_quantity": 0.16923565417528152, "cost": 0.0033847130835056305 }, { "metric": "COLD_VAULT_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.011, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_STORAGE", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "499999" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.014, "quantity_tier": "999999999" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000012043964117765422 }, { "metric": "FLEX_MAX_CAP", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.034, "quantity_tier": "1" } ], "quantity": 0.0008602831512689587, "rateable_quantity": 0.0008602831512689587, "cost": 0.000029249627143144596, "non_chargeable": true }, { "metric": "STANDARD_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_BANDWIDTH", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.09, "quantity_tier": "50000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.07, "quantity_tier": "150000" }, { "unitQuantity": "1", "tier_model": "Step Tier", "price": 0.05, "quantity_tier": "999999999" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0.00001244433224201202, "rateable_quantity": 0.00001244433224201202, "cost": 1.244433224201202e-7 }, { "metric": "COLD_VAULT_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.05, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_RETRIEVAL", "unit": "GIGABYTE", "price": [ { "unitQuantity": "1", "tier_model": "Granular Tier", "price": 0.029, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.006, "quantity_tier": "1" } ], "quantity": 3, "rateable_quantity": 3, "cost": 0.000018 }, { "metric": "VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 3, "rateable_quantity": 3, "cost": 0.0000375 }, { "metric": "COLD_VAULT_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_A_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "1000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "STANDARD_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.005, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.0125, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "COLD_VAULT_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.025, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "FLEX_CLASS_B_CALLS", "unit": "API_CALLS", "price": [ { "unitQuantity": "10000", "tier_model": "Granular Tier", "price": 0.01, "quantity_tier": "1" } ], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] }, { "plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8", "billable": false, "pricing_region": "global", "cost": 0, "usage": [ { "metric": "STORAGE", "unit": "GIGABYTE", "price": [], "quantity": 0.0004301415756344795, "rateable_quantity": 0.0004301415756344795, "cost": 0 }, { "metric": "BANDWIDTH", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "RETRIEVAL", "unit": "GIGABYTE", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_A_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 }, { "metric": "CLASS_B_CALLS", "unit": "API_CALLS", "price": [], "quantity": 0, "rateable_quantity": 0, "cost": 0 } ] } ] } ], "account_id": "b09edf5642ebfad587c594f4d4a354b0", "resource_group_id": "bce390f8721e46bdabd4ec34addecb06", "month": "2017-09" }
Get organization usage
Usage for all the resources and plans in an organization in a given month. Account billing managers or organization billing managers are authorized to access this report.
Usage for all the resources and plans in an organization in a given month. Account billing managers or organization billing managers are authorized to access this report.
Usage for all the resources and plans in an organization in a given month. Account billing managers or organization billing managers are authorized to access this report.
Usage for all the resources and plans in an organization in a given month. Account billing managers or organization billing managers are authorized to access this report.
Usage for all the resources and plans in an organization in a given month. Account billing managers or organization billing managers are authorized to access this report.
GET /v4/accounts/{account_id}/organizations/{organization_id}/usage/{billingmonth}
(usageReports *UsageReportsV4) GetOrgUsage(getOrgUsageOptions *GetOrgUsageOptions) (result *OrgUsage, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetOrgUsageWithContext(ctx context.Context, getOrgUsageOptions *GetOrgUsageOptions) (result *OrgUsage, response *core.DetailedResponse, err error)
ServiceCall<OrgUsage> getOrgUsage(GetOrgUsageOptions getOrgUsageOptions)
getOrgUsage(params)
get_org_usage(self,
account_id: str,
organization_id: str,
billingmonth: str,
*,
names: bool = None,
accept_language: str = None,
**kwargs
) -> DetailedResponse
Auditing
Calling this method generates the following event for the Activity Tracker with LogDNA service.
View account level summary usage
billing.usage-report.read
Request
Instantiate the GetOrgUsageOptions
struct and set the fields to provide parameter values for the GetOrgUsage
method.
Use the GetOrgUsageOptions.Builder
to create a GetOrgUsageOptions
object that contains the parameter values for the getOrgUsage
method.
Custom Headers
Prioritize the names returned in the order of the specified languages. Language will default to English.
Path Parameters
Account ID for which the usage report is requested
ID of the organization.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
^\d{4}\-(0?[1-9]|1[012])$
Query Parameters
Include the name of every resource, plan, resource instance, organization, and resource group.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetOrgUsage options.
Account ID for which the usage report is requested.
ID of the organization.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
The getOrgUsage options.
Account ID for which the usage report is requested.
ID of the organization.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
parameters
Account ID for which the usage report is requested.
ID of the organization.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
parameters
Account ID for which the usage report is requested.
ID of the organization.
The billing month for which the usage report is requested. Format is yyyy-mm.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Include the name of every resource, plan, resource instance, organization, and resource group.
Prioritize the names returned in the order of the specified languages. Language will default to English.
curl -X GET -H "Authorization: {iam_token}" -H "Accept: application/json" "{base_url}/v4/accounts/{account_id}/organizations/{organization_id}/usage/{billingmonth}"
getOrgUsageOptions := usageReportsService.NewGetOrgUsageOptions( accountID, orgID, billingMonth, ) orgUsage, response, err := usageReportsService.GetOrgUsage(getOrgUsageOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(orgUsage, "", " ") fmt.Println(string(b))
GetOrgUsageOptions getOrgUsageOptions = new GetOrgUsageOptions.Builder() .accountId(accountId) .organizationId(orgId) .billingmonth(billingMonth) .build(); Response<OrgUsage> response = service.getOrgUsage(getOrgUsageOptions).execute(); OrgUsage orgUsage = response.getResult(); System.out.println("getOrgUsage() result:\n" + orgUsage.toString());
const params = { accountId: accountId, organizationId: orgId, billingmonth: billingMonth, }; usageReportsService.getOrgUsage(params) .then(res => { console.log(JSON.stringify(res.result, null, 2)); }) .catch(err => { console.warn(err) });
org_usage = usage_reports_service.get_org_usage( account_id=account_id, organization_id=org_id, billingmonth=billing_month ).get_result() print(json.dumps(org_usage, indent=2))
Response
The aggregated usage and charges for all the plans in the org.
The ID of the account.
The ID of the organization.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics
Example:
USD
The month
Constraints: Value must match regular expression
^\d{4}\-(0?[1-9]|1[012])$
Example:
2017-08
All the resource used in the account.
The aggregated usage and charges for all the plans in the org.
The ID of the account.
The ID of the organization.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Plans
All the discounts applicable to the resource.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
Discounts
Resources
The aggregated usage and charges for all the plans in the org.
The ID of the account.
The ID of the organization.
The target country pricing that should be used.
Example:
USA
The currency for the cost fields in the resources, plans and metrics.
Example:
USD
The month.
Constraints: Value must match regular expression
/^\\d{4}\\-(0?[1-9]|1[012])$/
Example:
2017-08
All the resource used in the account.
The ID of the resource.
The billable charges for the account.
The pre-discounted billable charges for the account.
The non-billable charges for the account.
The pre-discounted non-billable charges for the account.
All the plans in the resource.
The ID of the plan.
The pricing region for the plan.
Indicates if the plan charges are billed to the customer.
The total cost incurred by the plan.
Total pre-discounted cost incurred by the plan.
All the metrics in the plan.
The name of the metric.
Example:
UP-TIME
The aggregated value for the metric.
Example:
711.11
The quantity that is used for calculating charges.
Example:
700
The cost incurred by the metric.
Example:
123.45
Pre-discounted cost incurred by the metric.
Example:
130.0
The price with which the cost was calculated.
The unit that qualifies the quantity.
Example:
HOURS
When set to
true
, the cost is for informational purpose and is not included while calculating the plan charges.Example:
true
All the discounts applicable to the metric.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
The name of the discount.
Example:
Platform Service Discount
The discount percentage.
Example:
5
discounts
usage
All the discounts applicable to the plan.
The reference ID of the discount.
Example:
Discount-d27beddb-111b-4bbf-8cb1-b770f531c1a9
The name of the discount indicating category.
Example:
platform-discount
discounts
plans
resources