調用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代碼示例。
授權信息
請求參數
名稱 | 類型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
InstanceId | string | 是 | 需要修改網絡配置的實例 ID。 | i-bp67acfmxazb4**** |
InternetMaxBandwidthOut | integer | 否 | 公網出帶寬最大值,單位:Mbit/s(Megabit per second)。取值范圍:0~100。 | 10 |
InternetMaxBandwidthIn | integer | 否 | 設置公網入帶寬最大值,單位:Mbit/s(Megabit per second)。取值范圍:
| 10 |
ISP | string | 否 | 說明
該參數正在邀測中,暫未開放使用。
| null |
NetworkChargeType | string | 否 | 轉換網絡計費方式。取值范圍:
說明
按使用流量計費模式下的出入帶寬峰值都是帶寬上限,不作為業務承諾指標。當出現資源爭搶時,帶寬峰值可能會受到限制。如果您的業務需要有帶寬的保障,請使用按固定帶寬計費模式。
| PayByTraffic |
AllocatePublicIp | boolean | 否 | 是否分配公網 IP 地址。 默認值:false | false |
StartTime | string | 否 | 臨時帶寬升級開始時間。按照 ISO8601 標準表示,并使用 UTC+0 時間,格式為 yyyy-MM-ddThh:mmZ。精確到分鐘(mm)。 | 2017-12-05T22:40Z |
EndTime | string | 否 | 臨時帶寬升級結束時間。按照 ISO8601 標準表示,并使用 UTC+0 時間,格式為 yyyy-MM-ddThhZ。精確到小時(hh)。 說明
臨時升級帶寬的結束時間和開始時間的間隔必須大于或等于 3 小時。
| 2017-12-06T22Z |
AutoPay | boolean | 否 | 是否自動支付。取值范圍:
默認值:true | true |
ClientToken | string | 否 | 保證請求冪等性。從您的客戶端生成一個參數值,確保不同請求間該參數值唯一。ClientToken 只支持 ASCII 字符,且不能超過 64 個字符。更多詳情,請參見如何保證冪等性。 | 123e4567-e89b-12d3-a456-426655440000 |
返回參數
示例
正常返回示例
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. | 指定的 EndTime 超過限制。 |
400 | ChargeTypeViolation | The operation is not permitted due to billing method of the instance. | 實例的計費方式不支持該操作。 |
400 | InvalidStartTime.ValueNotSupported | %s | 指定的開始時間不能早于當前時間。 |
400 | Account.Arrearage | Your account has an outstanding payment. | 您的賬號存在未支付的款項。 |
400 | InvalidEndTime.ValueNotSupported | %s | - |
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 | OperationDenied | After downgrade, you cannot upgrade or downgrade your instances again in the remaining time of the current billing cycle. | 降配后,您將無法在當前結算周期的剩余時間內再次升級或降級實例配置。 |
400 | InvalidInternetChargeType.ValueNotSupported | %s | 暫不支持指定的網絡計費方式,請確認相關參數是否正確。 |
400 | LastOrderProcessing | The previous order is still processing, please try again later. | 訂單正在處理中,稍后重試。 |
400 | OperationDenied | The current user does not support this operation. | 您使用的賬號暫不支持此操作。 |
400 | LastRequestProcessing | The previous request is still processing, please try again later. | - |
400 | InvalidStartTime.BeyondLifeCycle | The specified start time exceeds the expiration time. | - |
400 | InvalidEndTime.BeyondLifeCycle | The specified end time exceeds the expiration time. | - |
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. | 指定的實例為臨時升級中(即調用ModifyPrepayInstanceSpec時設置了EndTime參數)的實例,暫不支持查詢。 |
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. | - |
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實例的按固定帶寬計費公網帶寬超過了總帶寬配額限制。 |
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 | 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 | InvalidInstance.InstanceNotSupported | The special vpc instance with eip not need bandwidth. | VPC 類型實例綁定 EIP 后不需要指定公網帶寬。 |
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 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | 該資源目前的狀態不支持此操作。 |
403 | InvalidIspType.ValueNotSupported | %s | - |
403 | UnsupportedIspChargeType | %s | - |
403 | UnsupportedIspClassicNetwork | %s | - |
403 | UnsupportedIspNetworkChargeType | %s | - |
403 | InvalidIspBandwidthOut | %s | - |
403 | UnsupportedChangeIsp | %s | - |
403 | InvalidIspUID | %s | - |
403 | UnsupportedIspRegion | %s | - |
403 | BandIncreaseNotSupportIsp | %s | - |
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地址庫存不足。請嘗試使用其它地域或付費類型。 |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的實例ID未找到。 |
500 | InternalError | The request processing has failed due to some unknown error. | 內部錯誤,請重試。 |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 內部錯誤,請重試。 |
500 | Image.OrderFailed | Create marketplace image order failed. | 創建鏡像市場訂單失敗。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
變更時間 | 變更內容概要 | 操作 |
---|---|---|
2024-09-27 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |
2024-09-23 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |
2024-01-30 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |
2024-01-08 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |
2023-10-10 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |