Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying Resource Package Usage Details

Updated on 2024-10-29 GMT+08:00

Function

Customers can query the resource usage details on the partner sales platform.

Constraints

This API can be invoked only by the customer AK/SK or token.

Debugging

You can debug this API in API Explorer. Automatic authentication is supported. API Explorer can automatically generate and debug example SDK code.

URI

GET /v2/bills/customer-bills/free-resources-usage-records

Table 1 Request parameters

Parameter

Mandatory

Type

Value Range

Description

free_resource_id

No

String

A maximum of 64 characters

Resource ID. A resource package contains multiple resources, and a resource has a usage type. The resource ID is obtained from the response of the API in Querying Resource Packages.

If this parameter is not included or is left empty, it will not be used as a filter criterion.

product_id

No

String

A maximum of 64 characters

Product ID, that is, resource package ID.

If this parameter is not included or is left empty, it cannot be used as a filter criterion.

resource_type_code

No

String

A maximum of 64 characters

Resource type code. For example, the VM resource type code of ECS is hws.resource.type.vm. To obtain a specific resource type, call the API in Querying Resource Types.

If this parameter is not included or is left empty, it will not be used as a filter criterion.

deduct_time_begin

Yes

String

A maximum of 10 characters

Start time of resources deduction, which is in YYYY-MM-DD format (GMT+08:00).

deduct_time_end

Yes

String

A maximum of 10 characters

End time of resource deduction, which is in YYYY-MM-DD format (GMT+08:00).

NOTE:

The gap between the start time and end time must be less than or equal to 90 days.

offset

No

Integer

0 to a maximum integer

Offset, starting from 0. The default value is 0.

NOTE:

This parameter is used for pagination. Retain its default value 0 if pagination is not required. offset indicates the offset relative to the first data record among all that meets the conditions configured. If you set offset to 1, the second and subsequent data records are returned.

For example, if there are 10 records that meet query conditions, when you set limit to 10 and offset to 1, the second to the tenth records are returned.

If there are 20 records that meet query conditions, when you set offset to 0 and limit to 10 for the first page and set offset to 10 and limit to 10 for the second page, then each page will respectively have 10 records.

limit

No

Integer

[1-1000]

Maximum number of records in each query. The default value is 10.

Request

Request Parameters

None

Example Request

GET https://bss-intl.myhuaweicloud.com/v2/bills/customer-bills/free-resources-usage-records?free_resource_id=free_resource_id&product_id=product_id&resource_type_code=resource_type_code&deduct_time_begin=2021-10-01&deduct_time_end=2021-10-31&offset=0&limit=10 HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

Response

Response Parameters

Parameter

Type

Value Range

Description

error_code

String

20

Error code.

For details, see Returned Values. This parameter is returned only when the query failed.

error_msg

String

1000

Error description.

This parameter is returned only when the query failed.

free_resource_records

List<FreeResourceRecord>

Maximum number: 1000

Resource package usage details. For details, see Table 2.

total_count

Integer

-

Total number of records that meet the conditions.

Table 2 FreeResourceRecord

Parameter

Type

Value Range

Description

deduct_time

String

A maximum of 20 characters

Time when a resource is deducted.

UTC time. The format is yyyy-MM-dd'T'HH:mm:ss'Z', for example, 2021-10-13T10:01:49Z.

free_resource_id

String

A maximum of 64 characters

Resource ID. A resource package contains multiple resources, and a resource has a usage type.

resource_id

String

A maximum of 64 characters

Resource ID.

resource_type_code

String

A maximum of 64 characters

Resource type code. For example, the resource type code of VM is hws.resource.type.vm.

resource_type_name

String

A maximum of 200 characters

Resource type. For example, the resource type of ECS is Cloud Host.

resource_tag

String

A maximum of 10,240 characters

Resource tag.

product_id

String

A maximum of 64 characters

Product ID, that is, resource package ID.

product_name

String

A maximum of 256 characters

Product name, that is, resource package name.

usage_type_code

String

A maximum of 64 characters

Usage type

available_amount

String

A maximum of 64 characters

Available resources before deduction

remaining_amount

String

A maximum of 64 characters

Available resources after deduction.

used_amount

String

A maximum of 64 characters.

Deducted resource amount.

measure_id

Integer

-

Measurement unit of the quota of a free resource package. Call the API in Querying Measurement Units to obtain the value.

effective_time

String

A maximum of 20 characters

Start time of using a resource (UTC time).

expire_time

String

A maximum of 20 characters

End time of resource usage (UTC time).

Example Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time 
{
    "free_resource_records": [
        {
            "deduct_time": "2021-10-19T08:04:25Z",
            "free_resource_id": "43248428-8409-47cd-b115-6a5872e2200b",
            "resource_id": "resourceInstanceId_north1_obs_10120001112",
            "resource_type_code": "",
            "resource_tag": "--",
            "product_id": "90301-247012-0--0",
            "product_name": "OBS storage package 10 TB Monthly subscription Beijing7",
            "usage_type_code": "",
            "available_amount": "10190",
            "remaining_amount": "10140",
            "used_amount": "50",
            "measure_id": 10,
            "effective_time": "2021-10-13T10:01:49Z",
            "expire_time": "2021-10-13T11:00:00Z"
        }
    ],
    "total_count": 1
}

Returned Values

NOTE:
  • 4xx: This class of HTTP status code is intended for situations in which the error seems to have been caused by the client, for example, the request contains bad syntax or incorrect parameters. You must ensure the request is correct.
  • 5xx: This class of HTTP status code is intended for cases in which the Huawei Cloud server is aware that it has encountered an error or is otherwise incapable of performing the request. In this case, contact Huawei Cloud customer service.

HTTP Status Code

Error Code

Description

400

CBC.0100

Incorrect parameter.

403

CBC.0151

Access denied.

500

CBC.0999

Other errors.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback