ModifyInstanceNetworkSpec - 调整ECS实例带宽或分配公网IP

更新时间:
复制 MD 格式

修改ECS实例的带宽配置、分配公网IP、转换网络计费方式,支持升配和降配。

接口说明

  • 修改包年包月(PrePaid)实例的带宽配置时,公网出带宽(InternetMaxBandwidthOut)从 0 Mbit/s 升级到一个非零值时会自动分配一个公网 IP。

  • 修改按量付费(PostPaid)实例的带宽配置时,公网出带宽(InternetMaxBandwidthOut)从 0 Mbit/s 升级到一个非零值时不会自动分配公网 IP。您需要指定参数AllocatePublicIptrue分配公网 IP。

说明

单个地域下,单个阿里云账号按固定带宽计费的公网带宽峰值总和存在限制,请参见公网带宽限制

  • 费用:

    • 升级带宽后,默认自动扣费。您需要确保支付方式余额充足,否则会生成异常订单,此时只能作废订单。如果您的账户余额不足,可以将参数 AutoPay 置为 false,此时会生成正常的未支付订单,您可以登录 ECS 管理控制台支付。

    • 降低带宽后,价格差退款将原路退还,已使用的代金券不退回。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ecs:ModifyInstanceNetworkSpec

update

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

  • ecs:AssociatePublicIpAddress

请求参数

名称

类型

必填

描述

示例值

InstanceId

string

待修改网络配置的实例 ID。

i-bp67acfmxazb4****

InternetMaxBandwidthOut

integer

公网出带宽最大值,单位:Mbit/s(Megabit per second)。取值范围:

  • 按使用流量计费:0~100。

  • 按固定带宽计费:

    • 包年包月实例:0~200。

    • 按量付费实例:0~100。

说明

单实例出带宽峰值也会受到 ECS 实例规格的 网络带宽基础/突发(Gbit/s) 指标数据限制。更多信息,请参见实例规格族

10

InternetMaxBandwidthIn

integer

公网入带宽最大值,单位:Mbit/s(Megabit per second)。取值范围:

  • 当所购公网出带宽小于等于 10 Mbit/s 时:1~10,默认为 10。

  • 当所购公网出带宽大于 10 Mbit/s 时:1~InternetMaxBandwidthOut的取值,默认为InternetMaxBandwidthOut的取值。

10

ISP

string

说明

该参数正在邀测中,暂未开放使用。

null

NetworkChargeType

string

转换网络计费方式。取值范围:

  • PayByBandwidth:按固定带宽计费。

  • PayByTraffic:按使用流量计费。

说明

按使用流量计费模式下的出入带宽峰值都是带宽上限,不作为业务承诺指标。当出现资源争抢时,带宽峰值可能会受到限制。如果您的业务需要有带宽的保障,请使用按固定带宽计费模式。

PayByTraffic

AllocatePublicIp

boolean

是否分配公网 IP 地址。

  • true:分配。

  • false:不分配。

默认值:false。

false

StartTime

string

临时带宽升级开始时间。按照ISO 8601标准表示,并使用 UTC+0 时间,格式为 yyyy-MM-ddTHH:mmZ。精确到分钟(mm)。

2017-12-05T22:40Z

EndTime

string

临时带宽升级结束时间。按照ISO 8601标准表示,并使用 UTC+0 时间,格式为 yyyy-MM-ddTHHZ。精确到小时(HH)。

说明

临时升级带宽的结束时间和开始时间的间隔必须大于或等于 3 小时。

2017-12-06T22Z

AutoPay

boolean

是否自动支付。取值范围:

  • true:变更带宽配置后,自动扣费。当您将参数 Autopay 置为 true 时,您需要确保账户余额充足,如果账户余额不足会生成异常订单,此订单暂时不支持通过 ECS 控制台支付,只能作废。

  • false:变更带宽配置后,只生成订单不扣费。如果您的支付方式余额不足,可以将参数 Autopay 置为 false,即取消自动支付,此时调用该接口会生成正常的未支付订单,此订单可登录 ECS 管理控制台支付。

默认值:true。

true

ClientToken

string

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性

123e4567-e89b-12d3-a456-426655440000

