Queries the deduction details 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 QuerySavingsPlansDeductLog

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

StartTime String No 2020-01-01 00:00:00

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

EndTime String No 2020-01-01 01:00:00

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

InstanceType String No spn

The type of the instance ID based on which the data is queried. Valid values:

  • spn: queries data based on the ID of the savings plan instance.
  • product: queries data based on the ID of the cloud service instance.
InstanceId String No spn-xxxxxxxxxxx

The ID of the instance.

Locale String No ZH

The language of the return data. Valid values:

  • ZH: Chinese
  • EN: English
PageNum Integer No 1

The number of the page to return.

PageSize Integer No 20

The number of entries to return on each page.

Response parameters

Parameter Type Example Description
Code String Success

The error code.

Data Struct

The return data.

Items Array of SavingsPlansDeductDetailResponse

The deduction details.

BillModule String Cloud server configuration

The billable item for which the fee is deducted.

DeductCommodity String Elastic Compute Service (ECS) - Pay-as-you-go

The service for which the fee is deducted.

DeductFee String 0.52

The deducted amount.

DeductInstanceId String i-XXXXXXXXX

The ID of the instance for which the fee is deducted.

DeductRate String 1.0

The deduction rate.

DiscountRate String 0.069

The discount used for the current deduction.

EndTime String 2020-12-01 01:00:00

The end of the billing cycle for which the fee is deducted.

InstanceId String spn-xxxxxxx

The ID of the savings plan instance.

SavingsType String ecs

The type of the savings plan. Valid values:

  • universal: general-purpose
  • ecs: ECS compute
StartTime String 2020-12-01 00:00:00

The beginning of the billing cycle for which the fee is deducted. The time is in the format of yyyy-MM-dd HH:mm:ss.

UserId Long 10000

The ID of the user.

PageNum Integer 1

The page number of the returned page.

PageSize Integer 20

The number of entries returned per page.

TotalCount Integer 20

The total number of entries.

Message String Successful

The message returned.

RequestId String 61293E7A-3406-4447-8620-EC88B0AA66AD

The ID of the request.

Success Boolean true

Indicates whether the operation was successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=QuerySavingsPlansDeductLog
&<Common request parameters>

Sample success responses

XML format

<Message>Successful</Message>
<RequestId>61293E7A-3406-4447-8620-EC88B0AA66AD</RequestId>
<Data>
    <TotalCount>20</TotalCount>
    <PageSize>20</PageSize>
    <PageNum>1</PageNum>
    <Items>
        <DeductFee>0.52</DeductFee>
        <BillModule>Cloud server configuration</BillModule>
        <DeductCommodity>Elastic Compute Service (ECS) - Pay-as-you-go</DeductCommodity>
        <EndTime>2020-12-01 01:00:00</EndTime>
        <InstanceId>spn-xxxxxxx</InstanceId>
        <UserId>10000</UserId>
        <StartTime>2020-12-01 00:00:00</StartTime>
        <DeductRate>1.0</DeductRate>
        <DiscountRate>0.069</DiscountRate>
        <DeductInstanceId>i-XXXXXXXXX</DeductInstanceId>
        <SavingsType>ecs</SavingsType>
    </Items>
</Data>
<Code>Success</Code>
<Success>true</Success>

JSON format

{"Message":"Successful","RequestId":"61293E7A-3406-4447-8620-EC88B0AA66AD","Data":{"TotalCount":"20","PageSize":"20","PageNum":"1","Items":[{"DeductFee":"0.52","BillModule":"Cloud server configuration","DeductCommodity":"Elastic Compute Service (ECS) - Pay-as-you-go","EndTime":"2020-12-01 01:00:00","InstanceId":"spn-xxxxxxx","UserId":"10000","StartTime":"2020-12-01 00:00:00","DeductRate":"1.0","DiscountRate":"0.069","DeductInstanceId":"i-XXXXXXXXX","SavingsType":"ecs"}]},"Code":"Success","Success":"true"}

Error codes

HTTP status code Error code Error message Description
500 InternalError An error occurred in the internal server. The error message returned because an internal server error has occurred.
400 InvalidOwner The specified owner does not belong to caller. The error message returned because the specified owner does not belong to the caller.
400 InvalidParameter The specified request contains invalid parameters. The error message returned because the request contains invalid parameters.
400 MissingParameter The specified request lacks essential parameters. The error message returned because the request lacks essential parameters.
400 NotApplicable The specified API is not applicable for the user. The error message returned because the API operation is not applicable to the caller.
400 NotApplicable You are not authorized to call the API operation. Please check whether the caller site matches the API domain regionId. The error message returned because you are not authorized to call the API operation. Check whether the region information of the caller site matches the API endpoint.
400 NotAuthorized The user is not authorized for the specified API. The error message returned because you are not authorized to call the API operation.
400 NotAuthorized You are not authorized to call the API operation. Please check whether RAM user has the permission or check whether ownerId and callerId have been given the appropriate permission. The error message returned because you are not authorized to call the API operation. If you are using a RAM user, check whether the corresponding permissions are granted to the RAM user. Otherwise, check whether the corresponding permissions are granted to the specified owner and caller.

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