GetConsumptionsSummary【获取消费汇总信息】

获取用户的消费汇总信息

Request Parameters

Parameter name Type Description Required
action String API 标识符 Yes
region String 区域 No

Response Elements

Name Type Description
message String 执行结果信息
code Integer HTTP Resonpe响应状态码
data Array JSON 格式的消费汇总信息列表,每项参数可见下面 Data Item

Data Item

Name Type Description
count Integer 资源数量
res_type String

资源类型,有效值 instance, volume, image, router, floatingip, bandwidth, loadbalance, cdn, allcategories

instance:云主机
volume:云硬盘
image:镜像
router:路由器
floatingip:公网 IP
bandwidth:总带宽
loadbalance:负载均衡
cdn:CDN
allcategories:全部类别(所有资源消费总额)
amount String 总额

Example

Example Request:

https://console.plcloud.com/api/?action=GetConsumptionsSummary
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: GetConsumptionsSummary
region:

Example Response:

{
  "message": "成功",
  "code": 200,
  "data": [
    {
      "count": 1,
      "res_type": "instance",
      "amount": "3.1344"
    },
    {
      "count": 0,
      "res_type": "volume",
      "amount": "0.00"
    },
    {
      "count": 1,
      "res_type": "image",
      "amount": "0.00"
    },
    {
      "count": 1,
      "res_type": "router",
      "amount": "2.9998"
    },
    {
      "count": 0,
      "res_type": "floatingip",
      "amount": "0.00"
    },
    {
      "count": 1,
      "res_type": "bandwidth",
      "amount": "1.6388"
    },
    {
      "count": 0,
      "res_type": "loadbalance",
      "amount": "0.00"
    },
    {
      "count": 0,
      "res_type": "cdn",
      "amount": "0.00"
    },
    {
      "res_type": "allcategories",
      "amount": "7.77"
    }
  ]
}