Introduction

IBM Cloud Usage Reports returns the summary for the account for a given month. Account billing managers are authorized to access this report.

Error handling

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

Methods

Account Summary

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}
Request

Custom Headers

  • IAM token

Path Parameters

  • Account ID for which the summary is requested

  • Billing month for which the summary is requested. Format is in yyyy-mm

    Constraints: Value must match regular expression ^\d{4}\-(0?[1-9]|1[012])$

Response

Status Code

  • Account Summary

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses

Account Usage

Usage for all the resources and plans in an account in a given month. Account billing managers are authorized to access this report.

GET /v4/accounts/{account_id}/usage/{billingmonth}
Request

Custom Headers

  • IAM token

Path Parameters

  • Account ID for which the usage is requested

  • Month for which the usage is requested

    Constraints: Value must match regular expression ^\d{4}\-(0?[1-9]|1[012])$

Response

Aggregated usage and charges for all the plans in the account

Status Code

  • Status 200

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses

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.

GET /v4/accounts/{account_id}/resource_groups/{resource_group_id}/usage/{billingmonth}
Request

Custom Headers

  • IAM token

Path Parameters

  • Account ID containing the resource group

  • Resource group for which the usage is requested

  • Month for which the usage is requested

    Constraints: Value must match regular expression ^\d{4}\-(0?[1-9]|1[012])$

Response

Aggregated usage and charges for all the plans in the resource group

Status Code

  • Status 200

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses

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.

GET /v4/accounts/{account_id}/organizations/{organization_id}/usage/{billingmonth}
Request

Custom Headers

  • IAM token

Path Parameters

  • ID of the account containing the organization

  • ID of the organization

  • Month for which the usage is requested

    Constraints: Value must match regular expression ^\d{4}\-(0?[1-9]|1[012])$

Response

Aggregated usage and charges for all the plans in the org

Status Code

  • Status 200

  • Unauthenticated

  • Unauthorized

  • Unexpected errors

Example responses

Resource Instances Usage in an account

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

GET /v4/accounts/{account_id}/resource_instances/usage/{billingmonth}
Request

Custom Headers

  • IAM token

Path Parameters

  • Account ID to which the resource instances belong to

  • Month for which the usage is requested

    Constraints: Value must match regular expression ^\d{4}\-(0?[1-9]|1[012])$

Query Parameters

  • Number of usage records returned. The default value is 10. Maximum value is 20.

    Constraints: 1 ≤ value ≤ 20

    Default: 10

  • 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

Response

List of instnace usage reports

Status Code

  • Status 200

  • Status 400

  • Status 401

  • Status 500

Example responses

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.

GET /v4/accounts/{account_id}/resource_groups/{resource_group_id}/resource_instances/usage/{billingmonth}
Request

Custom Headers

  • IAM token

Path Parameters

  • ID of the account in which the resource group is present

  • ID of the resource group

  • Month for which the usage is requested

    Constraints: Value must match regular expression ^\d{4}\-(0?[1-9]|1[012])$

Query Parameters

  • Number of usage records returned. The default value is 10. Maximum value is 20.

    Constraints: 1 ≤ value ≤ 20

    Default: 10

  • 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

Response

List of instnace usage reports

Status Code

  • Status 200

  • Status 400

  • Status 401

  • Status 500

Example responses

Usage for resource instances 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.

GET /v4/accounts/{account_id}/organizations/{organization_id}/resource_instances/usage/{billingmonth}
Request

Custom Headers

  • IAM token

Path Parameters

  • ID of the account under which the organization is present

  • ID of the organization

  • Month for which the usage is requested

    Constraints: Value must match regular expression ^\d{4}\-(0?[1-9]|1[012])$

Query Parameters

  • Number of usage records returned. The default value is 10. Maximum value is 20.

    Constraints: 1 ≤ value ≤ 20

    Default: 10

  • 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

Response

List of instnace usage reports

Status Code

  • Status 200

  • Status 400

  • Status 401

  • Status 500

Example responses