CreateNetworkPath - 创建网络分析路径

调用CreateNetworkPath接口,创建网络分析路径,用于云上网络路径可达性分析。

接口说明

  • CreateNetworkPath 接口支持多种组网场景以及多种资源间的路径创建,路径创建后,路径参数将被保存,便于重复分析。

  • 一个阿里云账号(主账号)最多支持创建 100 条路径。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

nis:CreateNetworkPath

create

*NetworkPath

acs:nis:*:{#accountId}:networkpath/*

请求参数

名称

类型

必填

描述

示例值

RegionId

string

要创建网络分析路径的地域 ID。

cn-hangzhou

NetworkPathName

string

路径名称。

ecs2PublicIp

SourceId

string

源资源 ID。

i-2zef4ngqfarepyun****

SourceType

string

源资源类型。

  • ecs:云服务器 ECS(Elastic Compute Service)。

  • internetIp:公网 IP 地址。

  • vsw:交换机(vSwitch)。

  • vpn:VPN 网关。

  • vbr:边界路由器 VBR(Virtual Border Router)。

ecs

SourceIpAddress

string

源 IP 地址。

172.17.XX.XX

SourcePort

integer

源端口。

443

TargetId

string

目的资源 ID。

说明

调用该 API 时,TargetId 参数必须输入。

i-bp13d0e064gubm****

TargetType

string

目的资源类型。

  • ecs:云服务器 ECS(Elastic Compute Service)。

  • internetIp:公网 IP 地址。

  • vsw:交换机(vSwitch)。

  • vpn:VPN 网关。

  • vbr:边界路由器 VBR(Virtual Border Router)。

  • clb:传统型负载均衡 CLB(Classic Load Balancer)。

说明

调用该 API 时,TargetType 参数必须输入。

ecs

TargetIpAddress

string

目的 IP 地址。

192.168.XX.XX

TargetPort

integer

目的端口。

80

Protocol

string

协议类型。取值:

  • tcp:传输控制协议。

  • udp:用户数据报协议。

  • icmp:网络控制报文协议。

说明

调用该 API 时,Protocol 参数必须输入。

tcp

NetworkPathDescription

string

网络路径的描述信息。

分析ECSECS路径

Tag

array<object>

标签列表。

object

标签信息。

Key

string

标签键。最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://https://

一次调用最多支持添加 20 个标签。

role

Value

string

标签值。最多支持输入 20 个标签值。一旦输入该值,可以为空字符串。

最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://或者https://

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. 路径分析不支持源与目的的公网IPECS实例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参数不合法,必须介于065536(含)之间。
400 IllegalParam.TargetPort The specified TargetPort(%s) value is invalid. The value must be within the range of (0,65536]. TargetPort参数不合法,必须介于065536(含)之间。
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. 必须指定TagValue。
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. 必须指定TagKey。
400 InvalidParameter.TagKey The Tag.N.Key parameter is invalid. TagKey参数无效
400 InvalidParameter.TagValue The Tag.N.Value parameter is invalid. TagValue参数无效。
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,无权限使用路径分析接口。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情