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 Packages (Old)

Updated on 2024-09-26 GMT+08:00

Function

This API is used to query resource packages.

NOTE:

This API will be taken offline. For details about the new API for querying resource packages, see Querying Resource Packages.

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.

URI

POST /v2/payments/free-resources/query

Table 1 Header parameter

Parameter

Mandatory

Value Range

Description

X-Language

No

A maximum of 10 characters

Language.

  • zh_CN: Chinese
  • en_US: English

Default value: zh_CN

If this parameter is not included in the request parameters or is left empty, the value zh_CN is used. This parameter cannot be set to "" or null.

Request

Request Parameters

Parameter

Mandatory

Type

Value Range

Description

region_code

No

String

A maximum of 64 characters

Cloud service region code, for example, ap-southeast-1. Obtain the value from the Region column in Regions and Endpoints.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

order_id

No

String

A maximum of 64 characters

Order ID.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

product_id

No

String

A maximum of 64 characters

Resource package ID.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

product_name

No

String

A maximum of 256 characters

Resource package name.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

enterprise_project_id

No

String

A maximum of 64 characters

Enterprise project ID.

This parameter is mandatory if you want to query the resources of an enterprise project.

If this parameter is not included in the request parameters, is set to "", or is set to null, the resources not included in the enterprise project are queried.

status

No

Integer

[0, 4]

Status:

  • 0: Not effective
  • 1: In effect
  • 2: Used up
  • 3: Expired
  • 4: Unsubscribed

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

offset

No

Integer

[0, 9999]

Page number. Enter N if you want to query the N page, for example, enter 1 to query the first page.

If you enter 0, the first page is queried by default.

If this parameter is not included in the request parameters, is set to "", or is set to null, the first page is queried by default. This parameter cannot be left empty.

limit

No

Integer

[1, 1000]

Number of records queried each time. The default value is 10.

If this parameter is not included in the request parameters, is set to "", or is set to null, the value 10 is used. This parameter cannot be left empty.

Example Request

POST https://bss-intl.myhuaweicloud.com/v2/payments/free-resources/query HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
{
    "region_code": "cn-north-7",
    "order_id": "CS21043011259RWXXTA",
    "product_id": "90301-296014-0--0",
    "product_name": "HUAWEI CLOUD WeLink",
    "enterprise_project_id": null,
    "status": 1,
    "offset": 0,
    "limit": 10
}
  

Response

Response Parameters

Parameter

Type

Value Range

Description

error_code

String

20

Error code.

For details, see Status Codes. 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_packages

List<FreeResourcePackage>

-

Resource package list. For details, see Table 2.

total_count

Integer

-

Total number of records.

Table 2 FreeResourcePackage

Parameter

Type

Value Range

Description

order_instance_id

String

A maximum of 64 characters

Identifier of a subscribed resource package.

order_id

String

A maximum of 64 characters

Order ID. If the value of source_type is 1, this parameter is left empty.

product_id

String

A maximum of 64 characters

Resource package ID.

product_name

String

A maximum of 256 characters

Resource package name.

enterprise_project_id

String

A maximum of 64 characters

Enterprise project ID.

enterprise_project_scope

Integer

[0, 1]

Enterprise projects for which resource packages are used:

  • 0: All enterprise projects
  • 1: Specific enterprise projects

effective_time

String

A maximum of 20 characters

Time when a resource package is purchased. The value is in UTC format.

expire_time

String

A maximum of 20 characters

Expiration time of a resource package. The value is in UTC format.

status

Integer

[0, 4]

Status:

  • 0: Not effective
  • 1: In effect
  • 2: Used up
  • 3: Expired
  • 4: Unsubscribed

service_type_code

String

A maximum of 64 characters

Cloud service type code. For example, the cloud service type code of OBS is hws.service.type.obs. To obtain a specific service type, call the API in Querying Cloud Service Types.

service_type_name

String

A maximum of 200 characters

Cloud service type. For example, the cloud service type of ECS is Elastic Cloud Server.

region_code

String

A maximum of 64 characters

Cloud service region code, for example, ap-southeast-1. Obtain the value from the Region column in Regions and Endpoints.

source_type

Integer

[0, 1]

Source of a resource package. The options are as follows:

  • 0: Order
  • 1: Gifted by DevCloud

bundle_type

String

[ATOMIC_PKG|BUNDLE_PKG]

Bundle binding type. The options are as follows:

  • ATOMIC_PKG: Atomic package
  • BUNDLE_PKG: Combined package

quota_reuse_mode

Integer

[1, 2]

Use model. The options are as follows:

  • 1: Resettable

    Indicates that the purchased resource package can be reset at a specified period. For example, if you purchase a 1-year 40 GB pay-per-use resource package with quota_reuse_mode set to 1 and quota_reuse_cycle to 4, then the resource package will be reset each month (you will get 40 GB resource each month) within the year.

  • 2: Not resettable

    Indicates that the purchased resource package will not be reset. For example, if you purchase a 1-year 40 GB pay-per-use resource package with quota_reuse_mode set to 2, the resource package will not be reset, and you will get 40 GB resource within the year.

free_resources

List<FreeResource>

-

For details about resource items (ID-specific) in a resource package, see Table 3.

Table 3 Free resources

Parameter

Type

Value Range

Description

free_resource_id

String

A maximum of 64 characters

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

usage_type_name

String

A maximum of 1024 characters

Usage type name.

amount

BigDecimal

A maximum of 64 characters

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

A maximum of 64 characters

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. You 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 
{
    "total_count": 1,
    "free_resource_packages": [
        {
            "order_instance_id": "01154-228300268-0",
            "order_id": "CS21043011259RWXXTA",
            "product_id": "90301-296014-0--0",
            "product_name": "HUAWEI CLOUD WeLink",
            "enterprise_project_id": null,
            "enterprise_project_scope": 0,
            "effective_time": "2021-04-30T03:30:56Z",
            "expire_time": "2021-05-31T15:59:59Z",
            "status": 1,
            "service_type_code": "hws.service.type.cpts",
            "region_code": "cn-north-7",
            "source_type": 0,
            "bundle_type": "ATOMIC_PKG",
            "quota_reuse_mode": 2,
            "free_resources": [
                {
                    "free_resource_id": "d4463497-991b-439d-9ab6-23f9ed197fe9",
                    "usage_type_name": "Duration",
                    "amount": 100,
                    "original_amount": 100,
                    "measure_id": 34
                }
            ]
        }
    ]
}

Status Codes

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

Parameter error.

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