Queries the information about savings plan instances of the current user.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
bssapi:QuerySavingsPlansInstance | READ |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PageSize | integer | No | The number of entries to return on each page. | 20 |
Locale | string | No | The language of the return data. Valid values:
| ZH |
PageNum | integer | No | The number of the page to return. | 1 |
InstanceId | string | No | The ID of the savings plan instance. | spn-xxxxxxx |
StartTime | string | No | The beginning of the time range to query. Specify the time in the format of yyyy-MM-dd HH:mm:ss. | 2020-01-01 00:00:00 |
EndTime | string | No | The end of the time range to query. Specify the time in the format of yyyy-MM-dd HH:mm:ss. | 2021-01-01 00:00:00 |
Tag | object [] | No | The tags. | |
Key | string | No | The key of the tag to query. | ecs |
Value | string | No | The value of the tag to query. | 001 |
Status | string | No | The status of the Instance.
| NORMAL |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "Success",
"Message": "Successful",
"RequestId": "61293E7A-3406-4447-8620-EC88B0AA66AD",
"Success": true,
"Data": {
"PageNum": 1,
"PageSize": 20,
"TotalCount": 100,
"Items": [
{
"Status": "NORMAL",
"Cycle": "1:Year",
"StartTimestamp": 1663135741039,
"SavingsType": "ECS",
"Utilization": "1.0",
"PrepayFee": "8760.00",
"InstanceId": "spn-xxxxxxxx",
"Currency": "CNY",
"EndTimestamp": 1663135741039,
"EndTime": "2021-01-01 00:00:00",
"StartTime": "2020-01-01 00:00:00",
"AllocationStatus": "unallocated",
"InstanceFamily": "ecs.g6",
"Region": "cn-zhangjiakou-na62-a01",
"LastBillTotalUsage": "100.0",
"LastBillUtilization": "0.8",
"TotalSave": "20.00",
"PoolValue": "1.00",
"PayMode": "total",
"Tags": [
{
"Key": "",
"Value": ""
}
],
"DeductCycleType": "HOUR",
"RestPoolValue": "100.0",
"CommodityCode": "savingplan_common_public_cn",
"CurrentPoolValue": "100.0"
}
]
}
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidOwner | The specified owner does not belong to caller. |
400 | InvalidParameter | The specified request contains invalid parameters. |
400 | MissingParameter | The specified request lacks essential parameters. |
400 | NotApplicable | The specified API is not applicable for the user. |
400 | NotApplicable | You are not authorized to call the API operation. Please check whether the caller site matches the API domain regionId. |
400 | NotAuthorized | The user is not authorized for the specified API. |
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. |
500 | InternalError | An error occurred in the internal server. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2023-07-24 | The Error code has changed. The response structure of the API has changed | see changesets | ||||||||
| ||||||||||
2023-05-25 | The Error code has changed. The response structure of the API has changed | see changesets | ||||||||
| ||||||||||
2023-03-27 | The Error code has changed. The response structure of the API has changed | see changesets | ||||||||
| ||||||||||
2022-12-09 | The Error code has changed. The response structure of the API has changed | see changesets | ||||||||
|