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
Situation Awareness
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

Obtaining Task Pricing Details

Function

This API is used to query the task pricing details.

Constraints

This API can be used only in certain regions. For details, see Endpoints.

URI

GET /v5/{project_id}/jobs/{job_id}/metering

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details, see Obtaining a Project ID.

job_id

Yes

String

Task ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

It is a response to the API for obtaining a user token. This API is the only one that does not require authentication.

After a request is processed, the value of X-Subject-Token in the header is the token value.

X-Language

No

String

Request language type.

Default value: en-us

Enumerated values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

product_info_list

Array of objects

Resource information list.

For details, see Table 4.

Table 4 Data structure description of field product_info_list

Parameter

Type

Description

id

String

ID, which is used to identify the mapping between the inquiry result and the request and must be unique in an inquiry.

cloud_service_type

String

Specifies the service type code of the purchased product. For example, the service type code for EC2 is hws.service.type.ec2.

resource_type

String

Specifies the resource type code of the purchased product. For example, the resource type code for VMs in EC2 is hws.resource.type.vm.

resource_spec_code

String

Specifies the resource specifications code of the purchased product. For example, the value for VMs of the small specifications is m1.tiny.

resource_size

Integer

Resource capacity measurement ID.

resource_size_measure_id

Integer

Specifies the resource capacity. It can be the subscribed volume size or bandwidth size.

usage_factor

String

Specifies the usage factor. This parameter is mandatory for a pay-per-use task. The value is the same as the usage factor of SDRs. The mappings between cloud services and usage factors are as follows:

  • Duration: Cloud server
  • flow: traffic

usage_value

Double

Specifies the usage value. This parameter is mandatory for a pay-per-use task. For example, the resources are billed by hour, the usage value is 1, and the usage measurement unit is hour.

usage_measure_id

Integer

Specifies the usage measurement unit. This parameter is mandatory for a pay-per-use task. For example, the resources are billed by hour, the usage value is 1, and the usage measurement unit is hour.

  • 4: Hour
  • 10: GB
  • 11: MB
  • 13: Byte
  • 17: FLOW_GB

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum length: 12

Maximum length: 12

error_msg

String

Error message.

Minimum length: 1

Maximum length: 512

Example Request

Obtaining the task pricing details

https://{endpoint}/v5/{project_id}/jobs/{job_id}/metering

Example Response

Status code: 200

OK
{
  "product_info_list": [
    {
      "id": "78f3a9f1-3d8d-43f0-acc4-ee93f8a9d934",
      "cloud_service_type": "hws.service.type.drs",
      "resource_type": "hws.resource.type.drs.vm",
      "resource_spec_code": "drs.lg.dr",
      "resource_size": 1,
      "usage_factor": "Duration",
      "usage_value": 1,
      "usage_measure_id": 4
    },
    {
      "id": "f52a74ce-5b11-4c5b-b365-488d9fc38882",
      "cloud_service_type": "hws.service.type.drs",
      "resource_type": "hws.resource.type.drs.flow",
      "resource_spec_code": "drs.flow.free",
      "resource_size": 1,
      "usage_factor": "flow",
      "usage_value": 1,
      "usage_measure_id": 17
    }
  ]
}

Status code: 400

Bad Request

{
  "error_code": "DRS.M00202",
  "error_msg": "The value of parameter jobId is invalid."
}

Error Code

For details, see Error Code.

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