Help Center/ Huawei Cloud Flexus_Huawei Cloud Flexus L Instance/ API Reference/ API/ General O&M APIs/ Querying the Remaining Traffic of the Data Package in a FlexusL Instance
Updated on 2025-01-06 GMT+08:00

Querying the Remaining Traffic of the Data Package in a FlexusL Instance

Function

This API is used to query the remaining traffic of the data package in a FlexusL instance. This section lists the key information about API usage. For more information, see Viewing Resource Package Usage.

Constraints

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

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

Debugging

You can debug this API in API Explorer

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 Message

Table 2 Parameter description

Parameter

Mandatory

Type

Value Range

Description

free_resource_ids

Yes

List<string>

A maximum of 100 IDs

List of data package IDs of FlexusL instances. Each ID can contain a maximum of 64 bytes.

You can obtain the data package IDs by calling the API for querying a created FlexusL instance based on the logical_resource_type value that is huaweicloudinternal_cbc_freeresource.

Example Request

Query the remaining traffic of the data package whose ID is 828e2c7c-3c8c-45a2-bebc-98cb3e77d06e.

{
 "free_resource_ids": [
  "828e2c7c-3c8c-45a2-bebc-98cb3e77d06e"
 ]
}

Example Response

{
 "free_resources": [
  {
   "free_resource_id": "828e2c7c-3c8c-45a2-bebc-98cb3e77d06e",
   "free_resource_type_name": "Lightweight BGP data package",
   "quota_reuse_cycle": 4,
   "quota_reuse_cycle_type": 2,
   "usage_type_name": "Uplink traffic",
   "start_time": "2024-12-25T08:00:00Z",
   "end_time": "2025-01-25T16:00:00Z",
   "amount": 200,   //Rremaining traffic quota
   "original_amount": 200, //Original traffic quota
   "measure_id": 10
  }
 ]
}