Queries information about your savings plan instances.
Try it now
Test
RAM authorization
Action | Access level | Resource type | Condition key | Dependent action |
bssapi:QuerySavingsPlansInstance | get | *All Resource
| None | None |
Request parameters
Parameter | Type | Required | Description | Example |
PageSize | integer | No | The number of entries per page. | 20 |
Locale | string | No | The language of the response.
| ZH |
PageNum | integer | No | The page number. | 1 |
InstanceId | string | No | The ID of the savings plan instance. | spn-xxxxxxx |
StartTime | string | No | The start time. The time is in the yyyy-MM-dd HH:mm:ss format. | 2020-01-01 00:00:00 |
EndTime | string | No | The end time. The time is in the yyyy-MM-dd HH:mm:ss format. | 2021-01-01 00:00:00 |
| Tag | array<object> | No | The list of tag elements. | |
object | No | The tag element. | ||
Key | string | No | The key of the tag. | ecs |
Value | string | No | The value of the tag. | 001 |
Status | string | No | The status of the instance. Valid values: NORMAL: The instance is active. RELEASE: The instance is released. | NORMAL |
CommodityCode | string | No | The commodity code. | savingplan_common_public_cn |
Response elements
Parameter | Type | Description | Example |
object | The returned object. | ||
Code | string | The error code. | Success |
Message | string | The error message. | Successful |
RequestId | string | The ID of the request. | 61293E7A-3406-4447-8620-EC88B0AA66AD |
Success | boolean | Indicates whether the request was successful. | true |
| Data | object | The returned data. | |
PageNum | integer | The page number of the returned page. | 1 |
PageSize | integer | The number of entries returned per page. | 20 |
TotalCount | integer | The total number of entries. | 100 |
| Items | array<object> | The list of instance information. | |
object | The instance information. | ||
Status | string | The current status.
| NORMAL |
Cycle | string | The purchased duration. | 1:Year |
StartTimestamp | integer | The start timestamp. | 1663135741039 |
SavingsType | string | The type of the savings plan.
| ECS |
Utilization | string | The total utilization. | 1.0 |
PrepayFee | string | The upfront payment. Unit: CNY. | 8760.00 |
InstanceId | string | The ID of the savings plan instance. | spn-xxxxxxxx |
Currency | string | The currency. Valid values: CNY: Chinese Yuan. USD: US Dollar. | CNY |
EndTimestamp | integer | The end timestamp. | 1663135741039 |
EndTime | string | The expiration time of the instance. The time is in the yyyy-MM-dd HH:mm:ss format. | 2021-01-01 00:00:00 |
StartTime | string | The effective time of the instance. The time is in the yyyy-MM-dd HH:mm:ss format. | 2020-01-01 00:00:00 |
AllocationStatus | string | The allocation status.
| unallocated |
InstanceFamily | string | For a compute-optimized savings plan, this parameter indicates the corresponding instance family or instance family package. | ecs.g6 |
Region | string | The region. | cn-zhangjiakou-na62-a01 |
LastBillTotalUsage | string | The total deduction amount in the previous cycle. Unit: CNY. | 100.0 |
LastBillUtilization | string | The utilization in the previous cycle. | 0.8 |
TotalSave | string | The total savings. Unit: CNY. | 20.00 |
PoolValue | string | The commitment. Unit: CNY. | 1.00 |
PayMode | string | The payment type.
| total |
| Tags | array<object> | The list of tag information. | |
object | The tag element. | ||
Key | string | The tag key. | 标签1 |
Value | string | The tag value. | 标签1 |
DeductCycleType | string | The deduction cycle. HOUR: hourly DAY: daily ONCE: one-time (the total amount decreases over time) | HOUR |
RestPoolValue | string | For a flexible savings plan with a monthly or daily commitment, this is the remaining amount in the current cycle. Unit: CNY. | 100.0 |
CommodityCode | string | The commodity code. | savingplan_common_public_cn |
CurrentPoolValue | string | For a savings plan with a monthly cycle, this is the commitment for the current cycle. Unit: CNY. | 100.0 |
Examples
Success response
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": "标签1",
"Value": "标签1"
}
],
"DeductCycleType": "HOUR",
"RestPoolValue": "100.0",
"CommodityCode": "savingplan_common_public_cn",
"CurrentPoolValue": "100.0"
}
]
}
}Error codes
HTTP status code | Error code | Error message | Description |
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 | NotAuthorized | The user is not authorized for the specified API. | |
500 | InternalError | An error occurred in the internal server. | System exception, please try again |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.