最近更新时间:2024-02-26 15:54:09
本文档描述如何查询用户预估消耗明细信息,支持按产品类型Code、项目Id筛选。
注意:只支持查询最近两个月的数据。
名称 | 类型 | 必须 | 长度限制(字符) | 参数格式 | 描述 |
---|---|---|---|---|---|
Action | String | 是 | 确定值 |
| 操作接口名,系统规定参数,取值: |
Version | String | 是 | 确定值 | API版本,固定为 | |
BillMonth | String | 是 |
| 必选参数,账单月份,eg. | |
ProductCode | String | 否 | 可选参数,产品类型对应的Code。eg. | ||
ProjectId | String | 否 | 可选参数,项目组Id,不传获取所有项目Id | ||
PageNo | Integer | 否 | 可选参数,页码,不传默认为0 | ||
PageSize | Integer | 否 | 可选参数,每页数量,不传默认为1,最大只允许传5000 |
名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 当前请求的RequestId |
PageNo | Integer | 当前页号 |
PageSize | Integer | 当前页大小 |
Total | Integer | 当前请求的总条数 |
PostpayDetailBillSet | 账单明细数据 |
错误代码(Code) | 错误消息(Message) | HTTP 状态码 | 中文描述(语义) |
---|---|---|---|
InvalidParameter | There is one or more invalid parameter(%s)." | 400 | 参数%s错误,具体参数名在%s说明 |
Forbidden Request | user %s forbidden request this api" | 400 | 用户禁止请求API,用户uid在%s指名 |
Server unavailable | Server error | 500 | 后端服务异常 |
以获取2019-08的云主机类型(ProductCode=KEC),默认项目(ProjectId=0)的账单明细数据为示例。
请求示例
https://bill.api.ksyun.com/?Action=getPostpayDetailConsume
&Version=2018-06-01
&BillMonth=2019-08
&ProductCode=KEC
&ProjectId=0
&PageNo=0
&PageSize=1
&公共请求参数
返回示例
XML格式
<GetPostpayDetailConsumeResponse>
<Total>63</Total>
<Error/>
<RequestId>123</RequestId>
<PageSize>1</PageSize>
<PostpayDetailBillSet>
<Item>
<DetailBillNo>000000000304994</DetailBillNo>
<BillMonth>2019-08</BillMonth>
<CustomerId>123</CustomerId>
<DetailBillStatDate>2019-08-01</DetailBillStatDate>
<DetailBillStartTime>2019-08-01 00:00:00</DetailBillStartTime>
<DetailBillEndTime>2019-08-01 23:59:59</DetailBillEndTime>
<ProductCode>KEC</ProductCode>
<ProductName>云主机</ProductName>
<ProductSubTypeName>本地高性能云主机</ProductSubTypeName>
<InstanceId>cb48-af94-2b0746ff2431</Insta nceId>
<InstanceName>测试</InstanceName>
<Cost>10.3645</Cost>
<ServiceStartTime>2015-09-21 23:14:32</ServiceStartTime>
<BillType>按量付费(按日月结)</BillType>
<BillDays>1</BillDays>
<BillHours></BillHours>
<RegionName>亦庄VPC</RegionName>
<ZoneName>华北1(北京)可用区A</ZoneName>
<MeasureAmount>14.8100</MeasureAmount>
<Discount>0.7</Discount>
<ProjectId>0</ProjectId>
<ProjectName></ProjectName>
<ProviderSet>
<ProviderItem>
<Key>操作系统类型</Key>
<Value>linux</Value>
</ProviderItem>
</ProviderSet>
<ConfigSet>
<ConfigItem>
<Key>联网增强</Key>
<Value></Value>
</ConfigItem>
<ConfigItem>
<Key>ebs_ssd3.0系统盘(GB)</Key>
<Value></Value>
</ConfigItem>
<ConfigItem>
<Key>SATA磁盘(GB)</Key>
<Value></Value>
</ConfigItem>
<ConfigItem>
<Key>内存(GB)</Key>
<Value>8.0000</Value>
</ConfigItem>
<ConfigItem>
<Key>套餐code</Key>
<Value>I0.None</Value>
</ConfigItem>
<ConfigItem>
<Key>CPU(核个数)</Key>
<Value>4.0000</Value>
</ConfigItem>
<ConfigItem>
<Key>SSD磁盘(GB)</Key>
<Value>50.0000</Value>
</ConfigItem>
</ConfigSet>
<ExtraSet>
<ExtraItem>
<Key>公网IP</Key>
<Value></Value>
</ExtraItem>
<ExtraItem>
<Key>内网IP</Key>
<Value>10.253.10.154</Value>
</ExtraItem>
</ExtraSet>
<TagSet/>
</Item>
</PostpayDetailBillSet>
<PageNo>1</PageNo>
</GetPostpayDetailConsumeResponse>
JSON示例
{
"Total": 63,
"Error": null,
"RequestId": "123",
"PageSize": 1,
"PostpayDetailBillSet": [
{
"DetailBillNo": "000000000304994",
"BillMonth": "2019-08",
"CustomerId": "123456",
"DetailBillStatDate": "2019-08-01",
"DetailBillStartTime": "2019-08-01 00:00:00",
"DetailBillEndTime": "2019-08-01 23:59:59",
"ProductCode": "KEC",
"ProductName": "云主机",
"ProductSubTypeName": "本地高性能云主机",
"InstanceId": "cb48-af94-2b0746ff2431",
"InstanceName": "测试",
"Cost": "10.3645",
"ServiceStartTime": "2018-09-21 23:14:32",
"BillType": "按量付费(按日月结)",
"BillDays": "1",
"BillHours": "",
"RegionName": "亦庄VPC",
"ZoneName": "华北1(北京)可用区A",
"MeasureAmount": "14.8100",
"Discount": "0.7",
"ProjectId": "0",
"ProjectName": "",
"ProviderSet": [
{
"Key": "操作系统类型",
"Value": "linux"
}
],
"ConfigSet": [
{
"Key": "联网增强",
"Value": ""
},
{
"Key": "ebs_ssd3.0系统盘(GB)",
"Value": ""
},
{
"Key": "SATA磁盘(GB)",
"Value": ""
},
{
"Key": "内存(GB)",
"Value": "8.0000"
},
{
"Key": "套餐code",
"Value": "I0.None"
},
{
"Key": "CPU(核个数)",
"Value": "4.0000"
},
{
"Key": "SSD磁盘(GB)",
"Value": "50.0000"
}
],
"ExtraSet": [
{
"Key": "公网IP",
"Value": ""
},
{
"Key": "内网IP",
"Value": "10.253.10.154"
}
],
"TagSet": []
}
],
"PageNo": 1
}
纯净模式