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

Viewing Resource Package Usage

Updated on 2023-11-02 GMT+08:00

Function

Partners can query the resource package usage of customers on the partner sales platform by resource.

Constraints

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

CAUTION:

If a resource package has expired for more than 18 months, its information cannot be queried.

You can debug the API in API Explorer which supports automatic authentication. API Explorer can automatically generate and debug example SDK code.

URI

POST /v2/payments/free-resources/usages/details/query

Table 1 Header parameter

Parameter

Mandatory

Value Range

Description

X-Language

No

A maximum of 8 characters

Language.

  • zh_CN: Chinese
  • en_US: English

Default value: zh_CN

Request

Request Parameters

Parameter

Mandatory

Type

Value Range

Description

free_resource_ids

Yes

List<string>

A maximum of 100 records

List of resource item IDs. Each ID contains a maximum of 64 bytes.

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.

Example Request

POST https://bss-intl.myhuaweicloud.com/v2/payments/free-resources/usages/details/query HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

{
    "free_resource_ids": [
        "d4463497-991b-439d-9ab6-23f9ed197fe9"
    ]
}

Response

Response Parameters

Parameter

Type

Maximum Length of Characters

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_resources

List<FreeResourceDetail>

-

Resource information (resource details) in a resource package. For details, see Table 2.

Table 2 FreeResourceDetail

Parameter

Type

Maximum Length of Characters

Description

free_resource_id

String

A maximum of 64 characters

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

free_resource_type_name

String

-

Resource type name.

quota_reuse_cycle

Integer

-

Reset period. This parameter is valid only when quota_reuse_mode is set to 1 (Resettable).

  • 1: Hour
  • 2: Day
  • 3: Week
  • 4: Month
  • 5: Year

quota_reuse_cycle_type

Integer

-

Reset period type. This field is valid only when quota_reuse_mode is set to 1 (Resettable).

  • 1: Reset by calendar period

    Indicates that the resource package is reset by calendar month or calendar year. For example, if you set quota_reuse_cycle to 4 (month) and quota_reuse_cycle_type to 1, the resource package is reset on the first day of each month.

  • 2: Reset by order period

    Indicates that the resource package is reset by order period. For example, if you set quota_reuse_cycle to 4 (month), quota_reuse_cycle_type to 2, and you purchase this resource package on the 15th day of the month, then the resource package will be reset on the 15th day of each month.

usage_type_name

String

-

Usage type name.

start_time

String

-

Start time. The value is in UTC format.

  • If quota_reuse_mode is set to 1, the value is the start time of the reset period for the current time.
  • If quota_reuse_mode is set to 2, the value is the time when the purchased instance takes effect.

end_time

String

-

End time. The value is in UTC format.

  • If quota_reuse_mode is set to 1, the value is the end time of the reset period for the current time.
  • If quota_reuse_mode is set to 2, the value is the time when the purchased instance becomes invalid.

amount

BigDecimal

-

Remaining resource quota of a package whose quota_reuse_mode is Resettable, that is, the remaining resource quota in the current reset period.

original_amount

BigDecimal

-

Original resource quota of a package whose quota_reuse_mode is Resettable, that is, the total resource quota in each reset period.

measure_id

Integer

-

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

Example Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time 
{
    "free_resources": [
        {
            "free_resource_id": "d4463497-991b-439d-9ab6-23f9ed197fe9",
            "free_resource_type_name": "test1",
            "quota_reuse_cycle": 4,
            "quota_reuse_cycle_type": 1,
            "usage_type_name": "Duration",
            "start_time": "2021-04-30T03:30:56Z",
            "end_time": "2021-05-31T15:59:59Z",
            "amount": 100,
            "original_amount": 100,
            "measure_id": 37
        }
    ]
}

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