IBM Cloud API Docs

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)

SDKs for Java, Node, Python, and Go are available to make it easier to programmatically access the API from your code. The client libraries that are provided by the SDKs implement best practices for using the API and reduce the amount of code that you need to write. The tab for each language includes code examples that demonstrate how to use the client libraries. For more information about using the SDKs, see the IBM Cloud SDK Common project on GitHub.

Installing the Java SDK

Maven

<dependency>
    <groupId>com.ibm.cloud</groupId>
    <artifactId>usage-reports</artifactId>
    <version>${version}</version>
</dependency>

Gradle

compile 'com.ibm.cloud:usage-reports:{version}'

For more installation options, view this project in GitHub. https://github.com/IBM/platform-services-java-sdk

Installing the Go SDK

go get -u github.com/IBM/platform-services-go-sdk/usagereportsv4

For more installation options, view this project in GitHub. https://github.com/IBM/platform-services-go-sdk

Installing the Node SDK

npm install @ibm-cloud/platform-services

For more installation options, view this project in GitHub. https://github.com/IBM/platform-services-node-sdk

Installing the Python SDK

pip install --upgrade "ibm-platform-services"

For more installation options, view this project in GitHub. https://github.com/IBM/platform-services-python-sdk

Endpoint URLs

The Usage Reports API uses the following global endpoint URL for all regions. When you call the API, add the path for each method to form the complete API endpoint for your requests.

https://billing.cloud.ibm.com

If you enabled service endpoints in your account, you can send API requests over the IBM Cloud® private network at the following base endpoint URLs. For more information, see Enabling VRF and service endpoints.

  • Private endpoint URL for VPC infrastructure: https://private.billing.cloud.ibm.com
  • Private endpoint URLs for classic infrastructure:
    • Dallas: https://private.us-south.billing.cloud.ibm.com
    • Washington DC: https://private.us-east.billing.cloud.ibm.com

Authentication

Authorization to the Usage Reports API is enforced by using an IBM Cloud Identity and Access Management (IAM) access token. The token is used to determine the actions that a user or service ID has access to when they use the API.

Obtaining an IAM token for an authenticated user or service ID is described in the IAM Identity Services API documentation.

To use the API, add a valid IAM token to the HTTP Authorization request header, for example, -H 'Authorization: Bearer <TOKEN>'.

When you use the SDK, configure an IAM authenticator with the IAM API key. The authenticator automatically obtains the IAM access token for the API key and includes it with each request. You can construct an authenticator in either of two ways:

  • Programmatically by constructing an IAM authenticator instance and supplying your IAM API key
  • By defining the API key in external configuration properties and then using the SDK authenticator factory to construct an IAM authenticator that uses the configured IAM API key

In this example of using external configuration properties, an IAM authenticator instance is created with the configured API key, and then the service client is constructed with this authenticator instance and the configured service URL.

For more information, see the Authentication section of the IBM Cloud SDK Common documentation.

To call each method, you'll need to be assigned a role that includes the required IAM actions. Each method lists the associated action. For more information about IAM actions and how they map to roles, see Assigning access to account management services.

To retrieve your access token:

curl -X POST   "https://iam.cloud.ibm.com/identity/token"   --header 'Content-Type: application/x-www-form-urlencoded'   --header 'Accept: application/json'   --data-urlencode 'grant_type=urn:ibm:params:oauth:grant-type:apikey'   --data-urlencode 'apikey=<API_KEY>'

Replace <API_KEY> with your IAM API key.

Setting client options through external configuration

Example environment variables, where <SERVICE_URL> is the endpoint URL and <API_KEY> is your IAM API key

export USAGE_REPORTS_URL=<SERVICE_URL>
export USAGE_REPORTS_AUTHTYPE=iam
export USAGE_REPORTS_APIKEY=<API_KEY>

Example of constructing the service client

import {
    "github.com/IBM/platform-services-go-sdk/usagereportsv4"
}
...
serviceClientOptions := &usagereportsv4.UsageReportsV4Options{}
serviceClient, err := usagereportsv4.NewUsageReportsV4UsingExternalConfig(serviceClientOptions)

Setting client options through external configuration

Example environment variables, where <SERVICE_URL> is the endpoint URL and <API_KEY> is your IAM API key

export USAGE_REPORTS_URL=<SERVICE_URL>
export USAGE_REPORTS_AUTHTYPE=iam
export USAGE_REPORTS_APIKEY=<API_KEY>

Example of constructing the service client

import com.ibm.cloud.platform_services.usage_reports.v4.UsageReports;
...
UsageReports serviceClient = UsageReports.newInstance();

Setting client options through external configuration

Example environment variables, where <SERVICE_URL> is the endpoint URL and <API_KEY> is your IAM API key

export USAGE_REPORTS_URL=<SERVICE_URL>
export USAGE_REPORTS_AUTHTYPE=iam
export USAGE_REPORTS_APIKEY=<API_KEY>

Example of constructing the service client

const UsageReportsV4 = require('@ibm-cloud/platform-services/usage-reports/v4');
...
const serviceClient = UsageReportsV4.newInstance({});

Setting client options through external configuration

Example environment variables, where <SERVICE_URL> is the endpoint URL and <API_KEY> is your IAM API key

export USAGE_REPORTS_URL=<SERVICE_URL>
export USAGE_REPORTS_AUTHTYPE=iam
export USAGE_REPORTS_APIKEY=<API_KEY>

Example of constructing the service client

from ibm_platform_services import UsageReportsV4
...
service_client = UsageReportsV4.new_instance()

Auditing

You can monitor API activity within your account by using the IBM Cloud Activity Tracker service. When an API method is called, an event is generated that you can then track and audit from within Activity Tracker. 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.

Error handling

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

HTTP Error Code Description Recovery
200 Success The request was successful.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to access '{namespace}'.
404 Not Found The requested resource could not be found.
409 Conflict The entity is already in the requested state.
410 Gone The resource is valid but has been removed already in a previous call
500 Internal Server Error offering_name is currently unavailable. Your request could not be processed. Wait a few minutes and try again.

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

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 > User > Access.

  • billing.account-summary.read

Auditing

Calling this method generates the following auditing event.

Calling the method generates billing.account-summary.read auditing event.

  • billing.account-summary.read

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.

    Possible values: 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.

    Possible values: 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.

    Possible values: 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

  • Invalid parameters

  • Unauthenticated

  • Unauthorized

  • Account Not Found

  • 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 > User > Access.

View account level usage

  • billing.usage-report.read

Auditing

Calling this method generates the following auditing event.

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.

    Possible values: 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.

    Possible values: 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.

    Possible values: 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 > User > Access.

  • billing.usage-report.read

Auditing

Calling this method generates the following auditing event.

  • 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.

    Possible values: 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.

    Possible values: 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.

    Possible values: 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 resource instance usage in an account

Query for resource instance usage in an account. Filter the results with query parameters. Account billing administrator is authorized to access this report.

Query for resource instance usage in an account. Filter the results with query parameters. Account billing administrator is authorized to access this report.

Query for resource instance usage in an account. Filter the results with query parameters. Account billing administrator is authorized to access this report.

Query for resource instance usage in an account. Filter the results with query parameters. Account billing administrator is authorized to access this report.

Query for resource instance usage in an account. Filter the results with query parameters. Account billing administrator is authorized to access this report.

