All Products
Search
Document Center

BSS OpenAPI:DescribeResourceUsageTotal

Last Updated:Mar 01, 2024

Queries the total usage data of reserved instances or storage capacity units (SCUs).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
bssapi:DescribeResourceUsageTotalRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
StartPeriodstringYes

The beginning of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format. The specified time is included in the time range.

2021-01-01 00:00:00
EndPeriodstringNo

The end of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format. The specified time is excluded from the time range. If you do not specify this parameter, this parameter is set to the current time.

2021-01-02 00:00:00
PeriodTypestringYes

The time granularity at which the data is queried. Valid values: MONTH, DAY, and HOUR.

HOUR
BillOwnerIdlongNo

The ID of the account whose data you want to query. If you do not specify this parameter, the data of the current account and its linked accounts is queried. To query the data of a linked account, specify the ID of the linked account. You can specify only one account ID.

123745698925000
ResourceTypestringYes

The type of the resource plan. Valid values: RI and SCU.

RI

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

Codestring

The response code.

Success
Messagestring

The returned message. If the request was successful, a success message is returned. If the request failed, an error message is returned.

Successful!
RequestIdstring

The request ID.

364C7C81-5E5E-51A0-B738-1969D2671B05
Successboolean

Indicates whether the request was successful.

True
Dataobject

The queried data.

PeriodCoverageobject []

The usage of resource plans in the specified period.

UsagePercentagefloat

The usage of resource plans.

0.1
Periodstring

The period.

2021071500
TotalUsageobject

The total usage of resource plans.

PostpaidCostfloat

The total costs of pay-as-you-go instances.

200
SavedCostfloat

The total savings.

100
UsagePercentagefloat

The total usage of resource plans.

1
PotentialSavedCostfloat

The total potential savings.

100
ReservationCostfloat

The fee of purchased resource plans.

10

Examples

Sample success responses

JSONformat

{
  "Code": "Success",
  "Message": "Successful!",
  "RequestId": "364C7C81-5E5E-51A0-B738-1969D2671B05",
  "Success": true,
  "Data": {
    "PeriodCoverage": [
      {
        "UsagePercentage": 0.1,
        "Period": "2021071500"
      }
    ],
    "TotalUsage": {
      "PostpaidCost": 200,
      "SavedCost": 100,
      "UsagePercentage": 1,
      "PotentialSavedCost": 100,
      "ReservationCost": 10
    }
  }
}

Error codes

For a list of error codes, visit the Service error codes.