全部产品
Search
文档中心

云服务器 ECS:ModifyInstanceNetworkSpec - 修改ECS实例的带宽配置

更新时间:Mar 19, 2024

调用ModifyInstanceNetworkSpec修改ECS实例的带宽配置。当实例现有网络规格不满足要求时,可以通过修改实例的带宽配置提高网络性能。

接口说明

调用该接口时,您需要注意:

  • 自 2020 年 11 月 27 日起,创建和变配 ECS 实例时带宽峰值受账户限速策略影响。如需更大带宽峰值,请提交工单。具体限速策略如下:

    • 单个地域下,所有按使用流量计费 ECS 实例的实际运行带宽峰值总和不大于 5 Gbit/s。
    • 单个地域下,所有按固定带宽计费 ECS 实例的实际运行带宽峰值总和不大于 50 Gbit/s。
  • 修改包年包月(PrePaid)实例的带宽配置时,公网出带宽(InternetMaxBandwidthOut)从 0 Mbit/s 升级到一个非零值时会自动分配一个公网 IP。

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

  • 对于经典网络(Classic)类型实例,当公网出带宽(InternetMaxBandwidthOut)从 0 Mbit/s 升级到一个非零值时,实例必须处于已停止(Stopped)状态。

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

  • 修改带宽配置前后的价格差退款会退还到您的原付费方式中,已使用的代金券不退回。

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ecs:ModifyInstanceNetworkSpecWrite
  • Instance
    acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
  • ecs:tag

请求参数

名称类型必填描述示例值
InstanceIdstring

需要修改网络配置的实例 ID。

i-bp67acfmxazb4****
InternetMaxBandwidthOutinteger

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

10
InternetMaxBandwidthIninteger

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

  • 当所购公网出带宽小于等于 10 Mbit/s 时:1~10,默认为 10。
  • 当所购公网出带宽大于 10 Mbit/s 时:1~InternetMaxBandwidthOut的取值,默认为InternetMaxBandwidthOut的取值。
10
ISPstring
说明 该参数正在邀测中,暂未开放使用。
null
NetworkChargeTypestring

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

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

是否分配公网 IP 地址。

默认值:false

false
StartTimestring

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

2017-12-05T22:40Z
EndTimestring

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

说明 临时升级带宽的结束时间和开始时间的间隔必须大于或等于 3 小时。
2017-12-06T22Z
AutoPayboolean

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

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

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

默认值:true

true
ClientTokenstring

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

123e4567-e89b-12d3-a456-426655440000

返回参数

名称类型描述示例值
object
OrderIdstring

生成的订单 ID。

123457890
RequestIdstring

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

示例

正常返回示例

JSON格式

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

错误码

