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)

Endpoint

You access the Usage Reports API by sending requests to the https://billing.cloud.ibm.com endpoint.

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response always indicates success. A 400 type response is some sort of failure, and a 500 type response usually indicates an internal system error.

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

The GetAccountSummary options.

The getAccountSummary options.

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.

A summary of charges and credits for an account.

A summary of charges and credits for an account.

A summary of charges and credits for an account.

A summary of charges and credits for an account.

Status Code

  • Account summary was returned successfully

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses
  • {
      "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

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > name > Access policies.

View account level usage

  • billing.usage-report.read

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

The GetAccountUsage options.

The getAccountUsage options.

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 aggregated usage and charges for all the plans in the account.

The aggregated usage and charges for all the plans in the account.

The aggregated usage and charges for all the plans in the account.

The aggregated usage and charges for all the plans in the account.

Status Code

  • Account usage was returned successfully

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses
  • {
        "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

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > name > Access policies.

  • billing.usage-report.read

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

The GetResourceGroupUsage options.

The getResourceGroupUsage options.

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 aggregated usage and charges for all the plans in the resource group.

The aggregated usage and charges for all the plans in the resource group.

The aggregated usage and charges for all the plans in the resource group.

The aggregated usage and charges for all the plans in the resource group.

Status Code

  • Resource group usage returned successfully

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses
  • {
      "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

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > name > Access policies.

View account level summary usage

  • billing.usage-report.read

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

The GetOrgUsage options.

The getOrgUsage options.

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 aggregated usage and charges for all the plans in the org.

The aggregated usage and charges for all the plans in the org.