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 Customer's Pay-Per-Use Resources

Querying Customer's Pay-Per-Use Resources

Updated on 2024-01-02 GMT+08:00

Function

A customer can query its provisioned pay-per-use resources on the partner sales platform. The data obtained using this API is for reference only because it has a delay, and the delay for each cloud service is different.

Note:

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

NOTE:

This API will be brought offline. For details about the API for querying a customer's pay-per-use resources, see Querying Customer's Pay-Per-Use Resources.

URI

POST /v1.0/{partner_id}/partner/customer-mgr/customer-resource/query-resources

Table 1 describes the parameters.

Table 1 URI parameters

Parameter

Mandatory

Maximum Length of Characters

Description

partner_id

Yes

A maximum of 64 characters

Partner ID (assigned by Huawei).

For details about how to obtain the partner ID, see How Do I Check the Partner ID?

Request

Request Parameters

Parameter

Mandatory

Type

Maximum Length of Characters/Value Range

Description

customerResourceId

No

String

[1-64]

Customer resource ID.

Queries information about a specified resource.

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

customerId

Yes

String

[1-64]

Customer account ID. For details, see How Do I Obtain Customer's customer_id and domain_id Values?

regionCode

No

String

[1-64]

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 or is set to null, it cannot be used as a filter criterion. It cannot be set to "".

cloudServiceTypeCode

No

String

[1-64]

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.

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

resourceTypeCode

No

String

[1-64]

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 in the request parameters or is set to null, it cannot be used as a filter criterion. It cannot be set to "".

resourceIds

No

List<Stirng>

[0-50]

Resource ID query in batches.

This parameter is used to query the resource of a specified ID.

A maximum of 50 IDs can be configured at a time.

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

resourceName

No

String

[1-64]

Resource instance name.

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

startTimeBegin

No

String

[1-64]

Start time of the validity period.

UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

The range of HH is 0-23, and the range of mm and ss is 0-59.

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

startTimeEnd

No

String

[1-64]

End time of the validity period.

UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

The range of HH is 0-23, and the range of mm and ss is 0-59.

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

pageNo

No

Integer

An integer greater than or equal to 1

Current page number

The default value is 1.

If this parameter is not included in the request parameters, is set to "", or is set to null, the value 1 is used.

pageSize

No

Integer

[1-100]

Number of records displayed on the current page. 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.

Example Request

POST https://bss-intl.myhuaweicloud.com/v1.0/{partner_id}/partner/customer-mgr/customer-resource/query-resources HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

{
    "customerId": "3d2c6b3ab1fd4e26846b0f2c46e67bda",
    "regionCode": "cn-north-1",
    "cloudServiceTypeCode": "hws.service.type.ebs",
    "resourceTypeCode": "hws.resource.type.volume",
    "resourceIds":["71e3eeb5-4b77-44ae-9c42-119ee7976cf7","39d90d01-4774-4af6-8136-83ba5732bccf"],
    "startTimeBegin": "2018-06-01T11:00:00Z",
    "startTimeEnd":"2018-06-30T11:00:00Z"
}

Response

Response Parameters

Parameter

Type

Description

error_code

String

Error code. For details, see Status Code.

error_msg

String

Error description.

customerResources

List<CustomerResource>

Customer resources.

For details, see Table 2.

totalCount

Integer

Total number of queries.

Table 2 CustomerResource

Parameter

Type

Description

customerResourceId

String

Customer resource ID.

customerId

String

Customer ID.

regionCode

String

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

azCode

String

AZ code.

cloudServiceTypeCode

String

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.

resourceTypeCode

String

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.

resourceId

String

Resource ID.

resourceName

String

Resource instance name.

startTime

String

Effective time.

UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

The range of HH is 0-23, and the range of mm and ss is 0-59.

endTime

String

Expiration time.

UTC time in "yyyy-MM-dd'T'HH:mm:ss'Z'" format, for example, 2019-05-06T08:05:01Z.

The range of HH is 0-23, and the range of mm and ss is 0-59.

status

Integer

Resource status.

  • 1: Normal (provisioned)
  • 2: Grace period
  • 3. Freezing
  • 4: Changing
  • 5: Canceling
  • 6: Canceled

resourceSpecCode

String

Specification code of the pay-per-use resource.

resourceInfo

String

Resource capacity

Format: "resourceInfo": "{\"specSize\":40.0}"

chargingModeChangeFlag

String

Whether the pay-per-use billing can be changed to yearly/monthly billing.

  • 0: No
  • 1: Yes
NOTE:

This parameter has been discarded.

lastDeductType

String

Account type of the last deduction for the resource. The value can be:

  • 0: HUAWEI CLOUD account that the customer directly tops up.
  • 1: Account that the customer receives the budget configured by the partner.
  • If this parameter is left empty, no fee is deducted for the resource.

Example Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time 

{
  "totalCount": 2,
  "customerResources": [
    {
      "customerResourceId": "745b8963bb75409bb35f10d0e9c5cdf0",
      "customerId": "3d2c6b3ab1fd4e26846b0f2c46e67bda",
      "regionCode": "cn-north-1",
      "azCode": null,
      "cloudServiceTypeCode": "hws.service.type.ebs",
      "resourceTypeCode": "hws.resource.type.volume",
      "resourceId": "39d90d01-4774-4af6-8136-83ba5732bccf",
      "resourceName": null,
      "startTime": "2018-06-11T20:00:00Z",
      "endTime": null,
      "status": 3,
      "resourceSpecCode": "SAS",
      "resourceInfo": "{\"specSize\":50.0}",
      "chargingModeChangeFlag": "0",
      "lastDeductType": "1"
    },
    {
      "customerResourceId": "4d46e052379941d3b0d6cf34697b8ce7",
      "customerId": "3d2c6b3ab1fd4e26846b0f2c46e67bda",
      "regionCode": "cn-north-1",
      "azCode": null,
      "cloudServiceTypeCode": "hws.service.type.ebs",
      "resourceTypeCode": "hws.resource.type.volume",
      "resourceId": "71e3eeb5-4b77-44ae-9c42-119ee7976cf7",
      "resourceName": null,
      "startTime": "2018-06-11T20:00:00Z",
      "endTime": null,
      "status": 3,
      "resourceSpecCode": "SATA",
      "resourceInfo": "{\"specSize\":50.0}",
      "chargingModeChangeFlag": "0",
      "lastDeductType": "1"
    }
  ],
  "error_code": "CBC.0000",
  "error_msg": "success"
}

Status Code

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

200

CBC.0000

Succeeded.

500

CBC.0999

Other errors.

400

CBC.0100

Incorrect parameter.

403

CBC.0151

Access denied.

200

CBC.5004

You do not have the operation permission to the customer.

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