Queries the pay-as-you-go price of an Alibaba Cloud service.
Operation description
Usage notes
- Call the QueryProductList operation to obtain the code of the service. For more information, see QueryProductList .
- Call the DescribePricingModule operation to obtain the configuration parameters of the service. For more information, see DescribePricingModule .
- Call the GetPayAsYouGoPrice operation to obtain the pay-as-you-go price of the service based on the returned configuration parameters.
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:GetPayAsYouGoPrice | READ |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ProductCode | string | Yes | The code of the service. | ecs |
ProductType | string | No | The type of the service. | ecs |
SubscriptionType | string | Yes | The billing method. Set the value to PayAsYouGo. | PayAsYouGo |
Region | string | No | The ID of the region in which the instance resides. | cn-hangzhou |
ModuleList | object [] | Yes | The details of pricing modules. | |
ModuleCode | string | Yes | The code of the Nth pricing module. Note
You can call the DescribePricingModule operation to obtain the module code.
| InstanceType |
PriceType | string | Yes | The price type of the Nth pricing module. Valid values:
Note
You can call the DescribePricingModule operation to obtain the configuration parameters of the pricing module.
| Hour |
Config | string | Yes | The configuration of the Nth pricing module. Valid values of N: 1 to 50. Format: AA:aa,BB:bb. The values of AA and BB are the property IDs of the pricing module. The values of aa and bb are the property values of the pricing module. Note
You can call the DescribePricingModule operation to obtain the configuration parameters of the pricing module.
| InstanceType:ecs.g5.xlarge,IoOptimized:IoOptimized,ImageOs:linux |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "Success",
"Message": "Successful",
"RequestId": "1537A007-72D7-4165-8A26-8694A38E219A",
"Success": true,
"Data": {
"Currency": "CNY",
"ModuleDetails": {
"ModuleDetail": [
{
"CostAfterDiscount": 100,
"InvoiceDiscount": 20,
"UnitPrice": 0,
"OriginalCost": 1.77,
"ModuleCode": "InstanceType"
}
]
},
"PromotionDetails": {
"PromotionDetail": [
{
"PromotionDesc": "This discount allows you to use a service at the minimum price and is provided for testing purposes only.\n",
"PromotionId": 10200210,
"PromotionName": "This discount allows you to use a service at the minimum price and is provided for testing purposes only.\n"
}
]
}
}
}
Error codes
For a list of error codes, visit the Service error codes.