Queries discounts on savings plans.
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:QuerySavingsPlansDiscount | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ModuleCode | string | No | The code of the pricing module. | instance_type |
PayMode | string | Yes | The payment mode. Valid values: total: all upfront. half: half upfront. zero: no upfront. | total |
PageSize | integer | No | The number of entries to return on each page. | 20 |
SpnType | string | Yes | The type of the savings plan. Valid values: ecs: Elastic Compute Service (ECS) compute type. universal: general-purpose type. | universal |
Locale | string | No | The identifier of the language. Valid values:
| ZH |
Cycle | string | Yes | The cycle based on which queries are performed. | 1:Year |
PageNum | integer | No | The number of the page to return. | 1 |
Spec | string | No | The type of the resource. | ecs.g6 |
CommodityCode | string | Yes | The code of the service. | ecs |
Region | string | No | The ID of the region. | cn-hangzhou |
Response parameters
Examples
Sample success responses
JSON
format
{
"Message": "This API is not applicable for caller.",
"RequestId": "6000EE23-274B-4E07-A697-FF2E999520A4",
"Data": {
"HostId": "100.104.180.109",
"Items": [
{
"CommodityName": "Pay-as-you-go Elastic Compute Service (ECS) instance\n",
"ModuleName": "Instance\n",
"SpnType": "universal",
"PayMode": "total",
"Cycle": "1:Year",
"Region": "cn-zhangjiakou-na62-a01",
"RegionCode": "cn-hangzhou",
"Spec": "ecs.g6",
"DiscountRate": "0.85",
"ContractDiscountRate": "0.85"
}
]
},
"Code": "PARAM_ERROR",
"Success": true
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-05-25 | The response structure of the API has changed | View Change Details |
2022-12-23 | The internal configuration of the API is changed, but the call is not affected | View Change Details |