Docs
api
UHost(UHost)
GetUHostInstancePrice

Get host price - GetUHostInstancePrice

Overview

Get the price of the UHost instance based on the UHost instance configuration.

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is GetUHostInstancePrice.Yes
PublicKeystringThe user’s public key can be obtained from ConsoleYes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesYes
ZonestringAvailability Zone. See Availability Zone ListNo
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
CPUintNumber of CPU cores. Optional parameters: 1-64. Refer to the control panel for optional range. Default value: 4Yes
MemoryintMemory size. Unit: MB. Range: [1024, 262144], must be a multiple of 1024 (optional range refers to the control panel). Default value: 8192Yes
CountintNumber of purchases, range [1,5]Yes
Disks.N.IsBootstringIs it a system disk. Enumeration value:

> True, it is a system disk

> False, it is a data disk (default). There can only be one disk in the Disks array that is a system disk.
Yes
Disks.N.SizeintDisk size, in GB. Please refer to Disk Type.Yes
Disks.N.TypestringDisk type. Please refer to Disk Type.Yes
Disks.N.BackupTypestringDisk Backup Plan. Enumerated values:

> NONE, no backup

> DATAARK, UDataArk

> SNAPSHOT, USnap

The backup modes currently supported by the disk refer to Disk Type”.
No
ImageIdstringImage Id, can be obtained through DescribeImage. If the Image Id is not provided, the system disk size must be provided.No
GPUintNumber of GPU card cores. Only GPU models support this field.No
ChargeTypestringBilling mode. Enumeration values are:

> Year, pay annually;

> Month, pay monthly;

> Dynamic, pay hourly // >Preemptive, preemptive instance

If a certain enumeration value is not passed, the default return is a combination of annual, monthly, and hourly prices.
No
NetCapabilitystringNetwork Enhancement. Enumeration values: Normal, not enabled; Super, enable Network Enhancement 1.0. The default value is Normal.No
UHostTypestring[To be deprecated] Cloud host machine type (V1 version concept). Refer to Cloud host machine type description.No
MachineTypestringCloud Host Type (Concept of V2 version). Enumeration values [“N”, “C”, “G”, “O”, “OS”, “OPRO”, “OMAX”, “O.BM”, “O.EPC”]. Refer to Cloud Host Type Description.No
GpuTypestringGPU type, enumeration values [“K80”, “P40”, “V100”, “T4”,“T4S”,“2080Ti”,“2080Ti-4C”,“1080Ti”, “T4/4”,“MI100”,“V100S”]No
QuantityintPurchase duration. Default: 1. This parameter is not required when purchasing hourly (Dynamic). When paying monthly, pass this parameter as 0, which represents purchase until the end of the month.No
CpuPlatformstringValue “Intel” “Amd”, default value “Intel”.No
UDSetUHostInstancebooleanDedicated Cloud Host. If you want to create a cloud host on a dedicated host, this parameter can be set to true.No
ShowPriceDetailsbooleanReturn detailed price informationNo

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
PriceSetarray[UHostPriceSet]Price List UHostPriceSetNo

Data Model

UHostPriceSet

Field NameTypeDescription InformationRequired
ChargeTypestringBilling Type. Yearly, Monthly, DynamicYes
PricefloatPrice, unit: Yuan, retain two valid digits after the decimal pointYes
OriginalPricefloatThe original price before the limited-time discount (i.e., the unit price after the list price is multiplied by the business discount).Yes
ListPricefloatProduct list price.No
PriceDetailPriceDetailDetailed price information (only returned by the inquiry interface).No
OriginalPriceDetailPriceDetailOriginal price details (only returned by the inquiry interface).No
ListPriceDetailPriceDetailDetailed list price information (only returned by the inquiry interface).No

PriceDetail

Field NameTypeDescription InformationRequired
UHostfloatHost PriceNo
UDiskfloatUDisk PriceNo
SnapshotfloatSnapshot PriceNo
VolumefloatVolume PriceNo

Example

Request Example

https://api.dezai.com/?Action=GetUHostInstancePrice
&Region=cn-bj2
&Zone=cn-bj2-04
&ProjectId=org-xxx
&ImageId=xxx
&MachineType=N
&CPU=2
&Memory=4096
&Count=1
&ChargeType=Dynamic
&Disks.0.Size=40
&Disks.0.IsBoot=True
&Disks.0.Type=CLOUD_SSD
&CpuPlatform=pmuJsysU
&Volumes.N.Type=asluorww
&Volumes.N.Size=3
&Volumes.N.IsBoot=eHeLEeHi
&HpcEnhanced=false
&GpuTyp=pmujj
&GPU=1
&UDSetUHostInstance=true
&ShowPriceDetails=true

Response Example

{
  "Action": "GetUHostInstancePriceResponse",
  "PriceSet": [
    {
      "ChargeType": "Dynamic",
      "Price": 0.42
    }
  ],
  "RetCode": 0
}