GET /v4/accounts/{account_id}/resource_instances/usage/{billingmonth}
(usageReports *UsageReportsV4) GetResourceUsageAccount(getResourceUsageAccountOptions *GetResourceUsageAccountOptions) (result *InstancesUsage, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetResourceUsageAccountWithContext(ctx context.Context, getResourceUsageAccountOptions *GetResourceUsageAccountOptions) (result *InstancesUsage, response *core.DetailedResponse, err error)
ServiceCall<InstancesUsage> getResourceUsageAccount(GetResourceUsageAccountOptions getResourceUsageAccountOptions)
getResourceUsageAccount(params)
get_resource_usage_account(
        self,
        account_id: str,
        billingmonth: str,
        *,
        names: bool = None,
        tags: bool = None,
        accept_language: str = None,
        limit: int = None,
        start: str = None,
        resource_group_id: str = None,
        organization_id: str = None,
        resource_instance_id: str = None,
        resource_id: str = None,
        plan_id: str = None,
        region: 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 > User > Access.

  • billing.usage-report.read

Auditing

Calling this method generates the following auditing event.

Calling the method generates billing.usage-report.read auditing event.

  • billing.usage-report.read

Request

Instantiate the GetResourceUsageAccountOptions struct and set the fields to provide parameter values for the GetResourceUsageAccount method.

Use the GetResourceUsageAccountOptions.Builder to create a GetResourceUsageAccountOptions object that contains the parameter values for the getResourceUsageAccount 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.

    Possible values: 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.

  • Include the tags associated with every resource instance. By default it is always true.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource group.

  • Filter by organization_id.

  • Filter by resource instance_id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

WithContext method only

The GetResourceUsageAccount options.

The getResourceUsageAccount 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.

    Possible values: 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.

  • Include the user tags associated with every resource instance. By default it is always true.

  • Prioritize the names returned in the order of the specified languages. Language will default to English.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource group.

  • Filter by organization_id.

  • Filter by resource instance_id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

parameters

  • Account ID for which the usage report is requested.

  • The billing month for which the usage report is requested. Format is yyyy-mm.

    Possible values: 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.

  • Include the user tags associated with every resource instance. By default it is always true.

  • Prioritize the names returned in the order of the specified languages. Language will default to English.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource group.

  • Filter by organization_id.

  • Filter by resource instance_id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

  • curl -X GET -H "Authorization: {iam_token}"   -H "Accept: application/json"   "{base_url}/v4/accounts/{account_id}/resource_instances/usage/{billingmonth}"
  • getResourceUsageAccountOptions := usageReportsService.NewGetResourceUsageAccountOptions(
      accountID,
      billingMonth,
    )
    
    instancesUsage, response, err := usageReportsService.GetResourceUsageAccount(getResourceUsageAccountOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(instancesUsage, "", "  ")
    fmt.Println(string(b))
  • GetResourceUsageAccountOptions getResourceUsageAccountOptions = new GetResourceUsageAccountOptions.Builder()
      .accountId(accountId)
      .billingmonth(billingMonth)
      .build();
    
    Response<InstancesUsage> response = service.getResourceUsageAccount(getResourceUsageAccountOptions).execute();
    InstancesUsage instancesUsage = response.getResult();
    
    System.out.println("getResourceUsageAccount() result:\n" + instancesUsage.toString());
  • const params = {
      accountId: accountId,
      billingmonth: billingMonth,
    };
    
    usageReportsService.getResourceUsageAccount(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • instances_usage = usage_reports_service.get_resource_usage_account(
      account_id=account_id,
      billingmonth=billing_month
    ).get_result()
    
    print(json.dumps(instances_usage, indent=2))

Response

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

Status Code

  • Resource instance usage returned successfully

  • Status 400

  • Status 401

  • Unauthorized

  • Status 429

  • Status 500

Example responses
  • {
      "limit": 5,
      "count": 236,
      "first": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/resource_instances/usage/2023-06?_limit=5&_names=true&_tags=true"
      },
      "resources": [
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:7d9e33a0-c173-46d3-b0a1-b3fd2f7428e7",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "20dfff17-fd20-407c-9e50-d8548beb0373",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:7d9e33a0-c173-46d3-b0a1-b3fd2f7428e7:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 350.4475714583333,
              "cost": 23.087486007675,
              "rated_cost": 25.65276223075,
              "rateable_quantity": 350.4475714583333,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "env:test",
            "temporary"
          ],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Promo",
          "resource_instance_name": "bmpromocode-blue"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:67f149c9-41a8-45fb-aebd-6e838094c3c2",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "b2eff8ff-0bfe-41c8-9218-4db11d19e9b3",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:67f149c9-41a8-45fb-aebd-6e838094c3c2:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 934.5270777777778,
              "cost": 61.56664388400001,
              "rated_cost": 68.40738209333334,
              "rateable_quantity": 934.5270777777778,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Freemium",
          "resource_instance_name": "bss-service-recorder-green"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:758ab19c-5f92-44a1-acf6-f8b960792e6b",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "ec28f495-48cf-42fe-8076-d3fb35631b21",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:758ab19c-5f92-44a1-acf6-f8b960792e6b:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 1401.79039,
              "cost": 92.3499508932,
              "rated_cost": 102.611056548,
              "rateable_quantity": 1401.79039,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "fips199-low"
          ],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "RuntimeDataCollector",
          "resource_instance_name": "qradar-bss-green"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:e2f75020-a25c-4f30-98cf-16c50aab891e",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "2d22eb3d-9b77-4df8-a1c0-e8f165646fe5",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:e2f75020-a25c-4f30-98cf-16c50aab891e:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 467.26335166666667,
              "cost": 30.7833096078,
              "rated_cost": 34.203677342,
              "rateable_quantity": 467.26335166666667,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "audit",
            "env:stage",
            "fips199-moderate"
          ],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Notifications",
          "resource_instance_name": "public-notifications-blue"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:fae5242e-07d8-42c3-9bef-891e191c5aee",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "a4e22100-6833-4a3b-889a-8a79c44a8192",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:fae5242e-07d8-42c3-9bef-891e191c5aee:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 1869.0532022222221,
              "cost": 123.13322496239998,
              "rated_cost": 136.81469440266665,
              "rateable_quantity": 1869.0532022222221,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "fips199-low"
          ],
          "service_tags": [
            "project::config_id:b48d4e76-7c72-467c-97b6-443092334ce4",
            "project::project_id:639bcd7e-f1f1-469f-bd28-1f03bcac6121"
          ],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Abacus",
          "resource_instance_name": "fvt-metering-collector-green"
        }
      ],
      "next": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/resource_instances/usage/2023-06?_limit=5&_names=true&_start=g1AAAAVreJy1lE1uFDEQhVv8nAN2sOlxuVzln9mQNRdgCS6XHTJ0JlIyyZYTcA6ugcQl2LHhHqEGCaQMQowipRdValv92vXpPS_TND19_1inlyrt4rKfqHhYncn5LFdXV7t62gFw1ZaLa63b3Wrbd4t98ahO8uz29nbz6-XcytcPDiNrUUQuSal3zsWHXLBACcMjRdev51NZZ69Zgh-zWJupss5VEs-hlhxCw9KFHEUODTD50oIO4WjLpaZh-i2iJsdlcEp9pIajeaohRhMNNVCjUFp3QJARPO1nWW0vtK-0j3q97JzrN327czsHAD5mNp0I-0emiX5s9jBe_IFR_s9CnluVVw-JI2IEwowdOJGEJkGjQOyUKksxrVBjTT03AApQk2nVJjk3llBSqHpPHPx6c-CNcASPkz2Pt3d4fDuCh-8-co6YagqkKYkm8XUEoi5YSnMjemzE2NOwSWrhXFFGgdA0mDmKq1rQq6HK0fyAnDMUZjOFCpVK1f0-62yn32q9VCdny1Jl6esbWv-1u17fAbL-B6Q3h5D8EZDe7SF9fEjTYPe-29RqAEl8bvtueRJRnzsPB2yaKRPZDyRKs-Rw5hREEcQk7puhT4c8jrhQtk-sTl-sGZLvDxckjiVDELR0IISRfe1AI8UhCC2Li0psruIomO064Y6DixAYJrNlrvdl8nmz-QnabIV1&_tags=true",
        "offset": "g1AAAAVreJy1lE1uFDEQhVv8nAN2sOlxuVzln9mQNRdgCS6XHTJ0JlIyyZYTcA6ugcQl2LHhHqEGCaQMQowipRdValv92vXpPS_TND19_1inlyrt4rKfqHhYncn5LFdXV7t62gFw1ZaLa63b3Wrbd4t98ahO8uz29nbz6-XcytcPDiNrUUQuSal3zsWHXLBACcMjRdev51NZZ69Zgh-zWJupss5VEs-hlhxCw9KFHEUODTD50oIO4WjLpaZh-i2iJsdlcEp9pIajeaohRhMNNVCjUFp3QJARPO1nWW0vtK-0j3q97JzrN327czsHAD5mNp0I-0emiX5s9jBe_IFR_s9CnluVVw-JI2IEwowdOJGEJkGjQOyUKksxrVBjTT03AApQk2nVJjk3llBSqHpPHPx6c-CNcASPkz2Pt3d4fDuCh-8-co6YagqkKYkm8XUEoi5YSnMjemzE2NOwSWrhXFFGgdA0mDmKq1rQq6HK0fyAnDMUZjOFCpVK1f0-62yn32q9VCdny1Jl6esbWv-1u17fAbL-B6Q3h5D8EZDe7SF9fEjTYPe-29RqAEl8bvtueRJRnzsPB2yaKRPZDyRKs-Rw5hREEcQk7puhT4c8jrhQtk-sTl-sGZLvDxckjiVDELR0IISRfe1AI8UhCC2Li0psruIomO064Y6DixAYJrNlrvdl8nmz-QnabIV1"
      }
    }
  • {
      "limit": 5,
      "count": 236,
      "first": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/resource_instances/usage/2023-06?_limit=5&_names=true&_tags=true"
      },
      "resources": [
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:7d9e33a0-c173-46d3-b0a1-b3fd2f7428e7",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "20dfff17-fd20-407c-9e50-d8548beb0373",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:7d9e33a0-c173-46d3-b0a1-b3fd2f7428e7:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 350.4475714583333,
              "cost": 23.087486007675,
              "rated_cost": 25.65276223075,
              "rateable_quantity": 350.4475714583333,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "env:test",
            "temporary"
          ],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Promo",
          "resource_instance_name": "bmpromocode-blue"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:67f149c9-41a8-45fb-aebd-6e838094c3c2",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "b2eff8ff-0bfe-41c8-9218-4db11d19e9b3",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:67f149c9-41a8-45fb-aebd-6e838094c3c2:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 934.5270777777778,
              "cost": 61.56664388400001,
              "rated_cost": 68.40738209333334,
              "rateable_quantity": 934.5270777777778,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Freemium",
          "resource_instance_name": "bss-service-recorder-green"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:758ab19c-5f92-44a1-acf6-f8b960792e6b",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "ec28f495-48cf-42fe-8076-d3fb35631b21",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:758ab19c-5f92-44a1-acf6-f8b960792e6b:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 1401.79039,
              "cost": 92.3499508932,
              "rated_cost": 102.611056548,
              "rateable_quantity": 1401.79039,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "fips199-low"
          ],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "RuntimeDataCollector",
          "resource_instance_name": "qradar-bss-green"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:e2f75020-a25c-4f30-98cf-16c50aab891e",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "2d22eb3d-9b77-4df8-a1c0-e8f165646fe5",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:e2f75020-a25c-4f30-98cf-16c50aab891e:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 467.26335166666667,
              "cost": 30.7833096078,
              "rated_cost": 34.203677342,
              "rateable_quantity": 467.26335166666667,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "audit",
            "env:stage",
            "fips199-moderate"
          ],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Notifications",
          "resource_instance_name": "public-notifications-blue"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:fae5242e-07d8-42c3-9bef-891e191c5aee",
          "organization_id": "eu-gb:81d8b31f-b8b3-4a5d-ab75-3a9833c29eb4",
          "space_id": "a4e22100-6833-4a3b-889a-8a79c44a8192",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:fae5242e-07d8-42c3-9bef-891e191c5aee:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "eu-gb",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 1869.0532022222221,
              "cost": 123.13322496239998,
              "rated_cost": 136.81469440266665,
              "rateable_quantity": 1869.0532022222221,
              "discounts": [
                {
                  "name": "Sample Discount Name",
                  "display_name": "Sample Discount Name",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [
            "fips199-low"
          ],
          "service_tags": [
            "project::config_id:b48d4e76-7c72-467c-97b6-443092334ce4",
            "project::project_id:639bcd7e-f1f1-469f-bd28-1f03bcac6121"
          ],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "organization_name": "IBMBSS",
          "space_name": "Abacus",
          "resource_instance_name": "fvt-metering-collector-green"
        }
      ],
      "next": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/resource_instances/usage/2023-06?_limit=5&_names=true&_start=g1AAAAVreJy1lE1uFDEQhVv8nAN2sOlxuVzln9mQNRdgCS6XHTJ0JlIyyZYTcA6ugcQl2LHhHqEGCaQMQowipRdValv92vXpPS_TND19_1inlyrt4rKfqHhYncn5LFdXV7t62gFw1ZaLa63b3Wrbd4t98ahO8uz29nbz6-XcytcPDiNrUUQuSal3zsWHXLBACcMjRdev51NZZ69Zgh-zWJupss5VEs-hlhxCw9KFHEUODTD50oIO4WjLpaZh-i2iJsdlcEp9pIajeaohRhMNNVCjUFp3QJARPO1nWW0vtK-0j3q97JzrN327czsHAD5mNp0I-0emiX5s9jBe_IFR_s9CnluVVw-JI2IEwowdOJGEJkGjQOyUKksxrVBjTT03AApQk2nVJjk3llBSqHpPHPx6c-CNcASPkz2Pt3d4fDuCh-8-co6YagqkKYkm8XUEoi5YSnMjemzE2NOwSWrhXFFGgdA0mDmKq1rQq6HK0fyAnDMUZjOFCpVK1f0-62yn32q9VCdny1Jl6esbWv-1u17fAbL-B6Q3h5D8EZDe7SF9fEjTYPe-29RqAEl8bvtueRJRnzsPB2yaKRPZDyRKs-Rw5hREEcQk7puhT4c8jrhQtk-sTl-sGZLvDxckjiVDELR0IISRfe1AI8UhCC2Li0psruIomO064Y6DixAYJrNlrvdl8nmz-QnabIV1&_tags=true",
        "offset": "g1AAAAVreJy1lE1uFDEQhVv8nAN2sOlxuVzln9mQNRdgCS6XHTJ0JlIyyZYTcA6ugcQl2LHhHqEGCaQMQowipRdValv92vXpPS_TND19_1inlyrt4rKfqHhYncn5LFdXV7t62gFw1ZaLa63b3Wrbd4t98ahO8uz29nbz6-XcytcPDiNrUUQuSal3zsWHXLBACcMjRdev51NZZ69Zgh-zWJupss5VEs-hlhxCw9KFHEUODTD50oIO4WjLpaZh-i2iJsdlcEp9pIajeaohRhMNNVCjUFp3QJARPO1nWW0vtK-0j3q97JzrN327czsHAD5mNp0I-0emiX5s9jBe_IFR_s9CnluVVw-JI2IEwowdOJGEJkGjQOyUKksxrVBjTT03AApQk2nVJjk3llBSqHpPHPx6c-CNcASPkz2Pt3d4fDuCh-8-co6YagqkKYkm8XUEoi5YSnMjemzE2NOwSWrhXFFGgdA0mDmKq1rQq6HK0fyAnDMUZjOFCpVK1f0-62yn32q9VCdny1Jl6esbWv-1u17fAbL-B6Q3h5D8EZDe7SF9fEjTYPe-29RqAEl8bvtueRJRnzsPB2yaKRPZDyRKs-Rw5hREEcQk7puhT4c8jrhQtk-sTl-sGZLvDxckjiVDELR0IISRfe1AI8UhCC2Li0psruIomO064Y6DixAYJrNlrvdl8nmz-QnabIV1"
      }
    }

Get resource instance usage in a resource group

Query for resource instance usage in a resource group. Filter the results with query parameters. Account billing administrator and resource group billing administrators are authorized to access this report.

Query for resource instance usage in a resource group. Filter the results with query parameters. Account billing administrator and resource group billing administrators are authorized to access this report.

Query for resource instance usage in a resource group. Filter the results with query parameters. Account billing administrator and resource group billing administrators are authorized to access this report.

Query for resource instance usage in a resource group. Filter the results with query parameters. Account billing administrator and resource group billing administrators are authorized to access this report.

Query for resource instance usage in a resource group. Filter the results with query parameters. Account billing administrator and resource group billing administrators are authorized to access this report.

