Partner CenterPartner Center

Compute
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
Domain Name Service
VPC Endpoint
Cloud Connect
Enterprise Switch
Security & Compliance
Anti-DDoS
Web Application Firewall
Host Security Service
Data Encryption Workshop
Database Security Service
Advanced Anti-DDoS
Data Security Center
Container Guard Service
Situation Awareness
Managed Threat Detection
Compass
Cloud Certificate Manager
Anti-DDoS Service
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GaussDB NoSQL
GaussDB(for MySQL)
Distributed Database Middleware
GaussDB(for openGauss)
Developer Services
ServiceStage
Distributed Cache Service
Simple Message Notification
Application Performance Management
Application Operations Management
Blockchain Service
API Gateway
Cloud Performance Test Service
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
DevCloud
ProjectMan
CodeHub
CloudRelease
CloudPipeline
CloudBuild
CloudDeploy
Cloud Communications
Message & SMS
Cloud Ecosystem
Marketplace
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP License Service
Support Plans
Customer Operation Capabilities
Partner Support Plans
Professional Services
enterprise-collaboration
Meeting
IoT
IoT
Intelligent EdgeFabric
DeveloperTools
SDK Developer Guide
API Request Signing Guide
Terraform
HCloud CLI
Updated at: Apr 27, 2022 GMT+08:00

Querying Customer's Pay-Per-Use Resources

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.

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

A maximum of 64 characters

Customer resource ID.

Queries information about a specified resource.

customerId

Yes

String

A maximum of 64 characters

Customer account ID. For details about how to obtain the customer account ID, see How Do I Obtain Customer's customer_id and domain_id Values?.

regionCode

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.

cloudServiceTypeCode

No

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.

resourceTypeCode

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.

resourceIds

No

List<Stirng>

A maximum of 50 IDs

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.

resourceName

No

String

A maximum of 64 characters

Resource instance name. Fuzzy search is not supported.

startTimeBegin

No

String

A maximum of 64 characters

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.

startTimeEnd

No

String

A maximum of 64 characters

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.

pageNo

No

Integer

An integer greater than or equal to 1

Current page number

The default value is 1.

pageSize

No

Integer

[1-100]

Number of records displayed on the current page. The default value is 10.

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

  • 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.

Status Code

Description

CBC.0000

Succeeded.

CBC.0999

Other errors.

CBC.0151

Access denied.

CBC.5004

You do not have the operation permission to the customer.

Did you find this page helpful?

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel