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
Help Center/ Resource Formation Service/ API Reference/ API/ Execution Plans/ Estimating the Price of an Execution Plan

Estimating the Price of an Execution Plan

Updated on 2024-12-20 GMT+08:00

Function

EstimateExecutionPlanPrice

This API queries the price of new resources in an existing execution plan. Currently, price inquiry is supported in the following billing modes: yearly/monthly, pay-per-use, and free. Other billing modes, such as spot pricing, do not support price inquiry.

Note:

  • Some resource attributes may contain default values and are related to price inquiry parameters. If they are not declared for the resources in your template, the inquiry result may be inaccurate.

    • The price inquiry result is an estimation for reference only.

    • If the depends_on variable is used in the template, for example, the mandatory fields for price inquiry of resource A depend on the creation of resource B, resource A does not support price query.

    • Price inquiry is not supported for when a data source's flavor.id is transferred.

  • Price inquiry is not supported for images.

  • Price inquiry is not supported for resource A if the required field "sensitive" of resource A is set to true.

    • Price inquiry is supported for a limited number of resources in the template. Currently, a maximum of 12 yearly/monthly-billed resources and 24 pay-per-use resources are supported.

    • Resources that support price inquiry and parameters required for price inquiry:

      • huaweicloud_cce_cluster:

        • Supported billing modes: yearly/monthly and pay-per-use

      • huaweicloud_css_cluster:

        • Supported billing mode: pay-per-use

      • huaweicloud_evs_volume:

        • Supported billing modes: yearly/monthly and pay-per-use

        • Parameter required for price inquiry: size (disk specifications)

      • huaweicloud_compute_instance:

        • Supported billing modes: yearly/monthly and pay-per-use

        • Parameters required for price inquiry: flavor_id, flavor_name (either flavor_id or flavor_name must be specified.), and system_disk_size.

      • huaweicloud_vpc_bandwidth:

        • Supported billing mode: pay-per-use

        • Parameter required for price inquiry: charge_mode supports only bandwidth.

      • huaweicloud_vpc_eip:

        • Supported billing modes: yearly/monthly and pay-per-use

        • Parameter required for price inquiry: bandwidth.size

      • huaweicloud_gaussdb_redis_instance:

        • Supported billing modes: yearly/monthly and pay-per-use

      • huaweicloud_nat_gateway:

        • Supported billing mode: pay-per-use

      • huaweicloud_rds_instance:

        • Supported billing modes: yearly/monthly and pay-per-use

        • Supported database type: MySQL, PostgreSQL, Microsoft SQL Server

      • huaweicloud_sfs_turbo:

        • Supported billing mode: pay-per-use

        • Parameter required for price inquiry: share_type (file system type)

      • huaweicloud_dms_kafka_instance:

        • Supported billing mode: pay-per-use

        • Parameters required for price inquiry: either flavor_id or product_id, and storage_space

      • huaweicloud_dcs_instance:

        • Supported billing modes: yearly/monthly and pay-per-use

      • huaweicloud_gaussdb_mysql_instance:

        • Supported billing modes: yearly/monthly and pay-per-use

        • Parameters required for price inquiry: proxy_node_number (number of proxy nodes) and volume_size (storage space of mounted volumes)

      • huaweicloud_vpc:

        • Supported billing mode: free

      • huaweicloud_drs_job:

        • Supported billing mode: pay-per-use

      • huaweicloud_apig_instance:

        • Supported billing mode: pay-per-use

URI

GET /v1/{project_id}/stacks/{stack_name}/execution-plans/{execution_plan_name}/prices

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

A project ID is obtained by calling an API or from the console.

Obtaining a Project ID

stack_name

Yes

String

A stack name is unique within its domain (domain_id), region, and project (project_id). It is case-sensitive and starts with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed.

execution_plan_name

Yes

String

An execution plan name is unique within its domain (domain_id), region, project (project_id), and stack (stack_id). It is case-sensitive and starts with a letter. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

stack_id

No

String

Unique stack ID.

It is a UUID generated by RFS when a stack is created.

Stack names are unique at one specific time, so you can create a stack named HelloWorld and another stack with the same name after deleting the first one.