HTTP status code错误码错误信息描述
400InvalidInternetMaxBandwidthIn.ValueNotSupportedThe specified InternetMaxBandwidthIn is beyond the permitted range.指定的公网入方向最大带宽超出允许值。
400InvalidInternetMaxBandwidthOut.ValueNotSupportedThe specified InternetMaxBandwidthOut is beyond the permitted range.指定的公网出方向最大带宽超出允许值。
400OperationDeniedSpecified instance is in VPC.指定实例存在于 VPC。
400InvalidParameter.Conflict%s您输入的参数无效,请检查参数之间是否冲突。%s为变量,将根据调用API的实际情况动态返回错误信息。
400InvalidStartTime.ValueNotSupportedThe specified StartTime is out of the permitted range.指定的开始时间不在允许范围内。
400InvalidEndTime.ValueNotSupportedThe specified EndTime is out of the permitted range.指定的 EndTime 超过限制。
400ChargeTypeViolationThe operation is not permitted due to billing method of the instance.实例的计费方式不支持该操作。
400InvalidStartTime.ValueNotSupported%s指定的开始时间不能早于当前时间。
400Account.ArrearageYour account has an outstanding payment.您的账号存在未支付的款项。
400InvalidEndTime.ValueNotSupported%s-
400InvalidInternetChargeType.ValueNotSupportedThe specified InternetChargeType is invalid.指定的参数 InternetChargeType 无效。
400DecreasedBandwidthNotAllowed%s降低带宽操作无效。
400BandwidthUpgradeDenied.EipBoundInstanceThe specified VPC instance has bound EIP, temporary bandwidth upgrade is denied.该实例已经绑定 EIP,不能进行临时升级。
400InvalidClientToken.ValueNotSupportedThe ClientToken provided is invalid.指定的 ClientToken 不合法。
400ThrottlingRequest was denied due to request throttling, please try again after 5 minutes.您当前的请求被流控,请5分钟后重试。
400InvalidInstanceStatus.NotStoppedThe specified Instance status is not Stopped.指定实例的状态不是已停止。
400InvalidActionSpecified action is not valid.该操作无效。
400IpAllocationErrorAllocate public ip failed.公网 IP 地址分配失败。
400InvalidParam.AllocatePublicIpThe specified param AllocatePublicIp is invalid.指定的 AllocatePublicIp 无效。
400InstanceDowngrade.QuotaExceedQuota of instance downgrade is exceed.您的实例降配已超额度,无法进行此操作。
400InvalidBandwidth.ValueNotSupportedInstance upgrade bandwidth of temporary not allow less then existed.临时宽带升级带宽不能低于已有带宽。
400InvalidInstanceStatusThe specified instance status does not support this action.实例的当前状态不支持该操作。
400InvalidInstance.UnPaidOrderUnpaid order exists in your account, please complete or cancel the payment in the expense center.您的账号里有未支付的订单,请处理后重试。
400OperationDeniedAfter downgrade, you cannot upgrade or downgrade your instances again in the remaining time of the current billing cycle.降配后,您将无法在当前结算周期的剩余时间内再次升级或降级实例配置。
400InvalidInternetChargeType.ValueNotSupported%s暂不支持指定的网络计费方式,请确认相关参数是否正确。
400LastOrderProcessingThe previous order is still processing, please try again later.订单正在处理中,稍后重试。
400OperationDeniedThe current user does not support this operation.您使用的账号暂不支持此操作。
400LastRequestProcessingThe previous request is still processing, please try again later.-
400InvalidStartTime.BeyondLifeCycleThe specified start time exceeds the expiration time.-
400InvalidEndTime.BeyondLifeCycleThe specified end time exceeds the expiration time.-
400InvalidPayMethod.SyncPaymentNotSupportSynchronous payment is not supported. Use another payment method.-
400InvalidBandwidthOut.LessThanZeroThe bandwidth must be larger than 0 when specifying isp.-
400InvalidParameter.BandwidthBiggerThanBaseBandwidth%s-
400InvalidAction.WithActiveElasticUpgradeThe instance has active Elastic Upgrade.指定的实例为临时升级中(即调用ModifyPrepayInstanceSpec时设置了EndTime参数)的实例,暂不支持查询。
400InvalidParameter.CloudboxNotSupported%s-
400InvalidParameter.Bandwidth%s指定的带宽无效,请检查参数是否正确。
400NoPermission.PriceThe operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true.-
400NoPermission.RefundThe operation requires refund permission. Please apply for permission from your main account.-
400InvalidParameter.DedicatedRegionNotSupportedThe specified action is rejected because the specified ECS instance in the dedicated region does not support public IP.专属云地域不支持的参数错误码
400InvalidOperation.InstanceStatusUnsupportedThe specified instance status is not supported for this operation, expect status is Running or Stopped.指定的实例的状态不满足,实例的状态须为 Running 或 Stopped。
403IncorrectInstanceStatusThe current status of the instance does not support this operation.当前实例状态不支持此操作。
403InstanceLockedForSecurityThe specified operation is denied as your instance is locked for security reasons.实例被安全锁定。
403InstanceExpiredOrInArrearsThe specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).实例已过期或者欠费,请您续费或者结清后再进行操作。
403OperationDeniedThe operation is denied due to the instance is PrePaid.包年包月的实例不支持此操作。
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.账号余额不足,请您先充值再进行该操作。
403InvalidInstance.UnPaidOrderThe specified Instance has unpaid order.指定的实例有未支付的订单,请您先支付再进行操作。
403InvalidInstance.InstanceNotSupportedThe special vpc instance with eip not need bandwidth.VPC 类型实例绑定 EIP 后不需要指定公网带宽。
403InvalidInstanceStatusThe current status of the instance does not support this operation.当前实例的状态不支持此操作。
403InvalidOperation.StarterPackageStarterPackage not support modification.-
403NAT_PUBLIC_IP_BINDING_FAILEDBinding nat public ip failed.-
403InvalidInstance.EipNotSupportThe specified instance with eip is not supported, please unassociate eip first.已绑定 EIP 的实例不支持该操作,请先解绑此EIP。
403InvalidInstance.NatPortMapNotSupportThe special instance with nat port map not support operate, please remove nat port map first.-
403OperationDenied.UnpaidOrderThe specified instance has unpaid order.指定的实例ID已存在未支付订单,您可以登录ECS管理控制台支付。
403Mayi.InternalErrorThe request processing has failed due to some unknown error.-
403InvalidNetworkType.ValueNotSupportedThe specified parameter NetworkType is not valid.指定的网络类型不合法。
403OperationDenied.ImageNotValidThe specified image is not authorized.您没有使用此镜像的权限。
403InvalidInstanceChargeType.ValueNotSupportedThe specified parameter ChargeType is not valid.-
403IncorrectInstanceStatusThe current status of the resource does not support this operation.该资源目前的状态不支持此操作。
403InvalidIspType.ValueNotSupported%s-
403UnsupportedIspChargeType%s-
403UnsupportedIspClassicNetwork%s-
403UnsupportedIspNetworkChargeType%s-
403InvalidIspBandwidthOut%s-
403UnsupportedChangeIsp%s-
403InvalidIspUID%s-
403UnsupportedIspRegion%s-
403BandIncreaseNotSupportIsp%s-
403SecurityRisk.3DVerificationWe have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.我们检测到您的默认信用卡或借记卡存在安全风险。请通过电子邮件中的链接进行验证。
403InvalidOperation.PublicIpAddressNoStockThe public IP address for the specified Region or ChargeType of the instance is out of stock. Please try another Region or ChargeType.在指定的地域或付费类型条件下,实例公网IP地址库存不足。请尝试使用其它地域或付费类型。
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.指定的实例ID未找到。
500InternalErrorThe request processing has failed due to some unknown error.内部错误,请重试。
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.内部错误,请重试。

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

变更历史

变更时间变更内容概要操作
2024-01-30OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 403 变更
    删除错误码:400
    删除错误码:404
    删除错误码:500
2024-01-08OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:500
2023-10-10OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
    删除错误码:500