呼叫 ModifyVpnGatewayAttribute 介面修改 VPN 閘道的名稱、描述資訊或路由自動傳播功能。
介面說明
- ModifyVpnGatewayAttribute 介面屬於非同步介面,即系統先返回 VPN 閘道的資訊,但該 VPN 閘道的設定尚未修改成功,系統後台的修改任務仍在進行。您可以呼叫 DescribeVpnGateway 查詢 VPN 閘道的設定的修改狀態:
當 VPN 閘道處於 updating 狀態時,表示 VPN 閘道的設定正在修改中。
當 VPN 閘道處於 active 狀態時,表示 VPN 閘道的設定修改成功。
ModifyVpnGatewayAttribute 介面不支援並行修改同一個 VPN 閘道的設定。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
vpc:ModifyVpnGatewayAttribute |
update |
*VpnGateway
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
VPN 閘道執行個體所在的地域 ID。您可以透過呼叫 DescribeRegions 介面取得地域 ID。 |
cn-hangzhou |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的冪等性。 從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。 說明
若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 不一樣。 |
123e4567-e89b-12d3-a456-4266**** |
| VpnGatewayId |
string |
是 |
VPN 閘道執行個體的 ID。 |
vpn-bp1q8bgx4xnkm2ogj**** |
| Name |
string |
否 |
VPN 閘道的新名稱。 長度為 2~100 個字元,不能以 |
myvpn |
| Description |
string |
否 |
VPN 閘道新的描述資訊。 描述資訊長度為 1~100 個字元。 |
test |
| AutoPropagate |
boolean |
否 |
是否開啟 VPN 閘道的路由自動傳播功能。取值:
|
true |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回結果。 |
||
| VpcId |
string |
VPN 閘道執行個體所屬 VPC 的 ID。 |
vpc-bp1ub1yt9cvakoel**** |
| Status |
string |
VPN 閘道的狀態。
|
active |
| InternetIp |
string |
|
116.62.XX.XX |
| Spec |
string |
VPN 閘道執行個體的頻寬規格。單位:Mbps。 |
5M |
| CreateTime |
integer |
VPN 閘道執行個體的建立時間戳記。單位:毫秒。 時間戳記的格式採用 Unix 時間戳記,表示從格林威治時間 1970 年 01 月 01 日 00 時 00 分 00 秒至建立 VPN 閘道執行個體時的總時長。 |
1492753580000 |
| AutoPropagate |
boolean |
BGP 路由是否自動傳播到 VPC。取值:
|
true |
| VpnGatewayId |
string |
VPN 閘道執行個體的 ID。 |
vpn-bp1q8bgx4xnkm2ogj**** |
| IntranetIp |
string |
系統部署 VPN 閘道執行個體時佔用的交換機私網 IP 位址。 僅支援單隧道模式 IPsec-VPN 連線的 VPN 閘道執行個體會返回當前參數,且該 VPN 閘道執行個體需已開啟 IPsec-VPN 功能。 |
172.16.10.46 |
| EndTime |
integer |
VPN 閘道執行個體的到期時間戳記。單位:毫秒。 時間戳記的格式採用 Unix 時間戳記,表示從格林威治時間 1970 年 01 月 01 日 00 時 00 分 00 秒至 VPN 閘道執行個體到期時的總時長。 |
1495382400000 |
| VSwitchId |
string |
VPN 閘道執行個體關聯的交換機 ID。 |
vsw-bp1y9ovl1cu9ou4tv**** |
| RequestId |
string |
請求 ID。 |
54B48E3D-DF70-471B-AA93-08E683A1B457 |
| Description |
string |
VPN 閘道執行個體的描述資訊。 |
test |
| EnableBgp |
boolean |
VPN 閘道 BGP 功能的開啟狀態。取值:
|
true |
| BusinessStatus |
string |
VPN 閘道執行個體的付費狀態。取值:
|
Normal |
| Name |
string |
VPN 閘道執行個體的名稱。 |
test |
| DisasterRecoveryInternetIp |
string |
系統為 VPN 閘道執行個體分配的用於建立 IPsec-VPN 連線的第二個 IP 位址。 僅支援建立雙隧道模式 IPsec-VPN 連線的 VPN 閘道執行個體會返回當前參數。 |
116.11.XX.XX |
| DisasterRecoveryVSwitchId |
string |
VPN 閘道執行個體關聯的第二個交換機 ID。 僅支援建立雙隧道模式 IPsec-VPN 連線的 VPN 閘道執行個體會返回當前參數。 |
vsw-p0w95ql6tmr2ludkt**** |
| SslVpnInternetIp |
string |
SSL-VPN 連線的 IP 位址。 僅支援建立雙隧道模式 IPsec-VPN 連線的公網網路類型的 VPN 閘道執行個體開啟 SSL-VPN 功能後,才會返回當前參數。 |
116.33.XX.XX |
| ResourceGroupId |
string |
VPN 閘道執行個體所屬的資源群組 ID。 您可以呼叫 ListResourceGroups 介面查詢資源群組資訊。 |
rg-acfmzs372yg**** |
樣本
正常返回樣本
JSON格式
{
"VpcId": "vpc-bp1ub1yt9cvakoel****",
"Status": "active",
"InternetIp": "116.62.XX.XX",
"Spec": "5M",
"CreateTime": 1492753580000,
"AutoPropagate": true,
"VpnGatewayId": "vpn-bp1q8bgx4xnkm2ogj****",
"IntranetIp": "172.16.10.46",
"EndTime": 1495382400000,
"VSwitchId": "vsw-bp1y9ovl1cu9ou4tv****",
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B457",
"Description": "test",
"EnableBgp": true,
"BusinessStatus": "Normal",
"Name": "test",
"DisasterRecoveryInternetIp": "116.11.XX.XX",
"DisasterRecoveryVSwitchId": "vsw-p0w95ql6tmr2ludkt****",
"SslVpnInternetIp": "116.33.XX.XX",
"ResourceGroupId": "rg-acfmzs372yg****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidName | The name is not valid | |
| 400 | InvalidDescription | The description is not valid | |
| 400 | OperationUnsupported.EnableBgp | Current version of the VPN does not support enable BGP. | |
| 400 | OperationFailed.VpnConnectionExist | Auto propagate cannot be closed when VPN connections with BGP enabled exist. | |
| 400 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. | |
| 400 | VpnGateway.Configuring | The specified service is configuring. | |
| 400 | OperationFailed.CenLevelNotSupport | When the VPC to which the VPN gateway belongs is attached to a FULL-mode CEN, the VPN gateway cannot enable BGP. | |
| 400 | OperationFailed.VpcRoutePropagationDisable | The VPC system routing table does not enable the acceptance of propagated routes. | |
| 400 | OperationFailed.VpcRoutePublishEnabledInTR | A VPC supports at most one dynamic route learning source. In the forwarding router, disable route synchronization for the VPC. | |
| 400 | OperationFailed.VpcRoutePublishEnabledInECR | VPC supports only one dynamic route learning source at most. Please remove the VPC from ECR. | |
| 400 | OperationFailed.BondingVpnNotSupportBGP | The architecture does not support BGP capabilities (single tunnel bonding architecture VPN gateway). | |
| 400 | OperationFailed.StaleBGPRoutes | BGP routes are still there and automatic route propagation cannot be disabled. | |
| 403 | Forbidden.SubUser | User not authorized to operate on the specified resource as your account is created by another user. | |
| 403 | Forbidden | User not authorized to operate on the specified resource. | |
| 404 | InvalidVpnGatewayInstanceId.NotFound | The specified vpn gateway instance id does not exist. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。