返回参数

名称

类型

描述

示例值

object

OrderId

string

订单 ID。仅在修改包年包月(PrePaid)实例的带宽配置时返回。

123457890

RequestId

string

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

示例

正常返回示例

JSON格式

{
  "OrderId": "123457890",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidInternetMaxBandwidthIn.ValueNotSupported The specified InternetMaxBandwidthIn is beyond the permitted range. 指定的公网入方向最大带宽超出允许值。
400 InvalidInternetMaxBandwidthOut.ValueNotSupported The specified InternetMaxBandwidthOut is beyond the permitted range. 指定的公网出方向最大带宽超出允许值。
400 OperationDenied Specified instance is in VPC. 指定实例存在于 VPC。
400 InvalidParameter.Conflict %s 您输入的参数无效,请检查参数之间是否冲突。%s为变量,将根据调用API的实际情况动态返回错误信息。
400 InvalidStartTime.ValueNotSupported The specified StartTime is out of the permitted range.
400 InvalidEndTime.ValueNotSupported The specified EndTime is out of the permitted range.
400 ChargeTypeViolation The operation is not permitted due to billing method of the instance. 实例的计费方式不支持该操作。
400 Account.Arrearage Your account has an outstanding payment. 您的账号存在未支付的款项。
400 InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is invalid. 指定的参数 InternetChargeType 无效。
400 DecreasedBandwidthNotAllowed %s 降低带宽操作无效。
400 BandwidthUpgradeDenied.EipBoundInstance The specified VPC instance has bound EIP, temporary bandwidth upgrade is denied. 该实例已经绑定 EIP,不能进行临时升级。
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. 指定的 ClientToken 不合法。
400 Throttling Request was denied due to request throttling, please try again after 5 minutes. 您当前的请求被流控,请5分钟后重试。
400 InvalidInstanceStatus.NotStopped The specified Instance status is not Stopped.
400 InvalidAction Specified action is not valid. 该操作无效。
400 IpAllocationError Allocate public ip failed. 公网 IP 地址分配失败。
400 InvalidParam.AllocatePublicIp The specified param AllocatePublicIp is invalid. 指定的 AllocatePublicIp 无效。
400 InstanceDowngrade.QuotaExceed Quota of instance downgrade is exceed. 您的实例降配已超额度,无法进行此操作。
400 InvalidBandwidth.ValueNotSupported Instance upgrade bandwidth of temporary not allow less then existed. 临时宽带升级带宽不能低于已有带宽。
400 InvalidInstanceStatus The specified instance status does not support this action. 实例的当前状态不支持该操作。
400 InvalidInstance.UnPaidOrder Unpaid order exists in your account, please complete or cancel the payment in the expense center. 您的账号里有未支付的订单,请处理后重试。
400 LastOrderProcessing The previous order is still processing, please try again later. 订单正在处理中,稍后重试。
400 LastRequestProcessing The previous request is still processing, please try again later.
400 InvalidStartTime.BeyondLifeCycle The specified start time exceeds the expiration time. 指定的开始时间StartTime大于资源的过期时间
400 InvalidEndTime.BeyondLifeCycle The specified end time exceeds the expiration time. 结束时间参数(EndTime)超出了资源的生命周期。
400 InvalidPayMethod.SyncPaymentNotSupport Synchronous payment is not supported. Use another payment method.
400 InvalidBandwidthOut.LessThanZero The bandwidth must be larger than 0 when specifying isp.
400 InvalidParameter.BandwidthBiggerThanBaseBandwidth %s
400 InvalidAction.WithActiveElasticUpgrade The instance has active Elastic Upgrade.
400 InvalidParameter.CloudboxNotSupported %s
400 InvalidParameter.Bandwidth %s 指定的带宽无效,请检查参数是否正确。
400 NoPermission.Price The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. 该操作需要价格权限。请向您的主账户申请权限,或将参数AutoPay设置为true进行自动支付。
400 NoPermission.Refund The operation requires refund permission. Please apply for permission from your main account. 该账号无权限操作退款,主账号需要授权退款相关权限。
400 InvalidParameter.DedicatedRegionNotSupported The specified action is rejected because the specified ECS instance in the dedicated region does not support public IP. 专属云地域不支持的参数错误码
400 InvalidOperation.InstanceStatusUnsupported The specified instance status is not supported for this operation, expect status is Running or Stopped. 指定的实例的状态不满足,实例的状态须为 Running 或 Stopped。
400 QuotaExceeded.InternetBandwidth %s. 您当前账号下,按量付费ECS实例的按固定带宽计费公网带宽超过了总带宽配额限制。
400 UnsupportedIspNetworkChargeType The network charge type is not supported when specifying ISP. 此实例的网络计费类型不支持指定 ISP
400 IncorrectInstanceStatus Current instance status does not support this operation. 当前实例状态不支持此操作。
400 TaskConflict The operation is too frequent, please wait a moment and try again. 操作过于频繁,请稍等一会再重试
400 InvalidOperation.InternetMaxBandwidthOutUnsupported The InternetMaxBandwidthOut is not allowed to modify. 您的账号已欠费,不允许修改公网出带宽最大值。
500 InternalError The request processing has failed due to some unknown error.
500 Image.OrderFailed Create marketplace image order failed. 创建镜像市场订单失败。
403 IncorrectInstanceStatus The current status of the instance does not support this operation.
403 InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 实例被安全锁定。
403 InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).
403 ChargeTypeViolation The operation is not permitted due to billing method of the instance.
403 OperationDenied The operation is denied due to the instance is PrePaid. 包年包月的实例不支持此操作。
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance.
403 InvalidInstance.UnPaidOrder The specified Instance has unpaid order.
403 Throttling Request was denied due to request throttling, please try again after 5 minutes.
403 InvalidInstance.InstanceNotSupported The special vpc instance with eip not need bandwidth. VPC 类型实例绑定 EIP 后不需要指定公网带宽。
403 InstanceDowngrade.QuotaExceed Quota of instance downgrade is exceed.
403 InvalidInstanceStatus The current status of the instance does not support this operation. 当前实例的状态不支持此操作。
403 InvalidOperation.StarterPackage StarterPackage not support modification.
403 NAT_PUBLIC_IP_BINDING_FAILED Binding nat public ip failed.
403 InvalidInstance.EipNotSupport The specified instance with eip is not supported, please unassociate eip first. 已绑定 EIP 的实例不支持该操作,请先解绑此EIP。
403 InvalidInstance.NatPortMapNotSupport The special instance with nat port map not support operate, please remove nat port map first.
403 OperationDenied.UnpaidOrder The specified instance has unpaid order. 指定的实例ID已存在未支付订单,您可以登录ECS管理控制台支付。
403 Mayi.InternalError The request processing has failed due to some unknown error.
403 InvalidNetworkType.ValueNotSupported The specified parameter NetworkType is not valid.
403 OperationDenied.ImageNotValid The specified image is not authorized.
403 InvalidInstanceChargeType.ValueNotSupported The specified parameter ChargeType is not valid. 不合法的计费类型
403 InvalidIspType.ValueNotSupported %s
403 UnsupportedIspChargeType %s 付费类型不支持此账号的服务提供商(ISP)。
403 UnsupportedIspClassicNetwork %s
403 InvalidIspBandwidthOut %s
403 UnsupportedChangeIsp %s
403 InvalidIspUID %s
403 UnsupportedIspRegion %s
403 BandIncreaseNotSupportIsp %s ISP 实例不支持临时带宽升级
403 SecurityRisk.3DVerification We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. 我们检测到您的默认信用卡或借记卡存在安全风险。请通过电子邮件中的链接进行验证。
403 InvalidOperation.PublicIpAddressNoStock The public IP address for the specified Region or ChargeType of the instance is out of stock. Please try another Region or ChargeType. 在指定的地域或付费类型条件下,实例公网IP地址库存不足。请尝试使用其它地域或付费类型。
403 InvalidOperation.NetworkTypeUnsupported The specified network type is not supported in this region. 该指定网络类型在本地区不支持。
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的实例ID无效。
409 OperationConflict Request was denied due to conflict with a previous request,please try again later. 请求操作的资源与之前的请求冲突

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情