調用CreateForwardEntry添加DNAT條目。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ens:CreateForwardEntry |
create |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| NatGatewayId |
string |
是 |
NAT Gateway的 ID。 |
nat-5t7nh1cfm6kxiszlttr38**** |
| ExternalIp |
string |
是 |
提供公網訪問的彈性公網 IP 位址。 |
121.XXX.XXX.28 |
| ExternalPort |
string |
是 |
需要進行連接埠轉寄的外部連接埠或連接埠段。
|
22 |
| InternalIp |
string |
是 |
通過 DNAT 條目進行公網通訊的執行個體的私網 IP 位址。 |
10.0.XXX.XXX |
| InternalPort |
string |
是 |
進行連接埠轉寄的內部連接埠或連接埠段。
|
22 |
| ForwardEntryName |
string |
否 |
DNAT 規則的名稱。長度為 2~128 個字元,不能以 |
test0 |
| IpProtocol |
string |
否 |
協議類型,取值:
|
Any |
| HealthCheckPort |
integer |
否 |
DNAT 的探測連接埠,需要在內網連接埠範圍內。預設值為空白。 |
80 |
| StandbyExternalIp |
string |
否 |
提供公網訪問的備用彈性公網 IP 位址,需要選擇綁定在 NAT 上的備用彈性 IP。DNAT 建立成功後,備用公網 IP 會生效。 |
101.XXX.XXX.4 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
請求 ID。 |
EF6D6FA4-DACA-5822-A981-81006271D263 |
| ForwardEntryId |
string |
DNAT 條目的 ID。 |
fwd-5tc07cw14metghn3siv4a**** |
樣本
正常返回樣本
JSON格式
{
"RequestId": "EF6D6FA4-DACA-5822-A981-81006271D263",
"ForwardEntryId": "fwd-5tc07cw14metghn3siv4a****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | Invalid%s | The specified parameter %s is invalid. | |
| 400 | Missing%s | You must specify the parameter %s. | |
| 400 | InvalidParameter.NatNotFound | The specified Nat is not found. | 指定的參數Nat不存在。 |
| 400 | InvalidParameter.ExternalIp | The specified externalIp is not found. | |
| 400 | Forbidden.ExternalIpUsedInSnat | Forbidden.ExternalIpUsedInSnat | |
| 400 | InvalidParameter.InternalIpNotFound | The input parameter internalIp that is not found. | |
| 400 | Forbidden.ExternalPort.Duplicated | The specified ExternalPort is duplicated. | 該外部連接埠已配置了DNAT規則,請您不要重複設定。 |
| 400 | ForwardEntryLimitExceed | The limit of forward entry in the nat reaches. | |
| 400 | InvalidParameter.HealthCheckPort | HealthCheckPort is not in the range of InternalPort | |
| 400 | IncorrectInstanceStatus | The current status of the instance does not support this operation. | 當前執行個體狀態不支援此操作。 |
| 400 | SystemBusy | System is busy, please try again later. | 當前系統繁忙,請稍後重試。 |
| 400 | InvalidParameter.InternalIp | The specified parameter internalIp is invalid. | 參數內部IP不正確。 |
| 400 | InvalidPort.Malformed | The specified port is not a valid port. | 指定的連接埠不正確 |
| 400 | ens.interface.error | Failed to call API. | 介面調用發生異常。 |
| 400 | NoPermission | Permission denied. | |
| 400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。