最近更新时间:2024-02-26 15:54:10
本文档描述如何获取实时付费账单明细数据。注意:只支持查询相同月份的数据。
名称 | 类型 | 必须 | 长度限制(字符) | 参数格式 | 描述 |
---|---|---|---|---|---|
Action | String | 是 | 确定值 | 操作接口名,系统规定参数,取值: | |
Version | String | 是 | 确定值 | API版本,固定为 | |
BillStartTime | String | 是 |
| 必选参数,计费的开始时间,(查询结果包含该时间) | |
BillEndTime | String | 是 |
| 必选参数,计费的结束时间,(查询结果不包含该时间,必须和BillStartTime是同一个月) | |
ProductCode | String | 是 | 必选参数,产品线对应的Code。eg. | ||
SettleCycle | Integer | 是 | 结算周期:3:按小时,4:按天 | ||
Page | Integer | 否 | 页码,默认值为1 | ||
Size | Integer | 否 | 每页数量,默认值:20,最大值:1000 |
名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 当前请求的RequestId |
PageNum | Integer | 页码 |
PageSize | Integer | 每页数量 |
TotalCount | Integer | 总记录数 |
DetailSet | BillDetail 数组 | 账单明细数据 |
错误代码(Code) | 错误消息(Message) | HTTP 状态码 | 中文描述(语义) |
---|---|---|---|
InvalidParameter | There is one or more invalid parameter(%s). | 400 | 参数%s错误,具体参数名在%s说明 |
MissingParameter | A required parameter for the specified action is not supplied. | 400 | 忘记必选参数%s,具体参数名在%s说明 |
请求示例
http://krtpay.api.ksyun.com/?Action=DescribeBillDetail
&Version=2019-07-19
&BillStartTime=2019-07-12 20:00:00
&BillEndTime=2019-07-16 00:00:00
&ProductCode=VM_GROUP
&SettleCycle=3
&公共请求参数
返回示例
XML格式
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DescribeBillDetailsResponse>
<RequestId>83f25946-1d4e-4300-b37e-97d7906188eb</RequestId>
<PageNum>1</PageNum>
<PageSize>1</PageSize>
<TotalCount>76</TotalCount>
<DetailSet>
<Item>
<AccountPeriod>2019071523</AccountPeriod>
<CustomerId>2000074760</CustomerId>
<InstanceId>fe080d31-ffbd-41bd-8056-09373c5c4f40</InstanceId>
<InstanceName>testTag</InstanceName>
<Project>278</Project>
<ProjectName>hanziguoproject</ProjectName>
<RegionName>华东1(上海)</RegionName>
<ZoneName>可用区A</ZoneName>
<ProductCode>VM_GROUP</ProductCode>
<ProductGroupName>云主机</ProductGroupName>
<ProductTypeName>计算优化型C1</ProductTypeName>
<PayMode>87</PayMode>
<PayModeName>按量付费</PayModeName>
<PackageCode>C1.2A</PackageCode>
<Duration>3600</Duration>
<DurationAccumulate>3600</DurationAccumulate>
<TimeUnitName>秒</TimeUnitName>
<Cost>0.45220</Cost>
<RealCost>0.45220</RealCost>
<Discount>1.0000</Discount>
<DetailBillStartTime>2019-07-15 23:00:00</DetailBillStartTime>
<DetailBillEndTime>2019-07-16 00:00:00</DetailBillEndTime>
<ServiceBillStartTime>2019-07-08 11:19:29</ServiceBillStartTime>
<ConfigSet>
<ConfigItem>
<Key>CPU(核)</Key>
<Code>cpu</Code>
<Value>2</Value>
</ConfigItem>
<ConfigItem>
<Key>内存(G)</Key>
<Code>mem</Code>
<Value>2</Value>
</ConfigItem>
<ConfigItem>
<Key>SSD(G)</Key>
<Code>ssd</Code>
<Value>0</Value>
</ConfigItem>
</ConfigSet>
<ProviderSet>
<ProviderItem>
<Key>操作系统</Key>
<Code>opstype</Code>
<Value>linux</Value>
</ProviderItem>
</ProviderSet>
<ConsumeResources/>
<ExtraSet>
<ExtraItem>
<Key>内网IP</Key>
<Value>10.146.16.20</Value>
</ExtraItem>
<ExtraItem>
<Key>公网IP</Key>
<Value></Value>
</ExtraItem>
</ExtraSet>
<TagSet>
<TagItem>
<Key>ssss</Key>
<Value>sss</Value>
</TagItem>
</TagSet>
<DisplaySet>
<DisplayItem>
<Key>云服务器名称</Key>
<Value>testTag</Value>
</DisplayItem>
</DisplaySet>
</Item>
</DetailSet>
</DescribeBillDetailsResponse>
JSON格式
{
"RequestId": "fb4cf6b6-77a2-4e77-9f19-cffc7b860764",
"PageNum": 1,
"PageSize": 1,
"TotalCount": 76,
"DetailSet": [
{
"AccountPeriod": "2019071523",
"CustomerId": 2000074760,
"InstanceId": "fe080d31-ffbd-41bd-8056-09373c5c4f40",
"InstanceName": "testTag",
"Project": 278,
"ProjectName": "hanziguoproject",
"RegionName": "华东1(上海)",
"ProductCode": "VM_GROUP",
"ProductGroupName": "云主机",
"ProductTypeName": "计算优化型C1",
"PayModeName": "按量付费",
"PackageCode": "C1.2A",
"Duration": 3600,
"DurationAccumulate": 3600,
"TimeUnitName": "秒",
"Cost": "0.45220",
"RealCost": "0.45220",
"Discount": 1,
"DetailBillStartTime": "2019-07-15 23:00:00",
"DetailBillEndTime": "2019-07-16 00:00:00",
"ServiceBillStartTime": "2019-07-08 11:19:29",
"ZoneName": "可用区A",
"ConfigSet": [
{
"Key": "CPU(核)",
"Code": "cpu",
"Value": "2"
},
{
"Key": "内存(G)",
"Code": "mem",
"Value": "2"
},
{
"Key": "SSD(G)",
"Code": "ssd",
"Value": "0"
}
],
"ConsumeResources": [],
"ExtraSet": [
{
"Key": "内网IP",
"Value": "10.146.16.20"
},
{
"Key": "公网IP",
"Value": ""
}
],
"ProviderSet": [
{
"Key": "操作系统",
"Code": "opstype",
"Value": "linux"
}
],
"TagSet": [
{
"Key": "ssss",
"Value": "sss"
}
],
"DisplaySet": [
{
"Key": "镜像",
"Value": "centos-7.5-20190509212611"
}
]
}
]
}
纯净模式