GetConsumptionsEstimated【获取租户名下资源的消费预估】¶
获取租户名下资源的消费预估:消费预估是通过统计当前一小时所有节点所有资源的消费情况,做出对每天、每月、每年的消费预估。
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
data | Array | JSON 格式的消费预估信息列表,每项参数可见下面 Data Item |
Data Item
Name | Type | Description |
---|---|---|
res_type | String | 服务类型,有效值instance,image,loadbalance,volume instance:云主机
image:镜像
loadbalance:负载均衡
volume:云硬盘
|
year | String | 预估年消费 |
month | String | 预估月消费 |
day | String | 预估日消费 |
hour | String | 预估时消费 |
Example
Example Request:
Request Headers:
POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/x-www-form-urlencoded
Form Data:
action: GetConsumptionsEstimated
Example Response:
{
"message": "Success",
"code": 200,
"data": [
{
"res_type": "instance",
"year": "2676.145",
"day": "7.3319",
"hour": "0.3055",
"month": "219.9571"
},
{
"res_type": "loadbalance",
"year": "364.8715",
"day": "0.9996",
"hour": "0.04165",
"month": "29.9894"
},
{
"res_type": "volume",
"year": "344.3731",
"day": "0.9435",
"hour": "0.03931",
"month": "28.3046"
}
]
}