查询资源消费记录(旧)
功能介绍
客户在自建平台查询每个资源的消费明细数据。
注意事项:
- 该接口只允许使用客户AK/SK或者Token调用。
- 该接口只能查询同一个月内的资源消费记录,不支持跨月份查询资源消费记录。
- 该接口只能查询客户自身的资源消费记录,企业子的资源消费记录无法通过此接口查询。

- 该接口即将下线,“查询资源消费记录”新接口请参考查询资源消费记录-ListCustomerselfResourceRecords。
- 支持查看近3年的数据。
URI
GET /v1.0/{domain_id}/customer/account-mgr/bill/res-fee-records
URL参数说明请参见下表。
参数 | 是否必选 | 取值范围 | 描述 |
|---|---|---|---|
domain_id | 是 | 最大长度:64 | 客户账号ID。获取方法请参见如何获取客户的customer_id/domain_id。 |
参数 | 是否必选 | 参数类型 | 取值范围 | 描述 |
|---|---|---|---|---|
startTime | 是 | String | 最大长度:10 | 开始时间,格式:yyyy-MM-dd。 说明: 开始时间和结束时间只能在同一月份内,不支持跨月份查询资源消费记录。 |
endTime | 是 | String | 最大长度:10 | 结束时间,格式:yyyy-MM-dd。 说明: 开始时间和结束时间只能在同一月份内,不支持跨月份查询资源消费记录。 |
cloudServiceTypeCode | 否 | String | 最大长度:256 | 云服务类型编码,例如OBS的云服务类型编码为“hws.service.type.obs”。您可以调用查询云服务类型列表-ListServiceTypes接口获取。 此参数不携带或携带值为空时,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 |
regionCode | 否 | String | 最大长度:64 | 云服务区编码,例如:“ap-southeast-1”。具体请参见地区和终端节点对应云服务的“区域”列的值。 此参数不携带或携带值为空时,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 |
orderId | 否 | String | 最大长度:64 | 订单ID。 此参数不携带或携带值为空时,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 |
payMethod | 是 | String | 最大长度:4 | 支付方式: 0:包年/包月; 1:按需。 |
offset | 否 | Integer | [1-最大整数] | 页码。 此参数不携带时,取值为1;不支持携带值为空或携带值为空串或携带值为null。 |
limit | 否 | Integer | [1-100] | 每页条目数。 此参数不携带时,取值为10;不支持携带值为空或携带值为空串或携带值为null。 |
resourceId | 否 | String | 最大长度:256 | 资源ID。 此参数不携带或携带值为空时,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 |
enterpriseProjectId | 否 | String | 最大长度:64 | 企业项目标识(企业项目ID)。
此参数不携带时,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 |
请求消息
请求参数
无。
请求示例
GET https://bss-intl.myhuaweicloud.com/v1.0/{domain_id}/customer/account-mgr/bill/res-fee-records?startTime=2019-08-01&endTime=2019-08-31&payMethod=0&cloudServiceTypeCode=hws.service.type.ebs®ionCode=cn-north-1&orderId=orderId&offset=1&limit=10&resourceId=hws.service.type.ebs&enterpriseProjectId=pjzV4N9Uq1LWMUgh3fYAhJqUbtd6Ad8yALoRJeDoYGl0jWdZoS8UHbcGBqEin1Ia HTTP/1.1 Content-Type: application/json X-Auth-Token:MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
响应消息
响应参数
参数 | 参数类型 | 取值范围 | 描述 |
|---|---|---|---|
error_code | String | 最大长度:16 | 状态码。具体请参考状态码。只有失败才会返回这个参数。 |
error_msg | String | 最大长度:1024 | 错误描述信息。只有失败才会返回这个参数。 |
feeRecords | List<ResFeeRecord> | - | 资源费用记录数据。 具体请参见表3。 |
totalCount | Integer | - | 结果集数量,只有成功才返回这个参数。 |
currency | String | 最大长度:3 | 货币单位代码: USD:美元 |
参数 | 参数类型 | 取值范围 | 描述 |
|---|---|---|---|
createTime | String | 最大长度:32 | 费用记录的生成时间。 |
effectiveTime | String | 最大长度:32 | 费用对应的资源使用的开始时间,按需有效,包年/包月该字段保留。 |
expireTime | String | 最大长度:32 | 费用对应的资源使用的结束时间,按需有效,包年/包月该字段保留。 |
feeId | String | 最大长度:64 | 费用流水号。 |
productId | String | 最大长度:64 | 产品ID。 |
productName | String | 最大长度:256 | 产品名称。 |
orderId | String | 最大长度:64 | 订单ID,包年/包月资源使用记录才有该字段,按需资源为空。 |
amount | Number | - | 消费金额,包括代金券金额,精确到小数点后2位。 |
measureId | Integer | - | 金额单位:
|
usageAmount | Number | - | 使用量。 |
usageMeasureId | Integer | - | 使用量度量单位,您可以调用查询度量单位列表-ListMeasureUnits接口获取。 |
freeResourceAmount | Number | - | 套餐内使用量。 |
freeResourceMeasureId | Integer | - | 套餐内使用量单位,您可以调用查询度量单位列表-ListMeasureUnits接口获取。 |
cloudServiceTypeCode | String | 最大长度:64 | 云服务类型编码,例如OBS的云服务类型编码为“hws.service.type.obs”。您可以调用查询云服务类型列表-ListServiceTypes接口获取。 |
regionCode | String | 最大长度:64 | 云服务区编码,例如:“ap-southeast-1”。具体请参见地区和终端节点对应云服务的“区域”列的值。 |
resourceTypeCode | String | 最大长度:64 | 资源类型编码,例如ECS的VM为“hws.resource.type.vm”。您可以调用查询资源类型列表-ListResourceTypes接口获取。 |
payMethod | String | 最大长度:32 | 支付方式: 0:包年/包月; 1:按需。 |
projectID | String | 最大长度:64 | 项目ID。 |
projectName | String | 最大长度:256 | 项目名称。 |
resourceTag | String | 最大长度:8192 | 资源标签。 |
resourceName | String | 最大长度:256 | 资源名称。 |
resourceId | String | 最大长度:128 | 资源ID。 |
feeSourceOperation | Integer | - | 消费类型: 1:订购; 2:续订; 3:变更; 4:退订; 5:按需使用; 6:折扣; 7:优惠; 8:免费资源; 9:华为核销。 17:消费-保底差额 19:变更-增配 20:退款-变更(整机) 21:退款-变更(降配) |
enterpriseProjectId | String | 最大长度:128 | 企业项目标识(企业项目ID)。
|
periodType | String | - | 周期类型: 19:年; 20:月; 24:天; 25:小时; 5:分钟; 6:秒。 |
spot | String | 最大长度:64 | 竞价实例标识,当为2时,表示资源是竞价实例。 |
rIAmount | Number | - | 预留实例使用量。 |
rIMeasureId | Integer | - | 预留实例使用量单位。 |
officialAmount | Number | - | 官网价。 |
响应示例
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time
{
"totalCount": 1,
"currency": "USD",
"feeRecords": [{
"createTime": null,
"effectiveTime": null,
"expireTime": null,
"feeId": null,
"productId": null,
"productName": null,
"orderId": "orderId",
"amount": null,
"measureId": 0,
"usageAmount": null,
"usageMeasureId": 0,
"freeResourceAmount": null,
"freeResourceMeasureId": 0,
"cloudServiceTypeCode": "hws.service.type.ebs",
"regionCode": "cn-north-1",
"resourceTypeCode": null,
"payMethod": "0",
"projectID": "04f480425980d32a2f04c018d3326097",
"projectName": null,
"resourcetag": null,
"resourceName": null,
"resourceId": null,
"feeSourceOperation": 0,
"periodType": null,
"enterpriseProjectId": "pjzV4N9Uq1LWMUgh3fYAhJqUbtd6Ad8yALoRJeDoYGl0jWdZoS8UHbcGBqEin1Ia",
"spot": null,
"rIAmount": null,
"rIMeasureId": 0,
"officialAmount": 10
}]
} 
