调用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 |
否 |
网络路径的描述信息。 |
分析ECS到ECS路径 |
| 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,无权限使用路径分析接口。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。