最近更新时间:2024.04.22 11:34:50
首次发布时间:2024.04.22 11:34:50
调用 AllocateDedicatedHosts 接口创建一台或多台包年包月的专有宿主机。
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | AllocateDedicatedHosts | 要执行的操作,取值:AllocateDedicatedHosts。 |
Version | String | 是 | 2020-04-01 | API的版本,取值: 2020-04-01。 |
ZoneId | String | 是 | cn-beijing-a | 专有宿主机所在可用区ID。 您可以调用DescribeZones查询一个地域下的可用区信息。 |
AutoPlacement | String | 否 | Off | 专有宿主机是否加入自动部署资源池,取值:
创建实例操作请参见RunInstances。 |
ChargeType | String | 否 | PostPaid | 专有宿主机的计费类型,取值: PrePaid:包年包月。 |
Period | Integer | 否 | 12 | 购买资源的时长。 |
PeriodUnit | String | 否 | Month | 购买资源的时长单位。 |
AutoRenew | Boolean | 否 | true | 专有宿主机到期后是否自动续费。
|
AutoRenewPeriod | Integer | 否 | 1 | 每次自动续费的时长。
|
Count | Integer | 否 | 1 | 创建数量,取值范围:1~100。 |
CpuOvercommitRatio | Float32 | 否 | 4 | CPU超分比,用于提升DDH的可用vCPU数,一台DDH的可用vCPU数 = 物理CPU核数 * 2 * CPU超分比。
|
DedicatedHostName | String | 是 | dedicated-host | 专有宿主机的名称。
|
DedicatedHostTypeId | String | 是 | ecs.ddhr2s | 专有宿主机规格ID。可以通过DescribeDedicatedHostTypes接口获取。 |
Description | String | 否 | 用于测试的专有宿主机 | 专有宿主机的描述,默认值为空字符串。
|
DedicatedHostRecovery | String | 否 | On | 专有宿主机处于临时不可用(TempUnavailable)状态时,是否开启宕机自动迁移,取值:
|
ClientToken | String | 否 | 333456899ff**** | 保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。 |
DryRun | Boolean | 否 | false | 是否只预检此次请求。取值:
|
DedicatedHostMaintenance | String | 否 | - | 是否开启亚健康自动处理,取值:
|
ProjectName | String | 否 | project_a | 资源所属项目,默认为空。一个资源只能归属于一个项目。
|
Tags.N.Key | String | 否 | Tags.1.Key=k1&Tags.2.Key=k2 | 用户标签的标签键。
命名规则如下:
同一资源的标签键不允许重复。 |
Tags.N.Value | String | 否 | Tags.1.Value=v1&Tags.2.Value=v2 | 用户标签的标签值。
命名规则如下:
如果传入该参数,则必须先传入 |
名称 | 类型 | 示例值 | 说明 |
---|---|---|---|
DedicatedHostIds | String | dh-3tigy72q3u3vj0x2**** | 专有宿主机ID。 |
GET /?Action=AllocateDedicatedHosts&Version=2020-04-01&ZoneId=cn-beijing-a&DedicatedHostTypeId=ecs.ddhr2s&DedicatedHostName=dedicated-host&Count=1&ChargeType=PrePaid&Period=1&PeriodUnit=Month HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: ecs
{ "ResponseMetadata": { "RequestId": "202307141717540EC59BF6CDCC7C44****", "Action": "AllocateDedicatedHosts", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "DedicatedHostIds": [ "dh-3tigy72q3u3vj0x2****" ] } }
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Insufficient.Balance | The request is denied due to the lack of balance. | 账户余额不足。 |
400 | InvalidArgument | The specified argument is invalid. | 指定的参数不合法。 |
400 | InvalidAutoPlacement.Malformed | The specified AutoPlacement is malformed. | 指定的AutoPlacement不合法。 |
400 | InvalidChargeType.Malformed | The specified ChargeType is malformed. | 指定的计费类型不合法。 |
400 | InvalidCount.Malformed | The specified count is malformed. | 指定的参数Count不合法。 |
400 | InvalidCpuOvercommitRatio.Malformed | The specified CpuOvercommitRatio is malformed. | 指定的CPU超分比不合法。 |
400 | InvalidDedicatedHostName.Malformed | The specified DedicatedHostName is malformed. | 指定的DedicatedHostName不合法。 |
400 | InvalidDescription.Malformed | The specified Description is malformed. | 指定的描述不合法。 |
400 | InvalidPeriod.Malformed | The specified period is malformed. | 指定的计费周期不合法。 |
400 | InvalidPeriodUnit.Malformed | The specified PeriodUnit is malformed. | 指定的计费周期单位不合法。 |
400 | MissingParameter.DedicatedHostName | The required parameter DedicatedHostName is not supplied. | 参数DedicatedHostName不能为空。 |
400 | MissingParameter.DedicatedHostTypeId | The required parameter DedicatedHostTypeId is not supplied. | 参数DedicatedHostTypeId不能为空。 |
400 | MissingParameter.ZoneId | The required parameter ZoneId is not supplied. | 可用区ID不能为空。 |
400 | QuotaExceeded.MaximumDedicatedHosts | You've reached the limit on the number of dedicated hosts that you can allocate, please submit ticket to request an increase in quota. | 专有宿主机规格数量配额不足,请提工单申请提高配额。 |
400 | InvalidDedicatedHostRecovery.Malformed | The specified DedicatedHostRecovery is malformed. | 指定的DedicatedHostRecovery不合法。 |
400 | InvalidClientToken.Malformed | The specified ClientToken is malformed. | 指定的ClientToken不合法。 |
400 | IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. | 幂等参数不一致。 |
400 | InvalidDedicatedHostMaintenance.Malformed | The specified DedicatedHostMaintenance is malformed. | 指定的DedicatedHostMaintenance不合法。 |
404 | InvalidDedicatedHostType.NotFound | The specified DedicatedHostTypeId does not exist. | 指定的专有宿主机规格不存在。 |
404 | InvalidZone.NotFound | The specified zone does not exist. | 指定的可用区不存在。 |
412 | IdempotentProcessing | The request uses the same client token as a previous one that is still in process. | 先前的幂等请求仍在处理中,请稍后重试。 |
412 | DryRunOperation | Your request has been validated by the DryRunOperation. | 通过“DryRun”校验,您的请求已通过验证。 |
500 | Insufficient.DedicatedHostCapacity | There is not enough capacity to fulfill your request. | 当前资源不足,请稍后重试或选择其它专有宿主机规格。 |
500 | InternalError | An internal error has occurred. | 内部错误,请重试。如果多次尝试失败,请提交工单。 |