GET /v4/accounts/{account_id}/resource_groups/{resource_group_id}/resource_instances/usage/{billingmonth}
(usageReports *UsageReportsV4) GetResourceUsageResourceGroup(getResourceUsageResourceGroupOptions *GetResourceUsageResourceGroupOptions) (result *InstancesUsage, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetResourceUsageResourceGroupWithContext(ctx context.Context, getResourceUsageResourceGroupOptions *GetResourceUsageResourceGroupOptions) (result *InstancesUsage, response *core.DetailedResponse, err error)
ServiceCall<InstancesUsage> getResourceUsageResourceGroup(GetResourceUsageResourceGroupOptions getResourceUsageResourceGroupOptions)
getResourceUsageResourceGroup(params)
get_resource_usage_resource_group(
        self,
        account_id: str,
        resource_group_id: str,
        billingmonth: str,
        *,
        names: bool = None,
        tags: bool = None,
        accept_language: str = None,
        limit: int = None,
        start: str = None,
        resource_instance_id: str = None,
        resource_id: str = None,
        plan_id: str = None,
        region: 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 > User > Access.

  • billing.usage-report.read

Auditing

Calling this method generates the following auditing event.

  • billing.usage-report.read

Request

Instantiate the GetResourceUsageResourceGroupOptions struct and set the fields to provide parameter values for the GetResourceUsageResourceGroup method.

Use the GetResourceUsageResourceGroupOptions.Builder to create a GetResourceUsageResourceGroupOptions object that contains the parameter values for the getResourceUsageResourceGroup 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.

    Possible values: 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.

  • Include the tags associated with every resource instance. By default it is always true.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource instance id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

WithContext method only

The GetResourceUsageResourceGroup options.

The getResourceUsageResourceGroup 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.

    Possible values: 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.

  • Include the user tags associated with every resource instance. By default it is always true.

  • Prioritize the names returned in the order of the specified languages. Language will default to English.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource instance id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

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.

    Possible values: 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.

  • Include the user tags associated with every resource instance. By default it is always true.

  • Prioritize the names returned in the order of the specified languages. Language will default to English.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource instance id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

  • curl -X GET -H "Authorization: {iam_token}"   -H "Accept: application/json"   "{base_url}/v4/accounts/{account_id}/resource_groups/{resource_group_id}/resource_instances/usage/{billingmonth}"
  • getResourceUsageResourceGroupOptions := usageReportsService.NewGetResourceUsageResourceGroupOptions(
      accountID,
      resourceGroupID,
      billingMonth,
    )
    
    instancesUsage, response, err := usageReportsService.GetResourceUsageResourceGroup(getResourceUsageResourceGroupOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(instancesUsage, "", "  ")
    fmt.Println(string(b))
  • GetResourceUsageResourceGroupOptions getResourceUsageResourceGroupOptions = new GetResourceUsageResourceGroupOptions.Builder()
      .accountId(accountId)
      .resourceGroupId(resourceGroupId)
      .billingmonth(billingMonth)
      .build();
    
    Response<InstancesUsage> response = service.getResourceUsageResourceGroup(getResourceUsageResourceGroupOptions).execute();
    InstancesUsage instancesUsage = response.getResult();
    
    System.out.println("getResourceUsageResourceGroup() result:\n" + instancesUsage.toString());
  • const params = {
      accountId: accountId,
      resourceGroupId: resourceGroupId,
      billingmonth: billingMonth,
    };
    
    usageReportsService.getResourceUsageResourceGroup(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • instances_usage = usage_reports_service.get_resource_usage_resource_group(
      account_id=account_id,
      resource_group_id=resource_group_id,
      billingmonth=billing_month
    ).get_result()
    
    print(json.dumps(instances_usage, indent=2))

Response

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

Status Code

  • Resource instance usage returned successfully

  • Status 400

  • Status 401

  • Status 429

  • Status 500

Example responses
  • {
      "limit": 3,
      "count": 3,
      "first": {
        "href": "/v4/accounts/b09edf5642ebfad587c594f4d4a354b0/resource_groups/a213fbb3343c67f49a2b2596f64147e1/resource_instances/usage/2023-06?_limit=3&_names=true&_tags=true"
      },
      "resources": [
        {
          "account_id": "b09edf5642ebfad587c594f4d4a354b0",
          "resource_instance_id": "crn:v1:staging:public:cloud-object-storage:global:a/b09edf5642ebfad587c594f4d4a354b0:93f85e08-277a-40af-a15e-2a2de6421b9c::",
          "resource_group_id": "a213fbb3343c67f49a2b2596f64147e1",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "billable": true,
          "pricing_plan_id": "billable:v4:744bfc56-d12c-4866-88d5-dac9139e0e5d:us-south:1685577600000:",
          "pricing_region": "us-south",
          "region": "us-south",
          "usage": [
            {
              "metric": "STANDARD_STORAGE",
              "unit": "GIGABYTE",
              "price": [
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.02299,
                  "quantity_tier": "499999"
                },
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.0209,
                  "quantity_tier": "999999999"
                }
              ],
              "quantity": 10.000001950189471,
              "cost": 0.16078519435615318,
              "rated_cost": 0.16093003138439915,
              "rateable_quantity": 10.000001950189471,
              "discounts": [
                {
                  "name": "platform Discount",
                  "display_name": "platform Discount",
                  "ref": "Discount-7e171679-63b4-4f42-96f7-973d6da3e547",
                  "discount": 0.09
                }
              ],
              "metric_name": "Standard storage",
              "unit_name": "GIGABYTE"
            },
            {
              "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,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard bandwidth",
              "unit_name": "GIGABYTE"
            },
            {
              "metric": "STANDARD_CLASS_A_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "1000",
                  "tier_model": "Granular Tier",
                  "price": 0.005225,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class A calls",
              "unit_name": "API_CALLS"
            },
            {
              "metric": "STANDARD_CLASS_B_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "10000",
                  "tier_model": "Granular Tier",
                  "price": 0.00418,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class B calls",
              "unit_name": "API_CALLS"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Standard",
          "resource_name": "Cloud Object Storage",
          "resource_instance_name": "Cloud Object Storage-tu",
          "resource_group_name": "Default"
        },
        {
          "account_id": "b09edf5642ebfad587c594f4d4a354b0",
          "resource_instance_id": "crn:v1:staging:public:cloud-object-storage:global:a/b09edf5642ebfad587c594f4d4a354b0:ec9e9262-4b70-436c-90e5-a7dece6d3b88::",
          "resource_group_id": "a213fbb3343c67f49a2b2596f64147e1",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "billable": true,
          "pricing_plan_id": "billable:v4:744bfc56-d12c-4866-88d5-dac9139e0e5d:us-south:1685577600000:",
          "pricing_region": "us-south",
          "region": "us-south",
          "usage": [
            {
              "metric": "STANDARD_STORAGE",
              "unit": "GIGABYTE",
              "price": [
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.02299,
                  "quantity_tier": "499999"
                },
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.0209,
                  "quantity_tier": "999999999"
                }
              ],
              "quantity": 24.162232154980302,
              "cost": 0.38849284354823493,
              "rated_cost": 0.388842802070098,
              "rateable_quantity": 24.162232154980302,
              "discounts": [
                {
                  "name": "platform Discount",
                  "display_name": "platform Discount",
                  "ref": "Discount-7e171679-63b4-4f42-96f7-973d6da3e547",
                  "discount": 0.09
                }
              ],
              "metric_name": "Standard storage",
              "unit_name": "GIGABYTE"
            },
            {
              "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,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard bandwidth",
              "unit_name": "GIGABYTE"
            },
            {
              "metric": "STANDARD_CLASS_A_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "1000",
                  "tier_model": "Granular Tier",
                  "price": 0.005225,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class A calls",
              "unit_name": "API_CALLS"
            },
            {
              "metric": "STANDARD_CLASS_B_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "10000",
                  "tier_model": "Granular Tier",
                  "price": 0.00418,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class B calls",
              "unit_name": "API_CALLS"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Standard",
          "resource_name": "Cloud Object Storage",
          "resource_instance_name": "cos-service-with-aspera",
          "resource_group_name": "Default"
        },
        {
          "account_id": "b09edf5642ebfad587c594f4d4a354b0",
          "resource_instance_id": "crn:v1:staging:public:cloud-object-storage:global:a/b09edf5642ebfad587c594f4d4a354b0:acadcae0-75a7-44ca-bf1c-91ad8843d818::",
          "resource_group_id": "a213fbb3343c67f49a2b2596f64147e1",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "billable": true,
          "pricing_plan_id": "billable:v4:744bfc56-d12c-4866-88d5-dac9139e0e5d:us-south:1685577600000:",
          "pricing_region": "us-south",
          "region": "us-south",
          "usage": [
            {
              "metric": "STANDARD_STORAGE",
              "unit": "GIGABYTE",
              "price": [
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.02299,
                  "quantity_tier": "499999"
                },
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.0209,
                  "quantity_tier": "999999999"
                }
              ],
              "quantity": 0.29296875,
              "cost": 0.004710502822265625,
              "rated_cost": 0.00471474609375,
              "rateable_quantity": 0.29296875,
              "discounts": [
                {
                  "name": "platform Discount",
                  "display_name": "platform Discount",
                  "ref": "Discount-7e171679-63b4-4f42-96f7-973d6da3e547",
                  "discount": 0.09
                }
              ],
              "metric_name": "Standard storage",
              "unit_name": "GIGABYTE"
            },
            {
              "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,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard bandwidth",
              "unit_name": "GIGABYTE"
            },
            {
              "metric": "STANDARD_CLASS_A_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "1000",
                  "tier_model": "Granular Tier",
                  "price": 0.005225,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class A calls",
              "unit_name": "API_CALLS"
            },
            {
              "metric": "STANDARD_CLASS_B_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "10000",
                  "tier_model": "Granular Tier",
                  "price": 0.00418,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class B calls",
              "unit_name": "API_CALLS"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Standard",
          "resource_name": "Cloud Object Storage",
          "resource_instance_name": "Cloud Object Storage-BM-Demo",
          "resource_group_name": "Default"
        }
      ],
      "next": {
        "href": "/v4/accounts/b09edf5642ebfad587c594f4d4a354b0/resource_groups/a213fbb3343c67f49a2b2596f64147e1/resource_instances/usage/2023-06?_limit=3&_names=true&_start=g1AAAAP-eJzV0DtyFDEQBmAZu7gGZDjwrFrqh6RJ4Cio9cBexrtVnlmfh5RTcLRFdkCVIxM4sYJuSdV_B99ijLm8vazmS9VyfGjfqqbdnd5Puq7rln80AL8ry_FU82HbHdq2jMCHbPTT-XzePz_ujbn4-NMqpFY7C_mmPVeOoXCiTpUyMinY7B12VUTCIqFTyl49J-lCjkJzFrIQaUMPvWKQEsGzQAhOE2TiaHNN3lUBioIinmOExIwZq45tlG0Y-V5Ypup8mcaYTDFWnmouyWFq0LhavVuWrEubH2n-n8B8Wqf1eNpuZyeROQSBpzPbzY724k-Noe_7l5zxdU79PKp-fXvRXih7Sd05ysWPq0N1AWItGQl8exei9uZZ9PqfqMPXSQ9Xo5pfow3VP2_M-iTG4oVqJGJqgpBCCFDSmI_4Pljx937_F3SQFG8&_tags=true",
        "offset": "g1AAAAP-eJzV0DtyFDEQBmAZu7gGZDjwrFrqh6RJ4Cio9cBexrtVnlmfh5RTcLRFdkCVIxM4sYJuSdV_B99ijLm8vazmS9VyfGjfqqbdnd5Puq7rln80AL8ry_FU82HbHdq2jMCHbPTT-XzePz_ujbn4-NMqpFY7C_mmPVeOoXCiTpUyMinY7B12VUTCIqFTyl49J-lCjkJzFrIQaUMPvWKQEsGzQAhOE2TiaHNN3lUBioIinmOExIwZq45tlG0Y-V5Ypup8mcaYTDFWnmouyWFq0LhavVuWrEubH2n-n8B8Wqf1eNpuZyeROQSBpzPbzY724k-Noe_7l5zxdU79PKp-fXvRXih7Sd05ysWPq0N1AWItGQl8exei9uZZ9PqfqMPXSQ9Xo5pfow3VP2_M-iTG4oVqJGJqgpBCCFDSmI_4Pljx937_F3SQFG8"
      }
    }
  • {
      "limit": 3,
      "count": 3,
      "first": {
        "href": "/v4/accounts/b09edf5642ebfad587c594f4d4a354b0/resource_groups/a213fbb3343c67f49a2b2596f64147e1/resource_instances/usage/2023-06?_limit=3&_names=true&_tags=true"
      },
      "resources": [
        {
          "account_id": "b09edf5642ebfad587c594f4d4a354b0",
          "resource_instance_id": "crn:v1:staging:public:cloud-object-storage:global:a/b09edf5642ebfad587c594f4d4a354b0:93f85e08-277a-40af-a15e-2a2de6421b9c::",
          "resource_group_id": "a213fbb3343c67f49a2b2596f64147e1",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "billable": true,
          "pricing_plan_id": "billable:v4:744bfc56-d12c-4866-88d5-dac9139e0e5d:us-south:1685577600000:",
          "pricing_region": "us-south",
          "region": "us-south",
          "usage": [
            {
              "metric": "STANDARD_STORAGE",
              "unit": "GIGABYTE",
              "price": [
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.02299,
                  "quantity_tier": "499999"
                },
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.0209,
                  "quantity_tier": "999999999"
                }
              ],
              "quantity": 10.000001950189471,
              "cost": 0.16078519435615318,
              "rated_cost": 0.16093003138439915,
              "rateable_quantity": 10.000001950189471,
              "discounts": [
                {
                  "name": "platform Discount",
                  "display_name": "platform Discount",
                  "ref": "Discount-7e171679-63b4-4f42-96f7-973d6da3e547",
                  "discount": 0.09
                }
              ],
              "metric_name": "Standard storage",
              "unit_name": "GIGABYTE"
            },
            {
              "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,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard bandwidth",
              "unit_name": "GIGABYTE"
            },
            {
              "metric": "STANDARD_CLASS_A_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "1000",
                  "tier_model": "Granular Tier",
                  "price": 0.005225,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class A calls",
              "unit_name": "API_CALLS"
            },
            {
              "metric": "STANDARD_CLASS_B_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "10000",
                  "tier_model": "Granular Tier",
                  "price": 0.00418,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class B calls",
              "unit_name": "API_CALLS"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Standard",
          "resource_name": "Cloud Object Storage",
          "resource_instance_name": "Cloud Object Storage-tu",
          "resource_group_name": "Default"
        },
        {
          "account_id": "b09edf5642ebfad587c594f4d4a354b0",
          "resource_instance_id": "crn:v1:staging:public:cloud-object-storage:global:a/b09edf5642ebfad587c594f4d4a354b0:ec9e9262-4b70-436c-90e5-a7dece6d3b88::",
          "resource_group_id": "a213fbb3343c67f49a2b2596f64147e1",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "billable": true,
          "pricing_plan_id": "billable:v4:744bfc56-d12c-4866-88d5-dac9139e0e5d:us-south:1685577600000:",
          "pricing_region": "us-south",
          "region": "us-south",
          "usage": [
            {
              "metric": "STANDARD_STORAGE",
              "unit": "GIGABYTE",
              "price": [
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.02299,
                  "quantity_tier": "499999"
                },
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.0209,
                  "quantity_tier": "999999999"
                }
              ],
              "quantity": 24.162232154980302,
              "cost": 0.38849284354823493,
              "rated_cost": 0.388842802070098,
              "rateable_quantity": 24.162232154980302,
              "discounts": [
                {
                  "name": "platform Discount",
                  "display_name": "platform Discount",
                  "ref": "Discount-7e171679-63b4-4f42-96f7-973d6da3e547",
                  "discount": 0.09
                }
              ],
              "metric_name": "Standard storage",
              "unit_name": "GIGABYTE"
            },
            {
              "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,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard bandwidth",
              "unit_name": "GIGABYTE"
            },
            {
              "metric": "STANDARD_CLASS_A_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "1000",
                  "tier_model": "Granular Tier",
                  "price": 0.005225,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class A calls",
              "unit_name": "API_CALLS"
            },
            {
              "metric": "STANDARD_CLASS_B_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "10000",
                  "tier_model": "Granular Tier",
                  "price": 0.00418,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class B calls",
              "unit_name": "API_CALLS"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Standard",
          "resource_name": "Cloud Object Storage",
          "resource_instance_name": "cos-service-with-aspera",
          "resource_group_name": "Default"
        },
        {
          "account_id": "b09edf5642ebfad587c594f4d4a354b0",
          "resource_instance_id": "crn:v1:staging:public:cloud-object-storage:global:a/b09edf5642ebfad587c594f4d4a354b0:acadcae0-75a7-44ca-bf1c-91ad8843d818::",
          "resource_group_id": "a213fbb3343c67f49a2b2596f64147e1",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "billable": true,
          "pricing_plan_id": "billable:v4:744bfc56-d12c-4866-88d5-dac9139e0e5d:us-south:1685577600000:",
          "pricing_region": "us-south",
          "region": "us-south",
          "usage": [
            {
              "metric": "STANDARD_STORAGE",
              "unit": "GIGABYTE",
              "price": [
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.02299,
                  "quantity_tier": "499999"
                },
                {
                  "unitQuantity": "1",
                  "tier_model": "Step Tier",
                  "price": 0.0209,
                  "quantity_tier": "999999999"
                }
              ],
              "quantity": 0.29296875,
              "cost": 0.004710502822265625,
              "rated_cost": 0.00471474609375,
              "rateable_quantity": 0.29296875,
              "discounts": [
                {
                  "name": "platform Discount",
                  "display_name": "platform Discount",
                  "ref": "Discount-7e171679-63b4-4f42-96f7-973d6da3e547",
                  "discount": 0.09
                }
              ],
              "metric_name": "Standard storage",
              "unit_name": "GIGABYTE"
            },
            {
              "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,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard bandwidth",
              "unit_name": "GIGABYTE"
            },
            {
              "metric": "STANDARD_CLASS_A_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "1000",
                  "tier_model": "Granular Tier",
                  "price": 0.005225,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class A calls",
              "unit_name": "API_CALLS"
            },
            {
              "metric": "STANDARD_CLASS_B_CALLS",
              "unit": "API_CALLS",
              "price": [
                {
                  "unitQuantity": "10000",
                  "tier_model": "Granular Tier",
                  "price": 0.00418,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 0,
              "cost": 0,
              "rated_cost": 0,
              "rateable_quantity": 0,
              "discounts": [],
              "metric_name": "Standard Class B calls",
              "unit_name": "API_CALLS"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Standard",
          "resource_name": "Cloud Object Storage",
          "resource_instance_name": "Cloud Object Storage-BM-Demo",
          "resource_group_name": "Default"
        }
      ],
      "next": {
        "href": "/v4/accounts/b09edf5642ebfad587c594f4d4a354b0/resource_groups/a213fbb3343c67f49a2b2596f64147e1/resource_instances/usage/2023-06?_limit=3&_names=true&_start=g1AAAAP-eJzV0DtyFDEQBmAZu7gGZDjwrFrqh6RJ4Cio9cBexrtVnlmfh5RTcLRFdkCVIxM4sYJuSdV_B99ijLm8vazmS9VyfGjfqqbdnd5Puq7rln80AL8ry_FU82HbHdq2jMCHbPTT-XzePz_ujbn4-NMqpFY7C_mmPVeOoXCiTpUyMinY7B12VUTCIqFTyl49J-lCjkJzFrIQaUMPvWKQEsGzQAhOE2TiaHNN3lUBioIinmOExIwZq45tlG0Y-V5Ypup8mcaYTDFWnmouyWFq0LhavVuWrEubH2n-n8B8Wqf1eNpuZyeROQSBpzPbzY724k-Noe_7l5zxdU79PKp-fXvRXih7Sd05ysWPq0N1AWItGQl8exei9uZZ9PqfqMPXSQ9Xo5pfow3VP2_M-iTG4oVqJGJqgpBCCFDSmI_4Pljx937_F3SQFG8&_tags=true",
        "offset": "g1AAAAP-eJzV0DtyFDEQBmAZu7gGZDjwrFrqh6RJ4Cio9cBexrtVnlmfh5RTcLRFdkCVIxM4sYJuSdV_B99ijLm8vazmS9VyfGjfqqbdnd5Puq7rln80AL8ry_FU82HbHdq2jMCHbPTT-XzePz_ujbn4-NMqpFY7C_mmPVeOoXCiTpUyMinY7B12VUTCIqFTyl49J-lCjkJzFrIQaUMPvWKQEsGzQAhOE2TiaHNN3lUBioIinmOExIwZq45tlG0Y-V5Ypup8mcaYTDFWnmouyWFq0LhavVuWrEubH2n-n8B8Wqf1eNpuZyeROQSBpzPbzY724k-Noe_7l5zxdU79PKp-fXvRXih7Sd05ysWPq0N1AWItGQl8exei9uZZ9PqfqMPXSQ9Xo5pfow3VP2_M-iTG4oVqJGJqgpBCCFDSmI_4Pljx937_F3SQFG8"
      }
    }

Get resource instance usage in an organization

Query for resource instance usage in an organization. Filter the results with query parameters. Account billing administrator and organization billing administrators are authorized to access this report.

Query for resource instance usage in an organization. Filter the results with query parameters. Account billing administrator and organization billing administrators are authorized to access this report.

Query for resource instance usage in an organization. Filter the results with query parameters. Account billing administrator and organization billing administrators are authorized to access this report.

Query for resource instance usage in an organization. Filter the results with query parameters. Account billing administrator and organization billing administrators are authorized to access this report.

Query for resource instance usage in an organization. Filter the results with query parameters. Account billing administrator and organization billing administrators are authorized to access this report.

GET /v4/accounts/{account_id}/organizations/{organization_id}/resource_instances/usage/{billingmonth}
(usageReports *UsageReportsV4) GetResourceUsageOrg(getResourceUsageOrgOptions *GetResourceUsageOrgOptions) (result *InstancesUsage, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetResourceUsageOrgWithContext(ctx context.Context, getResourceUsageOrgOptions *GetResourceUsageOrgOptions) (result *InstancesUsage, response *core.DetailedResponse, err error)
ServiceCall<InstancesUsage> getResourceUsageOrg(GetResourceUsageOrgOptions getResourceUsageOrgOptions)
getResourceUsageOrg(params)
get_resource_usage_org(
        self,
        account_id: str,
        organization_id: str,
        billingmonth: str,
        *,
        names: bool = None,
        tags: bool = None,
        accept_language: str = None,
        limit: int = None,
        start: str = None,
        resource_instance_id: str = None,
        resource_id: str = None,
        plan_id: str = None,
        region: 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 > User > Access.

  • billing.usage-report.read

Auditing

Calling this method generates the following auditing event.

  • billing.usage-report.read

Request

Instantiate the GetResourceUsageOrgOptions struct and set the fields to provide parameter values for the GetResourceUsageOrg method.

Use the GetResourceUsageOrgOptions.Builder to create a GetResourceUsageOrgOptions object that contains the parameter values for the getResourceUsageOrg 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.

    Possible values: 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.

  • Include the tags associated with every resource instance. By default it is always true.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource instance id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

WithContext method only

The GetResourceUsageOrg options.

The getResourceUsageOrg 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.

    Possible values: 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.

  • Include the user tags associated with every resource instance. By default it is always true.

  • Prioritize the names returned in the order of the specified languages. Language will default to English.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource instance id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

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.

    Possible values: 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.

  • Include the user tags associated with every resource instance. By default it is always true.

  • Prioritize the names returned in the order of the specified languages. Language will default to English.

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • Filter by resource instance id.

  • Filter by resource_id.

  • Filter by plan_id.

  • Region in which the resource instance is provisioned.

  • curl -X GET -H "Authorization: {iam_token}"   -H "Accept: application/json"   "{base_url}/v4/accounts/{account_id}/organizations/{organization_id}/resource_instances/usage/{billingmonth}"
  • getResourceUsageOrgOptions := usageReportsService.NewGetResourceUsageOrgOptions(
      accountID,
      orgID,
      billingMonth,
    )
    
    instancesUsage, response, err := usageReportsService.GetResourceUsageOrg(getResourceUsageOrgOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(instancesUsage, "", "  ")
    fmt.Println(string(b))
  • GetResourceUsageOrgOptions getResourceUsageOrgOptions = new GetResourceUsageOrgOptions.Builder()
      .accountId(accountId)
      .organizationId(orgId)
      .billingmonth(billingMonth)
      .build();
    
    Response<InstancesUsage> response = service.getResourceUsageOrg(getResourceUsageOrgOptions).execute();
    InstancesUsage instancesUsage = response.getResult();
    
    System.out.println("getResourceUsageOrg() result:\n" + instancesUsage.toString());
  • const params = {
      accountId: accountId,
      organizationId: orgId,
      billingmonth: billingMonth,
    };
    
    usageReportsService.getResourceUsageOrg(params)
      .then(res => {
        console.log(JSON.stringify(res.result, null, 2));
      })
      .catch(err => {
        console.warn(err)
      });
  • instances_usage = usage_reports_service.get_resource_usage_org(
      account_id=account_id,
      organization_id=org_id,
      billingmonth=billing_month
    ).get_result()
    
    print(json.dumps(instances_usage, indent=2))

Response

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

The list of instance usage reports.

Status Code

  • Resource instance usage returned successfully

  • Status 400

  • Status 401

  • Status 429

  • Status 500

Example responses
  • {
      "limit": 3,
      "count": 90,
      "first": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/organizations/us-south:54257f98-83f0-4eca-ae04-9ea35277a538/resource_instances/usage/2023-06?_limit=3&_names=true&_tags=true"
      },
      "resources": [
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:f691fb7f-cae7-4094-9055-e85ade96f9e3",
          "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
          "space_id": "1ca5fea5-1d93-405c-84cc-7b20c1c199f9",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:f691fb7f-cae7-4094-9055-e85ade96f9e3:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "us-south",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 122.71594402777778,
              "cost": 8.084526392549998,
              "rated_cost": 8.982807102833332,
              "rateable_quantity": 122.71594402777778,
              "discounts": [
                {
                  "name": "Rajesh a paygo user gets discount on all services",
                  "display_name": "Rajesh a paygo user gets discount on all services",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "resource_instance_name": "account-apis",
          "organization_name": "IBMBSS",
          "space_name": "AcctMgmt"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:990935c8-7996-4ff4-867e-f9d76968c308",
          "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
          "space_id": "b8512d83-2e92-42ed-ac2a-f1e67ddd7ca4",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:990935c8-7996-4ff4-867e-f9d76968c308:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "us-south",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 1004.7370049435764,
              "cost": 66.19207388568282,
              "rated_cost": 73.5467487618698,
              "rateable_quantity": 1004.7370049435764,
              "discounts": [
                {
                  "name": "Rajesh a paygo user gets discount on all services",
                  "display_name": "Rajesh a paygo user gets discount on all services",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "resource_instance_name": "bssanalytics3-backend",
          "space_name": "BSSDashboard",
          "organization_name": "IBMBSS"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:b01a25b6-3a6d-4364-aa7d-2657ebe3b671",
          "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
          "space_id": "e7d62aa5-d8e4-4161-b526-ab6b0b4b826d",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:b01a25b6-3a6d-4364-aa7d-2657ebe3b671:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "us-south",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 981.72781,
              "cost": 64.6762281228,
              "rated_cost": 71.862475692,
              "rateable_quantity": 981.72781,
              "discounts": [
                {
                  "name": "Rajesh a paygo user gets discount on all services",
                  "display_name": "Rajesh a paygo user gets discount on all services",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "resource_instance_name": "account-worker-green",
          "space_name": "RatingService",
          "organization_name": "IBMBSS"
        }
      ],
      "next": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/organizations/us-south:54257f98-83f0-4eca-ae04-9ea35277a538/resource_instances/usage/2023-06?_limit=3&_names=true&_start=g1AAAAIzeJy10DtOxEAMBuAIuAs0ydjjeZmKq3heLNlsIpGEmmPQcRUqrsFRlgQkaoSEi9-SLRf-hqZpLg6XubnOMU2P5S5H7h7iqY3zPC9yXwB0l4ZpzTIu3ViWYT8Yr7Zsnrd2Pp9f-6_ZaYv3o9LOZs5aW_bZlGIDIwXWDEwVtXFqndt5WpfDrTXa-sqhDVShNSVJKwVMy0XIau_FUlCQDVY0hDqKjeBYYqriKjrWJlSjGANTyZkNBK7a55CEwJCNlBDYKdgWGtDsX3XjlEuXS5V1WJQqT2Vc1KIAAF2w1nsHe8WmCb7fVW5-VBB_y_L2zfLxnywIhNUhiYYgUD0IxmiSOEhBKrDCyGQyJhetdk6QC5N14iJQqSnQH1n8S99_Alxom98&_tags=true",
        "offset": "g1AAAAIzeJy10DtOxEAMBuAIuAs0ydjjeZmKq3heLNlsIpGEmmPQcRUqrsFRlgQkaoSEi9-SLRf-hqZpLg6XubnOMU2P5S5H7h7iqY3zPC9yXwB0l4ZpzTIu3ViWYT8Yr7Zsnrd2Pp9f-6_ZaYv3o9LOZs5aW_bZlGIDIwXWDEwVtXFqndt5WpfDrTXa-sqhDVShNSVJKwVMy0XIau_FUlCQDVY0hDqKjeBYYqriKjrWJlSjGANTyZkNBK7a55CEwJCNlBDYKdgWGtDsX3XjlEuXS5V1WJQqT2Vc1KIAAF2w1nsHe8WmCb7fVW5-VBB_y_L2zfLxnywIhNUhiYYgUD0IxmiSOEhBKrDCyGQyJhetdk6QC5N14iJQqSnQH1n8S99_Alxom98"
      }
    }
  • {
      "limit": 3,
      "count": 90,
      "first": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/organizations/us-south:54257f98-83f0-4eca-ae04-9ea35277a538/resource_instances/usage/2023-06?_limit=3&_names=true&_tags=true"
      },
      "resources": [
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:f691fb7f-cae7-4094-9055-e85ade96f9e3",
          "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
          "space_id": "1ca5fea5-1d93-405c-84cc-7b20c1c199f9",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:f691fb7f-cae7-4094-9055-e85ade96f9e3:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "us-south",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 122.71594402777778,
              "cost": 8.084526392549998,
              "rated_cost": 8.982807102833332,
              "rateable_quantity": 122.71594402777778,
              "discounts": [
                {
                  "name": "Rajesh a paygo user gets discount on all services",
                  "display_name": "Rajesh a paygo user gets discount on all services",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "resource_instance_name": "account-apis",
          "organization_name": "IBMBSS",
          "space_name": "AcctMgmt"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:990935c8-7996-4ff4-867e-f9d76968c308",
          "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
          "space_id": "b8512d83-2e92-42ed-ac2a-f1e67ddd7ca4",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:990935c8-7996-4ff4-867e-f9d76968c308:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "us-south",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 1004.7370049435764,
              "cost": 66.19207388568282,
              "rated_cost": 73.5467487618698,
              "rateable_quantity": 1004.7370049435764,
              "discounts": [
                {
                  "name": "Rajesh a paygo user gets discount on all services",
                  "display_name": "Rajesh a paygo user gets discount on all services",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "resource_instance_name": "bssanalytics3-backend",
          "space_name": "BSSDashboard",
          "organization_name": "IBMBSS"
        },
        {
          "account_id": "265d9d22597d4ee589138929093f1246",
          "resource_instance_id": "cloud-foundry-application:b01a25b6-3a6d-4364-aa7d-2657ebe3b671",
          "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
          "space_id": "e7d62aa5-d8e4-4161-b526-ab6b0b4b826d",
          "month": "2023-06",
          "pricing_country": "USA",
          "billing_country": "USA",
          "currency_code": "USD",
          "plan_id": "04082014.ibm.node.default",
          "consumer_id": "cloud-foundry-application:b01a25b6-3a6d-4364-aa7d-2657ebe3b671:name:sdk-for-nodejs",
          "resource_id": "sdk-for-nodejs",
          "billable": true,
          "pricing_plan_id": "billable:v4:04082014.ibm.node.default::1685577600000:",
          "region": "us-south",
          "usage": [
            {
              "metric": "GB_HOURS_PER_MONTH",
              "unit": "GB-HOURS",
              "price": [
                {
                  "unitQuantity": "100",
                  "tier_model": "Granular Tier",
                  "price": 7.32,
                  "quantity_tier": "1"
                }
              ],
              "quantity": 981.72781,
              "cost": 64.6762281228,
              "rated_cost": 71.862475692,
              "rateable_quantity": 981.72781,
              "discounts": [
                {
                  "name": "Rajesh a paygo user gets discount on all services",
                  "display_name": "Rajesh a paygo user gets discount on all services",
                  "ref": "Discount-ddb74ac0-879e-46f2-9a07-a51dc8d6aeb2",
                  "discount": 10
                }
              ],
              "metric_name": "GB_HOURS_PER_MONTH",
              "unit_name": "GB_HOURS_PER_MONTH"
            }
          ],
          "currency_rate": 1,
          "tags": [],
          "service_tags": [],
          "plan_name": "Default",
          "resource_name": "IBM Cloud Node.js",
          "resource_instance_name": "account-worker-green",
          "space_name": "RatingService",
          "organization_name": "IBMBSS"
        }
      ],
      "next": {
        "href": "/v4/accounts/265d9d22597d4ee589138929093f1246/organizations/us-south:54257f98-83f0-4eca-ae04-9ea35277a538/resource_instances/usage/2023-06?_limit=3&_names=true&_start=g1AAAAIzeJy10DtOxEAMBuAIuAs0ydjjeZmKq3heLNlsIpGEmmPQcRUqrsFRlgQkaoSEi9-SLRf-hqZpLg6XubnOMU2P5S5H7h7iqY3zPC9yXwB0l4ZpzTIu3ViWYT8Yr7Zsnrd2Pp9f-6_ZaYv3o9LOZs5aW_bZlGIDIwXWDEwVtXFqndt5WpfDrTXa-sqhDVShNSVJKwVMy0XIau_FUlCQDVY0hDqKjeBYYqriKjrWJlSjGANTyZkNBK7a55CEwJCNlBDYKdgWGtDsX3XjlEuXS5V1WJQqT2Vc1KIAAF2w1nsHe8WmCb7fVW5-VBB_y_L2zfLxnywIhNUhiYYgUD0IxmiSOEhBKrDCyGQyJhetdk6QC5N14iJQqSnQH1n8S99_Alxom98&_tags=true",
        "offset": "g1AAAAIzeJy10DtOxEAMBuAIuAs0ydjjeZmKq3heLNlsIpGEmmPQcRUqrsFRlgQkaoSEi9-SLRf-hqZpLg6XubnOMU2P5S5H7h7iqY3zPC9yXwB0l4ZpzTIu3ViWYT8Yr7Zsnrd2Pp9f-6_ZaYv3o9LOZs5aW_bZlGIDIwXWDEwVtXFqndt5WpfDrTXa-sqhDVShNSVJKwVMy0XIau_FUlCQDVY0hDqKjeBYYqriKjrWJlSjGANTyZkNBK7a55CEwJCNlBDYKdgWGtDsX3XjlEuXS5V1WJQqT2Vc1KIAAF2w1nsHe8WmCb7fVW5-VBB_y_L2zfLxnywIhNUhiYYgUD0IxmiSOEhBKrDCyGQyJhetdk6QC5N14iJQqSnQH1n8S99_Alxom98"
      }
    }

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 > User > Access.

View account level summary usage

  • billing.usage-report.read

Auditing

Calling this method generates the following auditing event.

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.

    Possible values: 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.

    Possible values: 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.

    Possible values: 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.

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

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

Status Code

  • Organization usage successfully returned

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses
  • {
        "pricing_country": "USA",
        "currency_code": "USD",
        "resources": [
            {
                "resource_id": "platform-a495-4aa1-9ef9-40b88a42d776",
                "billable_cost": 0,
                "non_billable_cost": 686.9073718764323,
                "plans": [
                    {
                        "plan_id": "04082014.ibm.platform.default",
                        "billable": false,
                        "cost": 686.9073718764323,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 7
                                    }
                                ],
                                "quantity": 9812.962455377605,
                                "rateable_quantity": 9812.962455377605,
                                "cost": 686.9073718764323
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "sdk-for-nodejs",
                "billable_cost": 0,
                "non_billable_cost": 25012.305433024216,
                "plans": [
                    {
                        "plan_id": "04082014.ibm.node.default",
                        "billable": false,
                        "cost": 25012.305433024216,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 7
                                    }
                                ],
                                "quantity": 357318.6490432031,
                                "rateable_quantity": 357318.6490432031,
                                "cost": 25012.305433024216
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "liberty-for-java",
                "billable_cost": 0,
                "non_billable_cost": 190.7693471736111,
                "plans": [
                    {
                        "plan_id": "04082014.ibm.liberty.default",
                        "billable": false,
                        "cost": 190.7693471736111,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 7
                                    }
                                ],
                                "quantity": 2725.2763881944443,
                                "rateable_quantity": 2725.2763881944443,
                                "cost": 190.7693471736111
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "5acdbc42-8965-48f9-8a3c-1c728b6ed2c4",
                "billable_cost": 0,
                "non_billable_cost": 720,
                "plans": [
                    {
                        "plan_id": "7f19407b-f9fd-4e74-8c75-3355eee89628",
                        "billable": false,
                        "cost": 720,
                        "usage": [
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [],
                                "quantity": 8,
                                "rateable_quantity": 8,
                                "cost": 0
                            },
                            {
                                "metric": "HOSTS_HOURS_PER_MONTH",
                                "unit": "HOUR",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 3.75
                                    }
                                ],
                                "quantity": 192,
                                "rateable_quantity": 192,
                                "cost": 720
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "cloudant",
                "billable_cost": 0,
                "non_billable_cost": 77.05499999999999,
                "plans": [
                    {
                        "plan_id": "cloudant-shared",
                        "billable": false,
                        "cost": 0.3,
                        "usage": [
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 100
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "LIGHT_API_CALLS_PER_MONTH",
                                "unit": "LIGHT_API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 3
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "HEAVY_API_CALLS_PER_MONTH",
                                "unit": "HEAVY_API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 15
                                    }
                                ],
                                "quantity": 1800,
                                "rateable_quantity": 2,
                                "cost": 0.3
                            },
                            {
                                "metric": "LOOKUPS_PER_MONTH",
                                "unit": "LOOKUP",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "WRITES_PER_MONTH",
                                "unit": "WRITE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "QUERIES_PER_MONTH",
                                "unit": "QUERY",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_MANAGED_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    },
                    {
                        "plan_id": "cloudant-standard",
                        "billable": false,
                        "cost": 76.755,
                        "usage": [
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "LIGHT_API_CALLS_PER_MONTH",
                                "unit": "LIGHT_API_CALL",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "HEAVY_API_CALLS_PER_MONTH",
                                "unit": "HEAVY_API_CALL",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "LOOKUPS_PER_MONTH",
                                "unit": "LOOKUP",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 25
                                    }
                                ],
                                "quantity": 102.34,
                                "rateable_quantity": 102.34,
                                "cost": 25.585
                            },
                            {
                                "metric": "WRITES_PER_MONTH",
                                "unit": "WRITE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 50
                                    }
                                ],
                                "quantity": 51.17,
                                "rateable_quantity": 51.17,
                                "cost": 25.585
                            },
                            {
                                "metric": "QUERIES_PER_MONTH",
                                "unit": "QUERY",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 500
                                    }
                                ],
                                "quantity": 5.117,
                                "rateable_quantity": 5.117,
                                "cost": 25.585
                            },
                            {
                                "metric": "STORAGE_MANAGED_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 100
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "IBM-Performance-Hub-1.0",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "Free-IBM-Performance-Hub-1.0",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "DATA_POINTS_PER_MONTH",
                                "unit": "DATA_POINT",
                                "price": [],
                                "quantity": 123184,
                                "rateable_quantity": 123184,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "DataCache-20140407WXS",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "ibm.DataCache.free",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "MB_PER_MONTH",
                                "unit": "MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "ibm-container",
                "billable_cost": 0,
                "non_billable_cost": 2,
                "plans": [
                    {
                        "plan_id": "06182015.ibm.containers",
                        "billable": false,
                        "cost": 2,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 2.8
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "IPS_PER_MONTH",
                                "unit": "IP",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 2
                                    }
                                ],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 2
                            },
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 14
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_BRONZE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 0.15
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_SILVER_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 0.35
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_GOLD_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 0.58
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "api-connect",
                "billable_cost": 0,
                "non_billable_cost": 1338600,
                "plans": [
                    {
                        "plan_id": "api-connect-enterprise25m",
                        "billable": false,
                        "cost": 1178600,
                        "usage": [
                            {
                                "metric": "API_CALLS_PER_MONTH",
                                "unit": "API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 100
                                    }
                                ],
                                "quantity": 1193530688,
                                "rateable_quantity": 1168600000,
                                "cost": 1168600
                            },
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 10000
                                    }
                                ],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 10000
                            }
                        ]
                    },
                    {
                        "plan_id": "api-connect-enterprise1b",
                        "billable": false,
                        "cost": 160000,
                        "usage": [
                            {
                                "metric": "API_CALLS_PER_MONTH",
                                "unit": "API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 16
                                    }
                                ],
                                "quantity": 777509147,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 160000
                                    }
                                ],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 160000
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "iotf-service-id",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "iotf-service-asp-id",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "ACTIVE_DEVICES_PER_MONTH",
                                "unit": "ACTIVE_DEVICE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "MEGABYTES_TRANSMITTED_PER_MONTH",
                                "unit": "MEGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 13
                                    },
                                    {
                                        "quantity_tier": "45.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 9.1
                                    },
                                    {
                                        "quantity_tier": "700.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 1.82
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "PLAN_PER_MONTH",
                                "unit": "PLAN",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "EDGE_ANALYSIS_PER_MONTH",
                                "unit": "EDGE_MEGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 5
                                    },
                                    {
                                        "quantity_tier": "45.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 3.5
                                    },
                                    {
                                        "quantity_tier": "700.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 0.7
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "RTI_ANALYSIS_PER_MONTH",
                                "unit": "RTI_MEGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 30
                                    },
                                    {
                                        "quantity_tier": "45.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 21
                                    },
                                    {
                                        "quantity_tier": "700.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 4.2
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    },
                    {
                        "plan_id": "iotf-service-free-id",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "ACTIVE_DEVICES_PER_MONTH",
                                "unit": "ACTIVE_DEVICE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "MEGABYTES_TRANSMITTED_PER_MONTH",
                                "unit": "MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "PLAN_PER_MONTH",
                                "unit": "PLAN",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "EDGE_ANALYSIS_PER_MONTH",
                                "unit": "EDGE_MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "RTI_ANALYSIS_PER_MONTH",
                                "unit": "RTI_MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "CloudEventManagement16a036f0-f1fc-11e6-a38d-394caee7d66d",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "af0a953b-f647-4b0b-b099-8dcc61a910ed",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "EVENTS_PER_MONTH",
                                "unit": "EVENT",
                                "price": [],
                                "quantity": 410822,
                                "rateable_quantity": 410822,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "c466e218-9188-4562-9af5-fc7e0dc790c5",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "d5b9d765-8ff5-4772-9aac-2d7017044ae9",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "API_CALLS_PER_MONTH",
                                "unit": "API_CALL",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "EVENTS_PER_MONTH",
                                "unit": "EVENT",
                                "price": [],
                                "quantity": 33,
                                "rateable_quantity": 33,
                                "cost": 0
                            },
                            {
                                "metric": "EVENTS_STORED_PER_MONTH",
                                "unit": "EVENTS_STORED",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            }
        ],
        "account_id": "265d9d22597d4ee589138929093f1246",
        "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
        "month": "2017-07"
    }
    
  • {
        "pricing_country": "USA",
        "currency_code": "USD",
        "resources": [
            {
                "resource_id": "platform-a495-4aa1-9ef9-40b88a42d776",
                "billable_cost": 0,
                "non_billable_cost": 686.9073718764323,
                "plans": [
                    {
                        "plan_id": "04082014.ibm.platform.default",
                        "billable": false,
                        "cost": 686.9073718764323,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 7
                                    }
                                ],
                                "quantity": 9812.962455377605,
                                "rateable_quantity": 9812.962455377605,
                                "cost": 686.9073718764323
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "sdk-for-nodejs",
                "billable_cost": 0,
                "non_billable_cost": 25012.305433024216,
                "plans": [
                    {
                        "plan_id": "04082014.ibm.node.default",
                        "billable": false,
                        "cost": 25012.305433024216,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 7
                                    }
                                ],
                                "quantity": 357318.6490432031,
                                "rateable_quantity": 357318.6490432031,
                                "cost": 25012.305433024216
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "liberty-for-java",
                "billable_cost": 0,
                "non_billable_cost": 190.7693471736111,
                "plans": [
                    {
                        "plan_id": "04082014.ibm.liberty.default",
                        "billable": false,
                        "cost": 190.7693471736111,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 7
                                    }
                                ],
                                "quantity": 2725.2763881944443,
                                "rateable_quantity": 2725.2763881944443,
                                "cost": 190.7693471736111
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "5acdbc42-8965-48f9-8a3c-1c728b6ed2c4",
                "billable_cost": 0,
                "non_billable_cost": 720,
                "plans": [
                    {
                        "plan_id": "7f19407b-f9fd-4e74-8c75-3355eee89628",
                        "billable": false,
                        "cost": 720,
                        "usage": [
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [],
                                "quantity": 8,
                                "rateable_quantity": 8,
                                "cost": 0
                            },
                            {
                                "metric": "HOSTS_HOURS_PER_MONTH",
                                "unit": "HOUR",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 3.75
                                    }
                                ],
                                "quantity": 192,
                                "rateable_quantity": 192,
                                "cost": 720
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "cloudant",
                "billable_cost": 0,
                "non_billable_cost": 77.05499999999999,
                "plans": [
                    {
                        "plan_id": "cloudant-shared",
                        "billable": false,
                        "cost": 0.3,
                        "usage": [
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 100
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "LIGHT_API_CALLS_PER_MONTH",
                                "unit": "LIGHT_API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 3
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "HEAVY_API_CALLS_PER_MONTH",
                                "unit": "HEAVY_API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 15
                                    }
                                ],
                                "quantity": 1800,
                                "rateable_quantity": 2,
                                "cost": 0.3
                            },
                            {
                                "metric": "LOOKUPS_PER_MONTH",
                                "unit": "LOOKUP",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "WRITES_PER_MONTH",
                                "unit": "WRITE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "QUERIES_PER_MONTH",
                                "unit": "QUERY",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_MANAGED_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    },
                    {
                        "plan_id": "cloudant-standard",
                        "billable": false,
                        "cost": 76.755,
                        "usage": [
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "LIGHT_API_CALLS_PER_MONTH",
                                "unit": "LIGHT_API_CALL",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "HEAVY_API_CALLS_PER_MONTH",
                                "unit": "HEAVY_API_CALL",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "LOOKUPS_PER_MONTH",
                                "unit": "LOOKUP",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 25
                                    }
                                ],
                                "quantity": 102.34,
                                "rateable_quantity": 102.34,
                                "cost": 25.585
                            },
                            {
                                "metric": "WRITES_PER_MONTH",
                                "unit": "WRITE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 50
                                    }
                                ],
                                "quantity": 51.17,
                                "rateable_quantity": 51.17,
                                "cost": 25.585
                            },
                            {
                                "metric": "QUERIES_PER_MONTH",
                                "unit": "QUERY",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 500
                                    }
                                ],
                                "quantity": 5.117,
                                "rateable_quantity": 5.117,
                                "cost": 25.585
                            },
                            {
                                "metric": "STORAGE_MANAGED_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Step Tier",
                                        "unitQuantity": "100",
                                        "price": 100
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "IBM-Performance-Hub-1.0",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "Free-IBM-Performance-Hub-1.0",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "DATA_POINTS_PER_MONTH",
                                "unit": "DATA_POINT",
                                "price": [],
                                "quantity": 123184,
                                "rateable_quantity": 123184,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "DataCache-20140407WXS",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "ibm.DataCache.free",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "MB_PER_MONTH",
                                "unit": "MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "ibm-container",
                "billable_cost": 0,
                "non_billable_cost": 2,
                "plans": [
                    {
                        "plan_id": "06182015.ibm.containers",
                        "billable": false,
                        "cost": 2,
                        "usage": [
                            {
                                "metric": "GB_HOURS_PER_MONTH",
                                "unit": "GB-HOURS",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "100",
                                        "price": 2.8
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "IPS_PER_MONTH",
                                "unit": "IP",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 2
                                    }
                                ],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 2
                            },
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 14
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_BRONZE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 0.15
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_SILVER_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 0.35
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_GOLD_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 0.58
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "api-connect",
                "billable_cost": 0,
                "non_billable_cost": 1338600,
                "plans": [
                    {
                        "plan_id": "api-connect-enterprise25m",
                        "billable": false,
                        "cost": 1178600,
                        "usage": [
                            {
                                "metric": "API_CALLS_PER_MONTH",
                                "unit": "API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 100
                                    }
                                ],
                                "quantity": 1193530688,
                                "rateable_quantity": 1168600000,
                                "cost": 1168600
                            },
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 10000
                                    }
                                ],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 10000
                            }
                        ]
                    },
                    {
                        "plan_id": "api-connect-enterprise1b",
                        "billable": false,
                        "cost": 160000,
                        "usage": [
                            {
                                "metric": "API_CALLS_PER_MONTH",
                                "unit": "API_CALL",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 16
                                    }
                                ],
                                "quantity": 777509147,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "INSTANCES_PER_MONTH",
                                "unit": "INSTANCE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "1",
                                        "price": 160000
                                    }
                                ],
                                "quantity": 1,
                                "rateable_quantity": 1,
                                "cost": 160000
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "iotf-service-id",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "iotf-service-asp-id",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "ACTIVE_DEVICES_PER_MONTH",
                                "unit": "ACTIVE_DEVICE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "MEGABYTES_TRANSMITTED_PER_MONTH",
                                "unit": "MEGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 13
                                    },
                                    {
                                        "quantity_tier": "45.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 9.1
                                    },
                                    {
                                        "quantity_tier": "700.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 1.82
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "PLAN_PER_MONTH",
                                "unit": "PLAN",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "EDGE_ANALYSIS_PER_MONTH",
                                "unit": "EDGE_MEGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 5
                                    },
                                    {
                                        "quantity_tier": "45.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 3.5
                                    },
                                    {
                                        "quantity_tier": "700.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 0.7
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "RTI_ANALYSIS_PER_MONTH",
                                "unit": "RTI_MEGABYTE",
                                "price": [
                                    {
                                        "quantity_tier": "1.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 30
                                    },
                                    {
                                        "quantity_tier": "45.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 21
                                    },
                                    {
                                        "quantity_tier": "700.000",
                                        "tier_model": "Granular Tier",
                                        "unitQuantity": "10000",
                                        "price": 4.2
                                    }
                                ],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    },
                    {
                        "plan_id": "iotf-service-free-id",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "ACTIVE_DEVICES_PER_MONTH",
                                "unit": "ACTIVE_DEVICE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "MEGABYTES_TRANSMITTED_PER_MONTH",
                                "unit": "MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "STORAGE_PER_MONTH",
                                "unit": "GIGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "PLAN_PER_MONTH",
                                "unit": "PLAN",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "EDGE_ANALYSIS_PER_MONTH",
                                "unit": "EDGE_MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "RTI_ANALYSIS_PER_MONTH",
                                "unit": "RTI_MEGABYTE",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "CloudEventManagement16a036f0-f1fc-11e6-a38d-394caee7d66d",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "af0a953b-f647-4b0b-b099-8dcc61a910ed",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "EVENTS_PER_MONTH",
                                "unit": "EVENT",
                                "price": [],
                                "quantity": 410822,
                                "rateable_quantity": 410822,
                                "cost": 0
                            }
                        ]
                    }
                ]
            },
            {
                "resource_id": "c466e218-9188-4562-9af5-fc7e0dc790c5",
                "billable_cost": 0,
                "non_billable_cost": 0,
                "plans": [
                    {
                        "plan_id": "d5b9d765-8ff5-4772-9aac-2d7017044ae9",
                        "billable": false,
                        "cost": 0,
                        "usage": [
                            {
                                "metric": "API_CALLS_PER_MONTH",
                                "unit": "API_CALL",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            },
                            {
                                "metric": "EVENTS_PER_MONTH",
                                "unit": "EVENT",
                                "price": [],
                                "quantity": 33,
                                "rateable_quantity": 33,
                                "cost": 0
                            },
                            {
                                "metric": "EVENTS_STORED_PER_MONTH",
                                "unit": "EVENTS_STORED",
                                "price": [],
                                "quantity": 0,
                                "rateable_quantity": 0,
                                "cost": 0
                            }
                        ]
                    }
                ]
            }
        ],
        "account_id": "265d9d22597d4ee589138929093f1246",
        "organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
        "month": "2017-07"
    }
    

