Queries the information about savings plan instances of the current user.

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 QuerySavingsPlansInstance

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

EndTime String No 2021-01-01 00:00:00

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

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.

PageNum Integer No 1

The number of the page to return.

PageSize Integer No 20

The number of entries to return on each page.

InstanceId String No spn-xxxxxxx

The ID of the savings plan instance.

Locale String No ZH

The language of the return data. Valid values:

  • ZH: Chinese
  • EN: English
Tag.N.Key String No test

The key of the tag to query.

Tag.N.Value String No test

The value of the tag to query.

Response parameters

Parameter Type Example Description
Code String Success

The error code.

Data Struct

The return data.

Items Array of SavingsPlansDetailResponse

The details about the instances.

AllocationStatus String unallocated

The allocation status. Valid values:

  • unallocated
  • allocated
  • beAllocated
Currency String CNY

The currency. Valid values: CNY and USD.

EndTime String 2021-01-01 00:00:00

The time when the instance expires. The time is in the format of yyyy-MM-dd HH:mm:ss.

InstanceFamily String ecs.g6

The instance family information. For an instance of the Elastic Compute Service (ECS) compute type, the value indicates the ECS instance family or the ECS instance family package.

InstanceId String spn-xxxxxxxx

The ID of the savings plan instance.

PayMode String total

The payment type. Valid values:

  • total: All Upfront
  • half: Partial Upfront
  • zero: No Upfront
PoolValue String 1.00

The commitment.

PrepayFee String 8760.00

The prepaid amount.

Region String cn-zhangjiakou-na62-a01

The region.

SavingsType String ECS

The type of the savings plan. Valid values:

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

The time when the instance takes effect. The time is in the format of yyyy-MM-dd HH:mm:ss.

Status String NORMAL

The status of the instance. Valid values:

  • NORMAL: normal
  • LIMIT: stopped due to overdue payment
  • RELEASE: released
Tags Array of Tag

The details about the tags.

Key String Tag1

The key of the tag.

Value String Tag1

The value of the tag.

TotalSave String 20.00

The total amount that is saved.

Utilization String 1.0

The total usage.

PageNum Integer 1

The page number of the returned page.

PageSize Integer 20

The number of entries returned per page.

TotalCount Integer 100

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=QuerySavingsPlansInstance
&<Common request parameters>

Sample success responses

XML format

<Message>Successful</Message>
<RequestId>61293E7A-3406-4447-8620-EC88B0AA66AD</RequestId>
<Data>
    <TotalCount>100</TotalCount>
    <PageSize>20</PageSize>
    <PageNum>1</PageNum>
    <Items>
        <Status>NORMAL</Status>
        <AllocationStatus>unallocated</AllocationStatus>
        <EndTime>2021-01-01 00:00:00</EndTime>
        <InstanceFamily>ecs.g6</InstanceFamily>
        <InstanceId>spn-xxxxxxxx</InstanceId>
        <StartTime>2020-01-01 00:00:00</StartTime>
        <TotalSave>20.00</TotalSave>
        <PrepayFee>8760.00</PrepayFee>
        <PayMode>total</PayMode>
        <Utilization>1.0</Utilization>
        <Currency>CNY</Currency>
        <PoolValue>1.00</PoolValue>
        <Region>cn-zhangjiakou-na62-a01</Region>
        <SavingsType>ECS</SavingsType>
        <Tags>
            <Value>Tag1</Value>
            <Key>Tag1</Key>
        </Tags>
    </Items>
</Data>
<Code>Success</Code>
<Success>true</Success>

JSON format

{"Message":"Successful","RequestId":"61293E7A-3406-4447-8620-EC88B0AA66AD","Data":{"TotalCount":"100","PageSize":"20","PageNum":"1","Items":[{"Status":"NORMAL","AllocationStatus":"unallocated","EndTime":"2021-01-01 00:00:00","InstanceFamily":"ecs.g6","InstanceId":"spn-xxxxxxxx","StartTime":"2020-01-01 00:00:00","TotalSave":"20.00","PrepayFee":"8760.00","PayMode":"total","Utilization":"1.0","Currency":"CNY","PoolValue":"1.00","Region":"cn-zhangjiakou-na62-a01","SavingsType":"ECS","Tags":[{"Value":"Tag1","Key":"Tag1"}]}]},"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.