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
Help Center> Partner Center> API Reference> API to Be Brought Offline> Product Management> Querying Product information> Querying Product Prices Based on the Product Specifications (Old)
Updated at: Apr 27, 2022 GMT+08:00

Querying Product Prices Based on the Product Specifications (Old)

Function

The partner sales platform obtains the product prices on the HUAWEI CLOUD official website based on the product catalog.

Precautions:

URI

POST /v1.0/{domain_id}/customer/product-mgr/query-rating

Table 1 describes the parameters.

Table 1 URI parameters

Parameter

Mandatory

Maximum Length of Characters

Description

domain_id

Yes

A maximum of 64 characters

  • The value is the partner ID if the partner's AK/SK or token is used. For details about how to obtain the partner ID, see How Do I Check the Partner ID?.
  • The value is the customer account ID if the customer's AK/SK or token is used. For details about how to obtain the customer account ID, see Querying Customers.

Request

Request Parameters

Parameter

Mandatory

Type

Maximum Length of Characters

Description

tenantId

Yes

String

A maximum of 128 characters

Project ID.

If the customer AK/SK or token is used, invoke the API to obtain the project ID of the target region. For details, see Obtaining a User Token with the assume_role Method. For details, see Step 2 in How Can I Replace a Partner Token with a Customer Token.

If the partner's AK/SK or token is used, follow the instructions described in How Do I Check the Partner ID? to go to the My Credentials page and query the project IDs of each region on the project list tab.

regionId

Yes

String

A maximum of 128 characters

Region ID.

The value is the same as the value in the Region column of the corresponding cloud service obtained from the Regions and Endpoints page.

avaliableZoneId

No

String

A maximum of 128 characters

AZ ID.

chargingMode

Yes

Integer

[0|1|2|10]

Billing mode. The options are as follows:

  • 0: Yearly/monthly
  • 1: Pay-per-use
  • 2: One-off (After an order is placed, the one-off service is provided. The service ends when it is complete, such as security expert service and hardware installation.)
  • 10: Reserved instance

periodType

No

Integer

[0-5]

Subscription period type. The value can be:

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

When periodType is set to 5, the period type of the additional product is determined by the value of relativeResourcePeriodType.

This parameter is mandatory for the yearly/monthly billing mode.

periodNum

No

Integer

[1-Maximum integer]

Number of subscription periods.

This parameter is mandatory when chargingMode is 0 and periodType is not 5.

periodEndDate

No

String

A maximum of 40 characters

Time when a resource expires.

For example, set the value to the expiration date of the ECS or shared bandwidth when you need to add an EVS disk for an ECS charged in yearly/monthly mode or add an EIP for a shared bandwidth billed in yearly/monthly mode.

This parameter is mandatory when chargingMode is 0 and periodType is 5.

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

HH ranges from 0 to 23, and mm and ss range from 0 to 59.

If this parameter is left blank, the current time is used by default.

relativeResourceId

No

String

A maximum of 64 characters

Associated resource ID.

For example, set the value to the ECS or shared bandwidth instance ID when you need to add an EVS disk for an ECS charged in yearly/monthly mode or add an EIP for a shared bandwidth billed in yearly/monthly mode.

relativeResourcePeriodType

No

Integer

[0-4]

Period type of the associated resource. The options are as follows:

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

This parameter is mandatory if relativeResourceId is specified.

subscriptionNum

Yes

Integer

[1-10000]

Specifies the number of subscribed offerings.

Reserved field. The default value is 1.

productInfos

Yes

List<ProductInfo>

-

Product information.

For details, see Table 2.

inquiryTime

No

String

A maximum of 40 characters

Inquiry date.

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

If this parameter is left blank, the current time is used by default.

Table 2 ProductInfo

Parameter

Mandatory

Type

Maximum Length of Characters

Description

id

Yes

String

A maximum of 128 characters

ID.

The ID is used to identify the mapping between the response and the request and must be unique in a price query.

cloudServiceType

Yes

String

A maximum of 400 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.

resourceType

Yes

String

A maximum of 400 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.

resourceSpecCode

Yes

String

A maximum of 400 characters

Specification of a cloud service resource. For example, a VM resource specification is s2.small.1.linux (.win or .linux should be added at the end of the specification).

resourceSize

No

Integer

[1-Maximum integer]

Resource capacity. The parameter is used with resouceSizeMeasureId.

For example, it can be the size of the purchased disk or bandwidth.

resouceSizeMeasureId

No

Integer

-

Resource capacity measurement ID. The options are as follows:

  • 15: Mbit/s (used when the bandwidth is subscribed)
  • 17: GB (used when an EVS disk is subscribed to)

usageFactor

No

String

A maximum of 400 characters

Usage factor

This parameter is mandatory when chargingMode is set to 1.

The value is the same as the usage factor in SDRs. The mappings between cloud services and usage factors are as follows:

  • ECS: Duration
  • EVS: Duration
  • EIP: Duration
  • Bandwidth: Duration (by bandwidth) or upflow (by traffic)
  • Marketplace image: Duration