Setup the snapshot configuration

Snapshots of the billing reports would be taken on a periodic interval and stored based on the configuration setup by the customer for the given Account Id.

Snapshots of the billing reports would be taken on a periodic interval and stored based on the configuration setup by the customer for the given Account Id.

Snapshots of the billing reports would be taken on a periodic interval and stored based on the configuration setup by the customer for the given Account Id.

Snapshots of the billing reports would be taken on a periodic interval and stored based on the configuration setup by the customer for the given Account Id.

Snapshots of the billing reports would be taken on a periodic interval and stored based on the configuration setup by the customer for the given Account Id.

POST /v1/billing-reports-snapshot-config
(usageReports *UsageReportsV4) CreateReportsSnapshotConfig(createReportsSnapshotConfigOptions *CreateReportsSnapshotConfigOptions) (result *SnapshotConfig, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) CreateReportsSnapshotConfigWithContext(ctx context.Context, createReportsSnapshotConfigOptions *CreateReportsSnapshotConfigOptions) (result *SnapshotConfig, response *core.DetailedResponse, err error)
ServiceCall<SnapshotConfig> createReportsSnapshotConfig(CreateReportsSnapshotConfigOptions createReportsSnapshotConfigOptions)
createReportsSnapshotConfig(params)
create_reports_snapshot_config(
        self,
        account_id: str,
        interval: str,
        cos_bucket: str,
        cos_location: str,
        *,
        cos_reports_folder: str = None,
        report_types: List[str] = None,
        versioning: 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 > User > Access.

  • billing.billing-reports-snapshot-config.create

Request

Instantiate the CreateReportsSnapshotConfigOptions struct and set the fields to provide parameter values for the CreateReportsSnapshotConfig method.

Use the CreateReportsSnapshotConfigOptions.Builder to create a CreateReportsSnapshotConfigOptions object that contains the parameter values for the createReportsSnapshotConfig method.

Request payload to create a billing reports snapshot configuration.

WithContext method only

The CreateReportsSnapshotConfig options.

The createReportsSnapshotConfig options.

parameters

  • Account ID for which billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • Frequency of taking the snapshot of the billing reports.

    Allowable values: [daily]

    Examples:
    value
    _source
    _lines
    _html
  • The name of the COS bucket to store the snapshot of the billing reports.

    Examples:
    value
    _source
    _lines
    _html
  • Region of the COS instance.

    Examples:
    value
    _source
    _lines
    _html
  • The billing reports root folder to store the billing reports snapshots. Defaults to "IBMCloud-Billing-Reports".

    Default: IBMCloud-Billing-Reports

    Examples:
    value
    _source
    _lines
    _html
  • The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].

    Allowable values: [account_summary,enterprise_summary,account_resource_instance_usage]

    Examples:
    value
    _source
    _lines
    _html
  • A new version of report is created or the existing report version is overwritten with every update. Defaults to "new".

    Allowable values: [new,overwrite]

    Default: new

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Account ID for which billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • Frequency of taking the snapshot of the billing reports.

    Allowable values: [daily]

    Examples:
    value
    _source
    _lines
    _html
  • The name of the COS bucket to store the snapshot of the billing reports.

    Examples:
    value
    _source
    _lines
    _html
  • Region of the COS instance.

    Examples:
    value
    _source
    _lines
    _html
  • The billing reports root folder to store the billing reports snapshots. Defaults to "IBMCloud-Billing-Reports".

    Default: IBMCloud-Billing-Reports

    Examples:
    value
    _source
    _lines
    _html
  • The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].

    Allowable values: [account_summary,enterprise_summary,account_resource_instance_usage]

    Examples:
    value
    _source
    _lines
    _html
  • A new version of report is created or the existing report version is overwritten with every update. Defaults to "new".

    Allowable values: [new,overwrite]

    Default: new

    Examples:
    value
    _source
    _lines
    _html
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "account_id": "accountId", "interval": "daily", "cos_bucket": "bucket_name", "cos_location": "us-south" }'   "{base_url}/v1/billing-reports-snapshot-config"
  • createReportsSnapshotConfigOptions := usageReportsService.NewCreateReportsSnapshotConfigOptions(
      "accountId",
      "daily",
      "bucket_name",
      "us-south",
    )
    
    snapshotConfig, response, err := usageReportsService.CreateReportsSnapshotConfig(createReportsSnapshotConfigOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(snapshotConfig, "", "  ")
    fmt.Println(string(b))
  • CreateReportsSnapshotConfigOptions createReportsSnapshotConfigOptions = new CreateReportsSnapshotConfigOptions.Builder()
      .accountId("accountId")
      .interval("daily")
      .cosBucket("bucket_name")
      .cosLocation("us-south")
      .build();
    
    Response<SnapshotConfig> response = usageReportsService.createReportsSnapshotConfig(createReportsSnapshotConfigOptions).execute();
    SnapshotConfig snapshotConfig = response.getResult();
    
    System.out.println(snapshotConfig);
  • const params = {
      accountId: 'accountId',
      interval: 'daily',
      cosBucket: 'bucket_name',
      cosLocation: 'us-south',
    };
    
    let res;
    try {
      res = await usageReportsService.createReportsSnapshotConfig(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = usage_reports_service.create_reports_snapshot_config(
      account_id='accountId',
      interval='daily',
      cos_bucket='bucket_name',
      cos_location='us-south',
    )
    snapshot_config = response.get_result()
    
    print(json.dumps(snapshot_config, indent=2))

Response

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Status Code

  • Indicates that the billing reports snapshot for the respective account is successfully created with the submitted payload.

  • Bad request

  • Unauthenticated

  • Unauthorized

  • Not found

  • Conflict

  • Dependency failure

  • Internal Server Error

  • Service Unavailable

Example responses
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "state": "enabled",
      "account_type": "account",
      "interval": "daily",
      "versioning": "overwrite",
      "report_types": [
        "account_summary",
        "account_resource_instance_usage"
      ],
      "compression": "GZIP",
      "content_type": "text/csv",
      "cos_reports_folder": "june",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
      "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud",
      "created_at": 1687469854342,
      "last_updated_at": 1687470383610,
      "history": [
        {
          "start_time": 1687469854342,
          "updated_by": "IBMid-506PR16K14",
          "account_id": "272b9a4f73e11030d0ba037daee47a35",
          "state": "enabled",
          "account_type": "account",
          "interval": "daily",
          "versioning": "overwrite",
          "report_types": [
            "account_summary",
            "account_resource_instance_usage"
          ],
          "compression": "GZIP",
          "content_type": "text/csv",
          "cos_reports_folder": "june",
          "cos_bucket": "yue-bucket-us-south",
          "cos_location": "us-south",
          "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud"
        }
      ]
    }
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "state": "enabled",
      "account_type": "account",
      "interval": "daily",
      "versioning": "overwrite",
      "report_types": [
        "account_summary",
        "account_resource_instance_usage"
      ],
      "compression": "GZIP",
      "content_type": "text/csv",
      "cos_reports_folder": "june",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
      "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud",
      "created_at": 1687469854342,
      "last_updated_at": 1687470383610,
      "history": [
        {
          "start_time": 1687469854342,
          "updated_by": "IBMid-506PR16K14",
          "account_id": "272b9a4f73e11030d0ba037daee47a35",
          "state": "enabled",
          "account_type": "account",
          "interval": "daily",
          "versioning": "overwrite",
          "report_types": [
            "account_summary",
            "account_resource_instance_usage"
          ],
          "compression": "GZIP",
          "content_type": "text/csv",
          "cos_reports_folder": "june",
          "cos_bucket": "yue-bucket-us-south",
          "cos_location": "us-south",
          "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud"
        }
      ]
    }

Fetch the snapshot configuration

Returns the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Returns the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Returns the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Returns the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Returns the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

GET /v1/billing-reports-snapshot-config
(usageReports *UsageReportsV4) GetReportsSnapshotConfig(getReportsSnapshotConfigOptions *GetReportsSnapshotConfigOptions) (result *SnapshotConfig, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetReportsSnapshotConfigWithContext(ctx context.Context, getReportsSnapshotConfigOptions *GetReportsSnapshotConfigOptions) (result *SnapshotConfig, response *core.DetailedResponse, err error)
ServiceCall<SnapshotConfig> getReportsSnapshotConfig(GetReportsSnapshotConfigOptions getReportsSnapshotConfigOptions)
getReportsSnapshotConfig(params)
get_reports_snapshot_config(
        self,
        account_id: str,
        **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 > User > Access.

  • billing.billing-reports-snapshot-config.read

Request

Instantiate the GetReportsSnapshotConfigOptions struct and set the fields to provide parameter values for the GetReportsSnapshotConfig method.

Use the GetReportsSnapshotConfigOptions.Builder to create a GetReportsSnapshotConfigOptions object that contains the parameter values for the getReportsSnapshotConfig method.

Query Parameters

  • Account ID for which the billing report snapshot is configured.

    Example: abc

WithContext method only

The GetReportsSnapshotConfig options.

The getReportsSnapshotConfig options.

parameters

  • Account ID for which the billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Account ID for which the billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/billing-reports-snapshot-config?account_id=accountId"
  • getReportsSnapshotConfigOptions := usageReportsService.NewGetReportsSnapshotConfigOptions(
      "accountId",
    )
    
    snapshotConfig, response, err := usageReportsService.GetReportsSnapshotConfig(getReportsSnapshotConfigOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(snapshotConfig, "", "  ")
    fmt.Println(string(b))
  • GetReportsSnapshotConfigOptions getReportsSnapshotConfigOptions = new GetReportsSnapshotConfigOptions.Builder()
      .accountId("accountId")
      .build();
    
    Response<SnapshotConfig> response = usageReportsService.getReportsSnapshotConfig(getReportsSnapshotConfigOptions).execute();
    SnapshotConfig snapshotConfig = response.getResult();
    
    System.out.println(snapshotConfig);
  • const params = {
      accountId: 'accountId',
    };
    
    let res;
    try {
      res = await usageReportsService.getReportsSnapshotConfig(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = usage_reports_service.get_reports_snapshot_config(
      account_id='accountId',
    )
    snapshot_config = response.get_result()
    
    print(json.dumps(snapshot_config, indent=2))

Response

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Status Code

  • Snapshot configuration was returned successfully.

  • Bad request

  • Unauthenticated

  • Unauthorized

  • Not found

  • Internal Server Error

  • Service Unavailable

Example responses
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "state": "enabled",
      "account_type": "account",
      "interval": "daily",
      "versioning": "overwrite",
      "report_types": [
        "account_summary",
        "account_resource_instance_usage"
      ],
      "compression": "GZIP",
      "content_type": "text/csv",
      "cos_reports_folder": "june",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
      "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud",
      "created_at": 1687469854342,
      "last_updated_at": 1687470383610,
      "history": [
        {
            "start_time": 1687469854342,
            "end_time": 1687469989326,
            "updated_by": "IBMid-506PR16K14",
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "state": "enabled",
            "account_type": "account",
            "interval": "daily",
            "versioning": "overwrite",
            "report_types": [
                "account_summary",
                "account_resource_instance_usage"
            ],
            "compression": "GZIP",
            "content_type": "text/csv",
            "cos_reports_folder": "june",
            "cos_bucket": "yue-bucket-us-south",
            "cos_location": "us-south",
            "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud"
        }
      ]
    }
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "state": "enabled",
      "account_type": "account",
      "interval": "daily",
      "versioning": "overwrite",
      "report_types": [
        "account_summary",
        "account_resource_instance_usage"
      ],
      "compression": "GZIP",
      "content_type": "text/csv",
      "cos_reports_folder": "june",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
      "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud",
      "created_at": 1687469854342,
      "last_updated_at": 1687470383610,
      "history": [
        {
            "start_time": 1687469854342,
            "end_time": 1687469989326,
            "updated_by": "IBMid-506PR16K14",
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "state": "enabled",
            "account_type": "account",
            "interval": "daily",
            "versioning": "overwrite",
            "report_types": [
                "account_summary",
                "account_resource_instance_usage"
            ],
            "compression": "GZIP",
            "content_type": "text/csv",
            "cos_reports_folder": "june",
            "cos_bucket": "yue-bucket-us-south",
            "cos_location": "us-south",
            "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud"
        }
      ]
    }

Update the snapshot configuration

Updates the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Updates the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Updates the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Updates the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Updates the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

PATCH /v1/billing-reports-snapshot-config
(usageReports *UsageReportsV4) UpdateReportsSnapshotConfig(updateReportsSnapshotConfigOptions *UpdateReportsSnapshotConfigOptions) (result *SnapshotConfig, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) UpdateReportsSnapshotConfigWithContext(ctx context.Context, updateReportsSnapshotConfigOptions *UpdateReportsSnapshotConfigOptions) (result *SnapshotConfig, response *core.DetailedResponse, err error)
ServiceCall<SnapshotConfig> updateReportsSnapshotConfig(UpdateReportsSnapshotConfigOptions updateReportsSnapshotConfigOptions)
updateReportsSnapshotConfig(params)
update_reports_snapshot_config(
        self,
        account_id: str,
        *,
        interval: str = None,
        cos_bucket: str = None,
        cos_location: str = None,
        cos_reports_folder: str = None,
        report_types: List[str] = None,
        versioning: 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 > User > Access.

  • billing.billing-reports-snapshot-config.update

Request

Instantiate the UpdateReportsSnapshotConfigOptions struct and set the fields to provide parameter values for the UpdateReportsSnapshotConfig method.

Use the UpdateReportsSnapshotConfigOptions.Builder to create a UpdateReportsSnapshotConfigOptions object that contains the parameter values for the updateReportsSnapshotConfig method.

Request payload to update the billing reports snapshot configuration for specific Account ID.

WithContext method only

The UpdateReportsSnapshotConfig options.

The updateReportsSnapshotConfig options.

parameters

  • Account ID for which billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • Frequency of taking the snapshot of the billing reports.

    Allowable values: [daily]

    Examples:
    value
    _source
    _lines
    _html
  • The name of the COS bucket to store the snapshot of the billing reports.

    Examples:
    value
    _source
    _lines
    _html
  • Region of the COS instance.

    Examples:
    value
    _source
    _lines
    _html
  • The billing reports root folder to store the billing reports snapshots.

    Examples:
    value
    _source
    _lines
    _html
  • The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].

    Allowable values: [account_summary,enterprise_summary,account_resource_instance_usage]

    Examples:
    value
    _source
    _lines
    _html
  • A new version of report is created or the existing report version is overwritten with every update.

    Allowable values: [new,overwrite]

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Account ID for which billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • Frequency of taking the snapshot of the billing reports.

    Allowable values: [daily]

    Examples:
    value
    _source
    _lines
    _html
  • The name of the COS bucket to store the snapshot of the billing reports.

    Examples:
    value
    _source
    _lines
    _html
  • Region of the COS instance.

    Examples:
    value
    _source
    _lines
    _html
  • The billing reports root folder to store the billing reports snapshots.

    Examples:
    value
    _source
    _lines
    _html
  • The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].

    Allowable values: [account_summary,enterprise_summary,account_resource_instance_usage]

    Examples:
    value
    _source
    _lines
    _html
  • A new version of report is created or the existing report version is overwritten with every update.

    Allowable values: [new,overwrite]

    Examples:
    value
    _source
    _lines
    _html
  • curl -X PATCH --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "account_id": "accountId" }'   "{base_url}/v1/billing-reports-snapshot-config"
  • updateReportsSnapshotConfigOptions := usageReportsService.NewUpdateReportsSnapshotConfigOptions(
      "accountId",
    )
    
    snapshotConfig, response, err := usageReportsService.UpdateReportsSnapshotConfig(updateReportsSnapshotConfigOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(snapshotConfig, "", "  ")
    fmt.Println(string(b))
  • UpdateReportsSnapshotConfigOptions updateReportsSnapshotConfigOptions = new UpdateReportsSnapshotConfigOptions.Builder()
      .accountId("accountId")
      .build();
    
    Response<SnapshotConfig> response = usageReportsService.updateReportsSnapshotConfig(updateReportsSnapshotConfigOptions).execute();
    SnapshotConfig snapshotConfig = response.getResult();
    
    System.out.println(snapshotConfig);
  • const params = {
      accountId: 'accountId',
    };
    
    let res;
    try {
      res = await usageReportsService.updateReportsSnapshotConfig(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = usage_reports_service.update_reports_snapshot_config(
      account_id='accountId',
    )
    snapshot_config = response.get_result()
    
    print(json.dumps(snapshot_config, indent=2))

Response

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Billing reports snapshot configuration.

Status Code

  • Indicates that the billing reports snapshot for the respective account is successfully updated with the submitted payload.

  • Bad request

  • Unauthenticated

  • Unauthorized

  • Not found

  • Conflict

  • Dependency failure

  • Internal Server Error

  • Service Unavailable

Example responses
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "state": "enabled",
      "account_type": "account",
      "interval": "daily",
      "versioning": "new",
      "report_types": [
        "account_summary",
        "account_resource_instance_usage"
      ],
      "compression": "GZIP",
      "content_type": "text/csv",
      "cos_reports_folder": "standalone account",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
      "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud",
      "created_at": 1687469854342,
      "last_updated_at": 1687469989326,
      "history": [
        {
          "start_time": 1687469854342,
          "end_time": 1687469989326,
          "updated_by": "IBMid-506PR16K14",
          "account_id": "272b9a4f73e11030d0ba037daee47a35",
          "state": "enabled",
          "account_type": "account",
          "interval": "daily",
          "versioning": "overwrite",
          "report_types": [
            "account_summary",
            "account_resource_instance_usage"
          ],
          "compression": "GZIP",
          "content_type": "text/csv",
          "cos_reports_folder": "june",
          "cos_bucket": "yue-bucket-us-south",
          "cos_location": "us-south",
          "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud"
        }
      ]
    }
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "state": "enabled",
      "account_type": "account",
      "interval": "daily",
      "versioning": "new",
      "report_types": [
        "account_summary",
        "account_resource_instance_usage"
      ],
      "compression": "GZIP",
      "content_type": "text/csv",
      "cos_reports_folder": "standalone account",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
      "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud",
      "created_at": 1687469854342,
      "last_updated_at": 1687469989326,
      "history": [
        {
          "start_time": 1687469854342,
          "end_time": 1687469989326,
          "updated_by": "IBMid-506PR16K14",
          "account_id": "272b9a4f73e11030d0ba037daee47a35",
          "state": "enabled",
          "account_type": "account",
          "interval": "daily",
          "versioning": "overwrite",
          "report_types": [
            "account_summary",
            "account_resource_instance_usage"
          ],
          "compression": "GZIP",
          "content_type": "text/csv",
          "cos_reports_folder": "june",
          "cos_bucket": "yue-bucket-us-south",
          "cos_location": "us-south",
          "cos_endpoint": "https://s3.us-west.cloud-object-storage.test.appdomain.cloud"
        }
      ]
    }

Delete the snapshot configuration

Delete the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Delete the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Delete the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Delete the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

Delete the configuration of snapshot of the billing reports setup by the customer for the given Account Id.

DELETE /v1/billing-reports-snapshot-config
(usageReports *UsageReportsV4) DeleteReportsSnapshotConfig(deleteReportsSnapshotConfigOptions *DeleteReportsSnapshotConfigOptions) (response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) DeleteReportsSnapshotConfigWithContext(ctx context.Context, deleteReportsSnapshotConfigOptions *DeleteReportsSnapshotConfigOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deleteReportsSnapshotConfig(DeleteReportsSnapshotConfigOptions deleteReportsSnapshotConfigOptions)
deleteReportsSnapshotConfig(params)
delete_reports_snapshot_config(
        self,
        account_id: str,
        **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 > User > Access.

  • billing.billing-reports-snapshot-config.delete

Request

Instantiate the DeleteReportsSnapshotConfigOptions struct and set the fields to provide parameter values for the DeleteReportsSnapshotConfig method.

Use the DeleteReportsSnapshotConfigOptions.Builder to create a DeleteReportsSnapshotConfigOptions object that contains the parameter values for the deleteReportsSnapshotConfig method.

Query Parameters

  • Account ID for which the billing report snapshot is configured.

    Example: abc

WithContext method only

The DeleteReportsSnapshotConfig options.

The deleteReportsSnapshotConfig options.

parameters

  • Account ID for which the billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Account ID for which the billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • curl -X DELETE --location --header "Authorization: Bearer {iam_token}"   "{base_url}/v1/billing-reports-snapshot-config?account_id=accountId"
  • deleteReportsSnapshotConfigOptions := usageReportsService.NewDeleteReportsSnapshotConfigOptions(
      "accountId",
    )
    
    response, err := usageReportsService.DeleteReportsSnapshotConfig(deleteReportsSnapshotConfigOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteReportsSnapshotConfig(): %d\n", response.StatusCode)
    }
  • DeleteReportsSnapshotConfigOptions deleteReportsSnapshotConfigOptions = new DeleteReportsSnapshotConfigOptions.Builder()
      .accountId("accountId")
      .build();
    
    Response<Void> response = usageReportsService.deleteReportsSnapshotConfig(deleteReportsSnapshotConfigOptions).execute();
  • const params = {
      accountId: 'accountId',
    };
    
    try {
      await usageReportsService.deleteReportsSnapshotConfig(params);
    } catch (err) {
      console.warn(err);
    }
  • response = usage_reports_service.delete_reports_snapshot_config(
      account_id='accountId',
    )

Response

Status Code

  • Snapshot configuration was deleted successfully.

  • Bad request

  • Unauthenticated

  • Unauthorized

  • Not found

  • Internal Server Error

  • Service Unavailable

No Sample Response

This method does not specify any sample responses.

Verify billing to COS authorization

Verify billing service to COS bucket authorization for the given account_id. If COS bucket information is not provided, COS bucket information is retrieved from the configuration file.

Verify billing service to COS bucket authorization for the given account_id. If COS bucket information is not provided, COS bucket information is retrieved from the configuration file.

Verify billing service to COS bucket authorization for the given account_id. If COS bucket information is not provided, COS bucket information is retrieved from the configuration file.

Verify billing service to COS bucket authorization for the given account_id. If COS bucket information is not provided, COS bucket information is retrieved from the configuration file.

Verify billing service to COS bucket authorization for the given account_id. If COS bucket information is not provided, COS bucket information is retrieved from the configuration file.

POST /v1/billing-reports-snapshot-config/validate
(usageReports *UsageReportsV4) ValidateReportsSnapshotConfig(validateReportsSnapshotConfigOptions *ValidateReportsSnapshotConfigOptions) (result *SnapshotConfigValidateResponse, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) ValidateReportsSnapshotConfigWithContext(ctx context.Context, validateReportsSnapshotConfigOptions *ValidateReportsSnapshotConfigOptions) (result *SnapshotConfigValidateResponse, response *core.DetailedResponse, err error)
ServiceCall<SnapshotConfigValidateResponse> validateReportsSnapshotConfig(ValidateReportsSnapshotConfigOptions validateReportsSnapshotConfigOptions)
validateReportsSnapshotConfig(params)
validate_reports_snapshot_config(
        self,
        account_id: str,
        *,
        interval: str = None,
        cos_bucket: str = None,
        cos_location: str = None,
        cos_reports_folder: str = None,
        report_types: List[str] = None,
        versioning: 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 > User > Access.

  • billing.billing-reports-snapshot-config.create

Request

Instantiate the ValidateReportsSnapshotConfigOptions struct and set the fields to provide parameter values for the ValidateReportsSnapshotConfig method.

Use the ValidateReportsSnapshotConfigOptions.Builder to create a ValidateReportsSnapshotConfigOptions object that contains the parameter values for the validateReportsSnapshotConfig method.

Request payload to verify s2s authorization.

WithContext method only

The ValidateReportsSnapshotConfig options.

The validateReportsSnapshotConfig options.

parameters

  • Account ID for which billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • Frequency of taking the snapshot of the billing reports.

    Allowable values: [daily]

    Examples:
    value
    _source
    _lines
    _html
  • The name of the COS bucket to store the snapshot of the billing reports.

    Examples:
    value
    _source
    _lines
    _html
  • Region of the COS instance.

    Examples:
    value
    _source
    _lines
    _html
  • The billing reports root folder to store the billing reports snapshots. Defaults to "IBMCloud-Billing-Reports".

    Examples:
    value
    _source
    _lines
    _html
  • The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].

    Allowable values: [account_summary,enterprise_summary,account_resource_instance_usage]

    Examples:
    value
    _source
    _lines
    _html
  • A new version of report is created or the existing report version is overwritten with every update. Defaults to "new".

    Allowable values: [new,overwrite]

    Examples:
    value
    _source
    _lines
    _html

parameters

  • Account ID for which billing report snapshot is configured.

    Examples:
    value
    _source
    _lines
    _html
  • Frequency of taking the snapshot of the billing reports.

    Allowable values: [daily]

    Examples:
    value
    _source
    _lines
    _html
  • The name of the COS bucket to store the snapshot of the billing reports.

    Examples:
    value
    _source
    _lines
    _html
  • Region of the COS instance.

    Examples:
    value
    _source
    _lines
    _html
  • The billing reports root folder to store the billing reports snapshots. Defaults to "IBMCloud-Billing-Reports".

    Examples:
    value
    _source
    _lines
    _html
  • The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, account_resource_instance_usage].

    Allowable values: [account_summary,enterprise_summary,account_resource_instance_usage]

    Examples:
    value
    _source
    _lines
    _html
  • A new version of report is created or the existing report version is overwritten with every update. Defaults to "new".

    Allowable values: [new,overwrite]

    Examples:
    value
    _source
    _lines
    _html
  • curl -X POST --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data '{ "account_id": "accountId" }'   "{base_url}/v1/billing-reports-snapshot-config/validate"
  • validateReportsSnapshotConfigOptions := usageReportsService.NewValidateReportsSnapshotConfigOptions(
      "accountId",
    )
    
    snapshotConfigValidateResponse, response, err := usageReportsService.ValidateReportsSnapshotConfig(validateReportsSnapshotConfigOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(snapshotConfigValidateResponse, "", "  ")
    fmt.Println(string(b))
  • ValidateReportsSnapshotConfigOptions validateReportsSnapshotConfigOptions = new ValidateReportsSnapshotConfigOptions.Builder()
      .accountId("accountId")
      .build();
    
    Response<SnapshotConfigValidateResponse> response = usageReportsService.validateReportsSnapshotConfig(validateReportsSnapshotConfigOptions).execute();
    SnapshotConfigValidateResponse snapshotConfigValidateResponse = response.getResult();
    
    System.out.println(snapshotConfigValidateResponse);
  • const params = {
      accountId: 'accountId',
    };
    
    let res;
    try {
      res = await usageReportsService.validateReportsSnapshotConfig(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • response = usage_reports_service.validate_reports_snapshot_config(
      account_id='accountId',
    )
    snapshot_config_validate_response = response.get_result()
    
    print(json.dumps(snapshot_config_validate_response, indent=2))

Response

Validated billing service to COS bucket authorization.

Validated billing service to COS bucket authorization.

Validated billing service to COS bucket authorization.

Validated billing service to COS bucket authorization.

Validated billing service to COS bucket authorization.

Status Code

  • Indicates that authorization exists between the billing service and the COS service for the given configuration.

  • Bad request

  • Unauthenticated

  • Unauthorized

  • Not found

  • Dependency failure

  • Internal Server Error

  • Service Unavailable

Example responses
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
    }
  • {
      "account_id": "272b9a4f73e11030d0ba037daee47a35",
      "cos_bucket": "yue-bucket-us-south",
      "cos_location": "us-south",
    }

Fetch the current or past snapshots

Returns the billing reports snapshots captured for the given Account Id in the specific time period.

Returns the billing reports snapshots captured for the given Account Id in the specific time period.

Returns the billing reports snapshots captured for the given Account Id in the specific time period.

Returns the billing reports snapshots captured for the given Account Id in the specific time period.

Returns the billing reports snapshots captured for the given Account Id in the specific time period.

GET /v1/billing-reports-snapshots
(usageReports *UsageReportsV4) GetReportsSnapshot(getReportsSnapshotOptions *GetReportsSnapshotOptions) (result *SnapshotList, response *core.DetailedResponse, err error)
(usageReports *UsageReportsV4) GetReportsSnapshotWithContext(ctx context.Context, getReportsSnapshotOptions *GetReportsSnapshotOptions) (result *SnapshotList, response *core.DetailedResponse, err error)
ServiceCall<SnapshotList> getReportsSnapshot(GetReportsSnapshotOptions getReportsSnapshotOptions)
getReportsSnapshot(params)
get_reports_snapshot(
        self,
        account_id: str,
        month: str,
        *,
        date_from: int = None,
        date_to: int = None,
        limit: int = None,
        start: 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 > User > Access.

  • billing.billing-reports-snapshot.read

Request

Instantiate the GetReportsSnapshotOptions struct and set the fields to provide parameter values for the GetReportsSnapshot method.

Use the GetReportsSnapshotOptions.Builder to create a GetReportsSnapshotOptions object that contains the parameter values for the getReportsSnapshot method.

Query Parameters

  • Account ID for which the billing report snapshot is requested.

    Example: abc

  • The month for which billing report snapshot is requested. Format is yyyy-mm.

    Example: 2023-02

  • Timestamp in milliseconds for which billing report snapshot is requested.

    Example: 1675209600000

  • Timestamp in milliseconds for which billing report snapshot is requested.

    Example: 1675987200000

  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

WithContext method only

The GetReportsSnapshot options.

The getReportsSnapshot options.

parameters

  • Account ID for which the billing report snapshot is requested.

    Examples:
    value
    _source
    _lines
    _html
  • The month for which billing report snapshot is requested. Format is yyyy-mm.

    Examples:
    value
    _source
    _lines
    _html
  • Timestamp in milliseconds for which billing report snapshot is requested.

    Examples:
    value
    _source
    _lines
    _html
  • Timestamp in milliseconds for which billing report snapshot is requested.

    Examples:
    value
    _source
    _lines
    _html
  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

parameters

  • Account ID for which the billing report snapshot is requested.

    Examples:
    value
    _source
    _lines
    _html
  • The month for which billing report snapshot is requested. Format is yyyy-mm.

    Examples:
    value
    _source
    _lines
    _html
  • Timestamp in milliseconds for which billing report snapshot is requested.

    Examples:
    value
    _source
    _lines
    _html
  • Timestamp in milliseconds for which billing report snapshot is requested.

    Examples:
    value
    _source
    _lines
    _html
  • Number of usage records returned. The default value is 30. Maximum value is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 30

  • The offset from which the records must be fetched. Offset information is included in the response.

  • curl -X GET --location --header "Authorization: Bearer {iam_token}"   --header "Accept: application/json"   "{base_url}/v1/billing-reports-snapshots?account_id=accountId&month=2023-02&date_from=1675209600000&date_to=1675987200000"
  • getReportsSnapshotOptions := &usagereportsv4.GetReportsSnapshotOptions{
      AccountID: core.StringPtr("accountId"),
      Month: core.StringPtr("2023-02"),
      DateFrom: core.Int64Ptr(int64(1675209600000)),
      DateTo: core.Int64Ptr(int64(1675987200000)),
      Limit: core.Int64Ptr(int64(30)),
    }
    
    pager, err := usageReportsService.NewGetReportsSnapshotPager(getReportsSnapshotOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []usagereportsv4.SnapshotListSnapshotsItem
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • GetReportsSnapshotOptions getReportsSnapshotOptions = new GetReportsSnapshotOptions.Builder()
      .accountId("accountId")
      .month("2023-02")
      .dateFrom(Long.valueOf("1675209600000"))
      .dateTo(Long.valueOf("1675987200000"))
      .limit(Long.valueOf("30"))
      .build();
    
    GetReportsSnapshotPager pager = new GetReportsSnapshotPager(usageReportsService, getReportsSnapshotOptions);
    List<SnapshotListSnapshotsItem> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<SnapshotListSnapshotsItem> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      accountId: 'accountId',
      month: '2023-02',
      dateFrom: 1675209600000,
      dateTo: 1675987200000,
      limit: 30,
    };
    
    const allResults = [];
    try {
      const pager = new UsageReportsV4.GetReportsSnapshotPager(usageReportsService, params);
      while (pager.hasNext()) {
        const nextPage = await pager.getNext();
        expect(nextPage).not.toBeNull();
        allResults.push(...nextPage);
      }
      console.log(JSON.stringify(allResults, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • all_results = []
    pager = GetReportsSnapshotPager(
      client=usage_reports_service,
      account_id='accountId',
      month='2023-02',
      date_from=1675209600000,
      date_to=1675987200000,
      limit=30,
    )
    while pager.has_next():
      next_page = pager.get_next()
      assert next_page is not None
      all_results.extend(next_page)
    
    print(json.dumps(all_results, indent=2))

Response

List of billing reports snapshots.

List of billing reports snapshots.

List of billing reports snapshots.

List of billing reports snapshots.

List of billing reports snapshots.

Status Code

  • List of snapshots were returned successfully.

  • Bad request

  • Unauthenticated

  • Unauthorized

  • Internal Server Error

  • Service Unavailable

Example responses
  • {
      "count": 3,
      "first": {
        "href": "/v1/billing-reports-snapshots?_limit=10&account_id=272b9a4f73e11030d0ba037daee47a35&date_from=-Infinity&date_to=Infinity&month=2023-06"
      },
      "snapshots": [
        {
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "month": "2023-06",
            "account_type": "account",
            "expected_processed_at": 1687556848297,
            "state": "pending",
            "billing_period": {
                "start": "2023-06-01T00:00:00.000Z",
                "end": "2023-06-30T23:59:59.999Z"
            }
        },
        {
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "month": "2023-06",
            "account_type": "account",
            "expected_processed_at": 1687470383610,
            "state": "completed",
            "billing_period": {
                "start": "2023-06-01T00:00:00.000Z",
                "end": "2023-06-30T23:59:59.999Z"
            },
            "snapshot_id": "1685577600000",
            "charset": "UTF-8",
            "compression": "GZIP",
            "content_type": "text/csv",
            "bucket": "yue-bucket-us-south",
            "version": "1.0",
            "created_on": "2023-06-22T21:47:28.297Z",
            "report_types": [
                {
                    "type": "account_summary",
                    "version": "1.0"
                },
                {
                    "type": "account_resource_instance_usage",
                    "version": "1.0"
                }
            ],
            "files": [
                {
                    "report_type": "account_summary",
                    "location": "june/2023-06/1685577600000/2023-06-account-summary-272b9a4f73e11030d0ba037daee47a35.csv.gz",
                    "account_id": "272b9a4f73e11030d0ba037daee47a35"
                },
                {
                    "report_type": "account_resource_instance_usage",
                    "location": "june/2023-06/1685577600000/2023-06-resource-instances-usage-272b9a4f73e11030d0ba037daee47a35.csv.gz",
                    "account_id": "272b9a4f73e11030d0ba037daee47a35"
                }
            ],
            "processed_at": 1687470448297
        },
        {
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "month": "2023-06",
            "account_type": "account",
            "expected_processed_at": 1687469854342,
            "state": "disabled",
            "billing_period": {
                "start": "2023-06-01T00:00:00.000Z",
                "end": "2023-06-30T23:59:59.999Z"
            },
            "processed_at": 1687470202011
        }
      ]
    }
  • {
      "count": 3,
      "first": {
        "href": "/v1/billing-reports-snapshots?_limit=10&account_id=272b9a4f73e11030d0ba037daee47a35&date_from=-Infinity&date_to=Infinity&month=2023-06"
      },
      "snapshots": [
        {
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "month": "2023-06",
            "account_type": "account",
            "expected_processed_at": 1687556848297,
            "state": "pending",
            "billing_period": {
                "start": "2023-06-01T00:00:00.000Z",
                "end": "2023-06-30T23:59:59.999Z"
            }
        },
        {
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "month": "2023-06",
            "account_type": "account",
            "expected_processed_at": 1687470383610,
            "state": "completed",
            "billing_period": {
                "start": "2023-06-01T00:00:00.000Z",
                "end": "2023-06-30T23:59:59.999Z"
            },
            "snapshot_id": "1685577600000",
            "charset": "UTF-8",
            "compression": "GZIP",
            "content_type": "text/csv",
            "bucket": "yue-bucket-us-south",
            "version": "1.0",
            "created_on": "2023-06-22T21:47:28.297Z",
            "report_types": [
                {
                    "type": "account_summary",
                    "version": "1.0"
                },
                {
                    "type": "account_resource_instance_usage",
                    "version": "1.0"
                }
            ],
            "files": [
                {
                    "report_type": "account_summary",
                    "location": "june/2023-06/1685577600000/2023-06-account-summary-272b9a4f73e11030d0ba037daee47a35.csv.gz",
                    "account_id": "272b9a4f73e11030d0ba037daee47a35"
                },
                {
                    "report_type": "account_resource_instance_usage",
                    "location": "june/2023-06/1685577600000/2023-06-resource-instances-usage-272b9a4f73e11030d0ba037daee47a35.csv.gz",
                    "account_id": "272b9a4f73e11030d0ba037daee47a35"
                }
            ],
            "processed_at": 1687470448297
        },
        {
            "account_id": "272b9a4f73e11030d0ba037daee47a35",
            "month": "2023-06",
            "account_type": "account",
            "expected_processed_at": 1687469854342,
            "state": "disabled",
            "billing_period": {
                "start": "2023-06-01T00:00:00.000Z",
                "end": "2023-06-30T23:59:59.999Z"
            },
            "processed_at": 1687470202011
        }
      ]
    }