For parallel development, team members may want to ensure that they are operating the stack they created, not one with the same name created by other members after deleting the previous one.

To avoid this mismatch, check the ID, since RFS ensures each stack has a unique ID that does not change with updates. If the stack_id value differs from the current stack ID, 400 is returned.

execution_plan_id

No

String

Unique execution plan ID.

A UUID is generated by RFS when an execution plan is created.

Execution plan names are unique at one specific time, so you can create an execution plan named HelloWorld and another execution plan with the same name after deleting the first one.

For parallel development, team members may want to ensure that they are operating the execution plan they created, not one with the same name created by other members after deleting the previous one.

To avoid this mismatch, check the ID, since RFS ensures each execution plan has a unique ID that does not change with updates. If the execution_plan_id value differs from the current execution plan ID, 400 is returned.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Client-Request-Id

Yes

String

A unique request ID is specified by a user to locate a request. UUID is recommended.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

currency

String

Currency, which can be:

  • USD: used on Huawei Cloud International website.

items

Array of ItemsResponse objects

Inquiry results of all resources in an execution plan.

Table 5 ItemsResponse

Parameter

Type

Description

resource_type

String

Resource type.

For example, in the following HCL template, the value of resource_type is huaweicloud_vpc.

resource "huaweicloud_vpc" "my_hello_world_vpc" {
  name = "test_vpc"
}

In a JSON template, the value of resource_type is huaweicloud_vpc.

{
  "resource": {
    "huaweicloud_vpc": {
      "my_hello_world_vpc": {
        "name": "test_vpc"
      }
    }
  }
}

resource_name

String

Resource name. The default value is the logical name of a resource.

For example, in the following HCL template, the value of resource_name is my_hello_world_vpc.

resource "huaweicloud_vpc" "my_hello_world_vpc" {
  name = "test_vpc"
}

In a JSON template, the value of resource_name is my_hello_world_vpc.

{
  "resource": {
    "huaweicloud_vpc": {
      "my_hello_world_vpc": {
        "name": "test_vpc"
      }
    }
  }
}

index

String

Resource index. If count or for_each is used in a template, index is returned. If index appears, resource_name and index can be used to identify a resource.

If count is used in a template, index is a number starting from 0.

For example, in the following HCL template, huaweicloud_vpc.my_hello_world_vpc[0] and huaweicloud_vpc.my_hello_world_vpc[1] identify two resources.

resource "huaweicloud_vpc" "my_hello_world_vpc" {
  count = 2
  name = "test_vpc"
}

In a JSON template, huaweicloud_vpc.my_hello_world_vpc[0] and huaweicloud_vpc.my_hello_world_vpc[1] identify two resources.

{
  "resource": {
    "huaweicloud_vpc": {
      "my_hello_world_vpc": {
        "name": "test_vpc",
        "count": 2
      }
    }
  }
}

If for_each is used in a template, index is a user-defined string.

For example, in the following HCL template, huaweicloud_vpc.my_hello_world_vpc["vpc1"] and huaweicloud_vpc.my_hello_world_vpc["vpc2"] identify two resources.

resource "huaweicloud_vpc" "my_hello_world_vpc" {
  for_each = {
    "vpc1" = "test_vpc"
    "vpc2" = "test_vpc"
  }
  name = each.value
}

In a JSON template, huaweicloud_vpc.my_hello_world_vpc["vpc1"] and huaweicloud_vpc.my_hello_world_vpc["vpc2"] identify two resources.

{
  "resource": {
    "huaweicloud_vpc": {
      "my_hello_world_vpc": {
        "for_each": {
          "vpc1": "test_vpc",
          "vpc2": "test_vpc"
        }
        "name": "${each.value}"
      }
    }
  }
}

module_address

String

Module address of the resource.

supported

Boolean

Whether price inquiry is supported for the resource or its variables.

unsupported_message

String

Causes for not supporting price inquiry.

resource_price

Array of ResourcePriceResponse objects

Price inquiry information of the resource.

If the resource supports yearly/monthly or pay-per-use billing, or the resource is free of charge, this field is returned. If the resource does not support price inquiry, this field is not returned.

Table 6 ResourcePriceResponse

Parameter

Type

Description

charge_mode

String

