呼叫CreateNetworkPath介面,建立網路分析路徑,用於雲端網路路徑可達性分析。
介面說明
CreateNetworkPath 介面支援多種組網場景以及多種資源間的路徑建立,路徑建立後,路徑參數將被儲存,便於重複分析。
一個阿里雲帳號(主帳號)最多支援建立 100 條路徑。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
nis:CreateNetworkPath |
create |
*NetworkPath。
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
否 |
要建立網路分析路徑的地域 ID。 |
cn-hangzhou |
| NetworkPathName |
string |
是 |
路徑名稱。 |
ecs2PublicIp |
| SourceId |
string |
是 |
來源資源 ID。 |
i-2zef4ngqfarepyun**** |
| SourceType |
string |
是 |
來源資源類型。
|
ecs |
| SourceIpAddress |
string |
否 |
來源 IP 位址。 |
172.17.XX.XX |
| SourcePort |
integer |
否 |
來源連接埠。 |
443 |
| TargetId |
string |
否 |
目的資源 ID。 說明
呼叫該 API 時,TargetId 參數必須輸入。 |
i-bp13d0e064gubm**** |
| TargetType |
string |
否 |
目的資源類型。
說明
呼叫該 API 時,TargetType 參數必須輸入。 |
ecs |
| TargetIpAddress |
string |
否 |
目的 IP 位址。 |
192.168.XX.XX |
| TargetPort |
integer |
否 |
目的連接埠。 |
80 |
| Protocol |
string |
否 |
協定類型。取值:
說明
呼叫該 API 時,Protocol 參數必須輸入。 |
tcp |
| NetworkPathDescription |
string |
否 |
網路路徑的描述資訊。 |
Analysis ECS to ECS path |
| Tag |
array<object> |
否 |
標籤清單。 |
|
|
object |
否 |
標籤資訊。 |
||
| Key |
string |
否 |
標籤鍵。最多支援 128 個字元,不能以 一次呼叫最多支援新增 20 個標籤。 |
role |
| Value |
string |
否 |
標籤值。最多支援輸入 20 個標籤值。一旦輸入該值,可以為空字串。 最多支援 128 個字元,不能以 |
ops |
| ResourceGroupId |
string |
否 |
路徑所屬的資源群組。 |
rg-acfm27qsxjj**** |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| NetworkPathId |
string |
網路路徑 ID。 |
np-4cbf598673d14d27**** |
| RequestId |
string |
請求 ID。 |
92DD9FFB-06FB-56F7-83EF-5CEF98F5562A |
樣本
正常返回樣本
JSON格式
{
"NetworkPathId": "np-4cbf598673d14d27****",
"RequestId": "92DD9FFB-06FB-56F7-83EF-5CEF98F5562A"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | IllegalParam.InternetIP | The specified IP address (%s) is not an internet IP address. | 指定的IP(%s)不是公網位址。即IP位址不能在10.0.0.0~10.255.255.255、172.16.0.0 ~172.31.255.255、192.168.0.0~192.168.255.255 這3個位址段內。 |
| 400 | IllegalParam.IP | The specified IP address (%s) is invalid. | 指定的IP位址(%s)無效。 |
| 400 | QuotaExceeded.NetworkPath | The quota of %s is exceeded, usage %s/%s. | 網路路徑數量(%s)超過閾值,使用率:%s/%s。 |
| 400 | ResourceAlreadyExist.NetworkPath | The specified resource of %s already exists. | 指定的網路路徑設定%s已存在。 |
| 400 | Mismatch.SourceIdAndTargetId | Reachability Analyzer does not support the scenario in which source and target Internet IP addresses and ECS instance ID (%s and %s) are bound. | 路徑分析不支援來源與目的的公網 IP 和 ECS 執行個體 ID(%s和%s)具有綁定關係。 |
| 400 | IllegalParam.SourceAndTargetInternetIp | Both source ID and target ID are IP addresses, but are not Internet IP addresses. Reachability Analyzer does not support the scenario. | 來源與目的都是IP,但都不是阿里雲公網IP,路徑分析不支援這種場景。 |
| 400 | IllegalParam.SourcePort | The specified SourcePort(%s) value is invalid. The value must be within the range of (0,65536]. | SourcePort參數不合法,必須介於0到65536(含)之間。 |
| 400 | IllegalParam.TargetPort | The specified TargetPort(%s) value is invalid. The value must be within the range of (0,65536]. | TargetPort參數不合法,必須介於0到65536(含)之間。 |
| 400 | IllegalParam.SourceId | The specified SourceId(%s) may be not exist. | 指定的執行個體(%s)可能不存在,請檢查是否拼寫錯誤。 |
| 400 | IllegalParam.TargetId | The specified TargetId(%s) may be not exist. | 指定的執行個體(%s)可能不存在,請檢查是否拼寫錯誤。 |
| 400 | MissingParameter.TagValue | You must specify Tag.N.Value. | 必須指定Tag的Value。 |
| 400 | NumberExceed.Tags | The maximum number of Tags is exceeded. | 超過了標籤的最大數目。 |
| 400 | Duplicate.TagKey | The Tag.N.Key contains duplicate keys. | Tag的包含重複的key。 |
| 400 | MissingParameter.TagKey | You must specify Tag.N.Key. | 必須指定Tag的Key。 |
| 400 | InvalidParameter.TagKey | The Tag.N.Key parameter is invalid. | Tag的Key參數無效。 |
| 400 | InvalidParameter.TagValue | The Tag.N.Value parameter is invalid. | Tag的Value參數無效。 |
| 400 | IllegalParam.SourceIp | Please enter a valid source IP. | 請輸入合法的來源IP。 |
| 400 | IllegalParam.Protocol | The specified Protocol(%s) is invalid. | 指定的Protocol(%s)參數不合法。 |
| 400 | IllegalParam.TargetType | The specified target type (%s) is invalid. | 指定的目的類型(%s)無效。 |
| 400 | IllegalParam.SourceType | The specified source type (%s) is invalid. | 指定的來源類型(%s)無效。 |
| 400 | IllegalParam.TargetIp | The specified target ip (%s) is invalid. | 指定的目的IP(%s)格式不正確。 |
| 400 | IllegalParam.NotSupportHaVpn | The specified VPN(%s), which is not currently supported for such instances. | 指定的VPN(%s)是HaVpn,此類執行個體目前尚不支援。 |
| 400 | IllegalParam.SourceNotBound | Elastic public network IP(%s) is not bound to resources, and analysis is not supported for the time being. | 彈性公網 IP(%s)未綁定資源,暫不支援分析。 |
| 400 | IllegalParam.TargetNotBound | Elastic public network IP(%s) is not bound to resources, and analysis is not supported for the time being. | 彈性公網 IP(%s)未綁定資源,暫不支援分析。 |
| 400 | IllegalParam.NotPublicIp | The specified (%s) is invalid. | 指定的參數(%s)不是公網IP。 |
| 400 | IllegalParam.SourceEqualTarget | The specified source and destination are identical, which is not supported for analysis. | 指定的來源和目的相同,不支援分析。 |
| 400 | IllegalParam.TypeAndIdMismatch | The specified instanceId (%s) and type do not match. | 指定的執行個體 (%s) 和執行個體類型不匹配。 |
| 403 | Forbidden.NetworkPath | The current user has not activated NIS and is not authorized to use the path analysis interface. | 當前使用者未開通NIS,無權限使用路徑分析介面。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。