查询资源详单(旧)
功能介绍
客户在自建平台查询自己的资源详单,用于反映各类资源的消耗情况。
注意事项:
- 该接口只允许使用客户AK/SK或者Token调用。
- 
      - 该接口即将下线,“查询资源详单”新接口请参考查询资源详单。
- 客户账号切换成为财务托管子之后,调用API查询到的账单,包含切换为财务托管子后产生的账单和切换财务托管子之前的账单。
- 支持查看近3年的数据。
 
URI
GET /v1.0/{domain_id}/customer/account-mgr/bill/res-records
URL参数说明请参见下表。
| 参数 | 是否必选 | 取值范围 | 描述 | 
|---|---|---|---|
| domain_id | 是 | 最大长度:64 | 客户账号ID。获取方法请参见如何获取客户的customer_id/domain_id。 | 
| 参数 | 是否必选 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|---|
| cycle | 是 | String | 最大长度:8 | 消费月份,格式为YYYY-MM。 例如2020-01。 | 
| cloudServiceTypeCode | 否 | String | 最大长度:64 | 云服务类型编码,例如OBS的云服务类型编码为“hws.service.type.obs”。您可以调用查询云服务类型列表接口获取。 此参数不携带或携带值为空,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 | 
| resourceTypeCode | 否 | String | 最大长度:64 | 资源类型编码,例如ECS的VM为“hws.resource.type.vm”。您可以调用查询资源类型列表接口获取。 此参数不携带或携带值为空,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 | 
| regionCode | 否 | String | 最大长度:64 | 云服务区编码,例如:“ap-southeast-1”。具体请参见地区和终端节点对应云服务的“区域”列的值。 此参数不携带或携带值为空,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 | 
| resInstanceId | 否 | String | 最大长度:256 | 资源实例ID。 | 
| payMethod | 是 | String | 最大长度:4 | 支付方式: 
 | 
| enterpriseProjectId | 否 | String | 最大长度:64 | 企业项目标识(企业项目ID)。 
 此参数不携带或携带值为空,不作为筛选条件;携带值为null时,作为筛选条件;不支持携带值为空串。 | 
| offset | 是 | Integer | [1-最大整数] | 页码。 | 
| limit | 是 | Integer | [1-1000] | 页面大小。 | 
请求消息
请求参数
无。
请求示例
GET https://bss-intl.myhuaweicloud.com/v1.0/{domain_id}/customer/account-mgr/bill/res-records?cycle=2019-06&payMethod=0&offset=1&limit=10 HTTP/1.1 Content-Type: application/json X-Auth-Token:MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
响应消息
响应参数
| 参数 | 是否必选 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|---|
| error_code | 否 | String | 最大长度:16 | 状态码。具体请参考状态码。只有失败才会返回这个参数。 | 
| error_msg | 否 | String | 最大长度:1024 | 错误描述信息。只有失败才会返回这个参数。 | 
| monthlyRecords | 否 | List<MonthlyRecord> | N/A | 资源费用记录数据。 具体请参见表3。 | 
| totalCount | 否 | Int | N/A | 结果集数量,只有成功才返回这个参数。 | 
| currency | 否 | String | 最大长度:3 | 货币单位代码: USD:美元 | 
| 参数 | 是否必选 | 参数类型 | 取值范围 | 描述 | 
|---|---|---|---|---|
| cloudServiceTypeCode | 否 | String | 最大长度:256 | 云服务类型编码,例如OBS的云服务类型编码为“hws.service.type.obs”。您可以调用查询云服务类型列表接口获取。 | 
| regionCode | 否 | String | 最大长度:64 | 云服务区编码,例如:“ap-southeast-1”。具体请参见地区和终端节点对应云服务的“区域”列的值。 | 
| resourceTypeCode | 否 | String | 最大长度:256 | 资源类型编码,例如ECS的VM为“hws.resource.type.vm”。您可以调用查询资源类型列表接口获取。 | 
| resInstanceId | 否 | String | 最大长度:256 | 资源实例ID。 | 
| resourceName | 否 | String | - | 资源名称。客户在创建资源的时候,可以输入资源名称,有些资源也可以在管理资源时,修改资源名称。 | 
| resourceTag | 否 | String | 最大长度:8192 | 资源标签。客户在管理资源的时候,可以设置资源标签。 | 
| consumeAmount | 否 | Number | - | 客户购买云服务类型的消费金额,包含代金券,精确到小数点后22位。 | 
| cycle | 否 | String | - | 消费月份。 | 
| measureId | 否 | Integer | [1-2] | 金额单位: 
 | 
| enterpriseProjectId | 否 | String | - | 企业项目标识(企业项目ID)。 
 | 
| payMethod | 否 | String | [0-1] | 计费方式: 0:包年/包月; 1:按需。 10:预留实例 | 
| officialAmount | 否 | Number | - | 官网价。 | 
响应示例
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time  
{
	"monthlyRecords": [{
			"cloudServiceTypeCode": "hws.service.type.marketplace",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.marketplace",
			"resInstanceId": null,
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 0,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": null,
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.marketplace",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.marketplace",
			"resInstanceId": "00*****aae",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 600,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": null,
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.ebs",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.volume",
			"resInstanceId": "005*****1b8c",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 10000,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": "0",
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.ebs",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.volume",
			"resInstanceId": "06c*****88a",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 10000,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": "0",
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.ebs",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.volume",
			"resInstanceId": "08*****23",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 9500,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": "0",
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.marketplace",
			"regionCode": "cn-north-7",
			"resourceTypeCode": "hws.resource.type.marketplace",
			"resInstanceId": "0fa*****21e",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 400,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": null,
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.ebs",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.volume",
			"resInstanceId": "0ff*****04d",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 10000,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": "0",
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.ebs",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.volume",
			"resInstanceId": "1b92*****8c2",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 10000,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": "0",
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.marketplace",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.marketplace",
			"resInstanceId": "1e4*****6a1",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 600,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": null,
			"payMethod": "0",
                        "officialAmount": 10
		},
		{
			"cloudServiceTypeCode": "hws.service.type.ebs",
			"regionCode": "cn-north-1",
			"resourceTypeCode": "hws.resource.type.volume",
			"resInstanceId": "295*****448a1",
			"resourceName": null,
			"resourceTag": null,
			"consumeAmount": 10000,
			"cycle": "2019-06",
			"measureId": 3,
			"enterpriseProjectId": "0",
			"payMethod": "0",
                        "officialAmount": 10
		}
	],
	"totalCount": 33,
	"currency": "USD"
}
  
    