Billing mode.

  • PRE_PAID: yearly/monthly

  • POST_PAID: pay-per-use

  • FREE: free of charge

sale_price

Double

Final price of the resource (only website, commercial, and partner discounts are considered, and promotion discounts and coupons are excluded). The value is rounded up to two decimal places. The default currency is USD.

discount

Double

Total discounted price of the resource. The value is rounded up to two decimal places. The default currency is USD.

original_price

Double

Original price of the resource. The value is rounded up to two decimal places. The default currency is USD.

period_type

String

Billing unit.

If the resource supports yearly/monthly or pay-per-use billing, this field is returned. If the resource is free of charge, this field is not returned.

  • HOUR: hour, unit of the pay-per-use billing mode.

  • DAY: day, unit of the pay-per-use billing mode.

  • MONTH: month, unit of the yearly/monthly billing mode.

  • YEAR: year, unit of the yearly/monthly billing mode.

  • BYTE: byte, unit of the pay-per-use billing mode.

  • MB: megabyte, unit of the yearly/monthly and pay-per-use billing modes.

  • GB: gigabyte, unit of the yearly/monthly and pay-per-use billing modes.

period_count

Integer

Billed amount of the resource. This parameter must be used together with period_type.

If the resource is billed in yearly/monthly or pay-per-use mode, this field is returned. If the resource is free of charge, this field is not returned.

  • For pay-per-use resources, 1 is returned by default, indicating the price of the resource in one billing unit.

  • For yearly/monthly-billed resources, the value of this parameter is the same as that of the period field in the template.

best_discount_type

Integer

Max. discount type for the resource.

Options for pay-per-use resources:

Contract commercial discount: 605 (Huawei Cloud commercial discount - percentage off, fixed price, Huawei Cloud user) and 606 (channel-specific commercial discount - percentage off, fixed price, BP user)

Partner discount: 607 (Partner-authorized discount - percentage off)

Options for yearly/monthly resources:

Contract commercial discount: 605 (Huawei Cloud BE) and 606 (distributor BE)

Partner-authorized discount: 607

Promotional discount: 700

Included in the request response if the resource is eligible for a discount.

best_discount_price

Double

Max. discount, rounded up to two decimal places, in USD by default.

Included in the request response if the resource is eligible for a discount.

official_website_discount_price

Double

Discount amount available on the official website, rounded up to two decimal places, in USD by default.

Included in the request response if the resource is eligible for a discount amount listed on the official website.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 8 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 401

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 10 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 12 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 14 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 429

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 16 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Status code: 500

Table 17 Response body parameters

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

encoded_authorization_message

String

The message contains information about unauthorized requests.

details

Array of Detail objects

Detailed error messages returned by service when permission is denied.

Table 18 Detail

Parameter

Type

Description

error_code

String

Response code.

error_msg

String

Response message.

Example Requests

  • Estimate the price of an execution plan. The execution plan contains a new VPC resource.

    GET https://{endpoint}/v1/ba2b9930c977f71edaeaa3a5e96a8ff1/stacks/my_hello_world_stack/execution-plans/my_first_execution_plan/prices
  • Estimate the price of an execution plan. The execution plan contains a new VPC resource. A stack ID and an execution plan ID are provided to check whether they match the current stack and execution plan.

    GET https://{endpoint}/v1/ba2b9930c977f71edaeaa3a5e96a8ff1/stacks/my_hello_world_stack/execution-plans/my_first_execution_plan/prices?stack_id=ea6a4f0e-ee8a-494e-b12a-8be4a1e65af2&execution_plan_id=fb5e781e-a27d-46e2-9954-242753857a9f

Example Responses

Status code: 200

Price inquired.

  • {
      "currency" : "USD",
      "items" : [ {
        "resource_type" : "huaweicloud_vpc",
        "resource_name" : "vpc",
        "resource_price" : [ {
          "charge_mode" : "FREE",
          "discount" : 0,
          "original_price" : 0,
          "sale_price" : 0
        } ],
        "supported" : true
      } ]
    }

Status Codes

Status Code

Description

200

Price inquired.

400

Invalid request.

401

Authentication failed.

403

The user does not have the permission to call this API.

404

The execution plan does not exist.

429

Too frequent requests.

500

Internal server error.

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