usageValue

No

Double

Maximum value: 99999999999

Usage value.

This parameter is mandatory when chargingMode is set to 1.

For example, if you want to inquire a product price by hour, set usageValue to 1 and usageMeasureID to 4 (hour).

usageMeasureId

No

Integer

-

Usage measurement ID.

This parameter is mandatory when chargingMode is set to 1.

For example, if you want to inquire a product price by hour, set usageValue to 1 and usageMeasureID to 4 (hour).

The options are as follows:

  • 4: Hour
  • 10: GB. The bandwidth usage is measured by traffic (GB).
  • 11: MB. The bandwidth usage is measured by traffic (MB).
  • 13: Byte. The bandwidth usage is measured by traffic (byte).

extendParams

No

String/JSON

A maximum of 10240 characters

Specifies the extended parameter, which is optional.

Example Request

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

{
    "regionId": "cn-north-1",
    "tenantId": "74******cf27",
    "chargingMode": 0,
    "periodType": 2,
    "periodNum": 1,
    "subscriptionNum": 1,
    "periodEndDate": "",
    "productInfos": [
        {
            "id": "1",
            "cloudServiceType": "hws.service.type.ec2",
            "resourceType": "hws.resource.type.vm",
            "resourceSpecCode": "s2.small.1.linux"
        },
        {
            "id": "2",
            "cloudServiceType": "hws.service.type.ebs",
            "resourceType": "hws.resource.type.volume",
            "resourceSpecCode": "SATA",
            "resourceSize": 1,
            "resouceSizeMeasureId": 17
        },
        {
            "id": "3",
            "cloudServiceType": "hws.service.type.vpc",
            "resourceType": "hws.resource.type.ip",
            "resourceSpecCode": "5_bgp"
        },
        {
            "id": "4",
            "cloudServiceType": "hws.service.type.vpc",
            "resourceType": "hws.resource.type.bandwidth",
            "resourceSpecCode": "19_bgp",
            "resourceSize": 1,
            "resouceSizeMeasureId": 15
        }
    ],
    "inquiryTime": ""
}

Response

Response Parameters

Parameter

Type

Description

error_code

String

Error code.

For details, see Status Code.

error_msg

String

Error description.

ratingResult

RatingResult

Inquiry result.

For details, see Table 3.

Table 3 RatingResult

Parameter

Type

Maximum Length of Characters

Description

amount

Double

-

Total order amount (final order amount after discount)

discountAmount

Double

-

Discounted amount in an order.

originalAmount

Double

-

Original order amount (order amount before discount).

measureId

Integer

-

Specifies the measurement unit ID.

  • 1: Dollar
  • 2: Dime
  • 3: Cent

currency

String

A maximum of 10 characters

Currency unit code (complying with the ISO 4217 standard)

USD

If the parameter is left blank, USD is used.

productRatingResult

List<ProductRatingResult>

-

Product price inquiry result.

For details, see Table 4.

extendParams

String/JSON

A maximum of 1024 characters

Extension parameters.

Table 4 ProductRatingResult

Parameter

Type

Maximum Length of Characters

Description

id

String

A maximum of 36 characters

ID, which comes from the ID in the request.

productId

String

A maximum of 64 characters

Product ID.

amount

Double

-

Final price after the discount.

originalAmount

Double

-

Original total amount.

discountAmount

Double

-

Discounted amount

measureId

Integer

-

Measurement unit ID.

  • 1: Dollar
  • 2: Dime
  • 3: Cent

extendParams

String/JSON

A maximum of 1024 characters

Extension parameters.

Example Response

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

{
    "ratingResult": {
        "amount": 55.5,
        "discountAmount": 0,
        "originalAmount": 55.5,
        "measureId": 1,
        "currency": null,
        "extendParams": null,
        "productRatingResult": [
            {
                "id": "1",
                "productId": "00301-52002-0--0",
                "amount": 32.2,
                "discountAmount": 0,
                "originalAmount": 32.2,
                "measureId": 1,
                "extendParams": null
            },
            {
                "id": "2",
                "productId": "d5******24",
                "amount": 0.3,
                "discountAmount": 0,
                "originalAmount": 0.3,
                "measureId": 1,
                "extendParams": null
            },
            {
                "id": "3",
                "productId": "da27*****ce08",
                "amount": 0,
                "discountAmount": 0,
                "originalAmount": 0,
                "measureId": 1,
                "extendParams": null
            },
            {
                "id": "4",
                "productId": "605*****d4d8",
                "amount": 23,
                "discountAmount": 0,
                "originalAmount": 23,
                "measureId": 1,
                "extendParams": null
            }
        ]
    },
    "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.0100

Parameter error.

CBC.0151

Access denied.

CBC.6006

The required product cannot be found.

If this error is reported, check whether the values of cloudServiceType, resourceType, resourceSpecCode, and other parameters in productInfos are correct.

CBC.0999

Other errors.

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