Queries the usage summary of savings plans.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeSavingsPlansUsageTotal

The operation that you want to perform. Set the value to DescribeSavingsPlansUsageTotal.

PeriodType String Yes HOUR

The time granularity at which usage summary are queried. Valid values: MONTH, DAY, and HOUR.

StartPeriod String Yes 2021-01-01 00:00:00

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

EndPeriod String No 2021-01-02 00:00:00

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

BillOwnerId Long No 123745698925000

The ID of the account for which you want to query usage summary. If you do not set this parameter, the data of the current Alibaba Cloud account and its RAM users is queried. To query the data of a RAM user, specify the ID of the RAM user.

Response parameters

Parameter Type Example Description
Code String Success

The status code.

Data Struct

The return data.

PeriodCoverage Array of Item

The usage in different periods.

Percentage Float 1

The usage.

Period String 2021041500

The period.

The value is in the format of yyyyMMddHH.

TotalUsage Struct

The usage summary.

PoolValue Float 100

The total amount of the savings plan.

PostpaidCost Float 200

The pay-as-you-go cost.

SavedCost Float 100

The amount that is saved.

UsagePercentage Float 1

The total usage.

Message String Successful!

The message returned.

RequestId String 79EE7556-0CFD-44EB-9CD6-B3B526E3A85F

The ID of the request.

Success Boolean true

Indicates whether the operation was successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeSavingsPlansUsageTotal
&PeriodType=HOUR
&StartPeriod=2021-01-01 00:00:00
&<Common request parameters>

Sample success responses

JSON format

{"Message":"Successful!","RequestId":"79EE7556-0CFD-44EB-9CD6-B3B526E3A85F","Data":{"PeriodCoverage":[{"Percentage":"1","Period":"2021041500"}],"TotalUsage":{"PostpaidCost":"200","SavedCost":"100","PoolValue":"100","UsagePercentage":"1"}},"Code":"Success","Success":"true"}

Error codes

For a list of error codes, visit the API Error Center.