All Products
Search
Document Center

Network Intelligence Service:CreateNetworkPath

Last Updated:Oct 27, 2026

Creates a network analysis path for reachability analysis of cloud network paths.

Operation description

  • The CreateNetworkPath operation supports path creation across various networking scenarios and between multiple resources. After a path is created, its parameters are saved for repeated analysis.

  • A single Alibaba Cloud account can create up to 100 paths.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

nis:CreateNetworkPath

create

*NetworkPath

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The ID of the region where you want to create the network analysis path.

cn-hangzhou

NetworkPathName

string

Yes

The name of the path.

ecs2PublicIp

SourceId

string

Yes

The ID of the source resource.

i-2zef4ngqfarepyun****

SourceType

string

Yes

The type of the source resource. Valid values:

  • ecs: Elastic Computing Service (ECS) server

  • internetIp: public IP address

  • vsw: vSwitch

  • vpn: VPN gateway

  • vbr: virtual border router (VBR)

ecs

SourceIpAddress

string

No

The source IP address.

172.17.XX.XX

SourcePort

integer

No

The source port.

443

TargetId

string

No

The ID of the destination resource.

Note

You must specify the TargetId parameter when you call this operation.

i-bp13d0e064gubm****

TargetType

string

No

The type of the destination resource. Valid values:

  • ecs: Elastic Computing Service (ECS) server

  • internetIp: public IP address

  • vsw: vSwitch

  • vpn: VPN gateway

  • vbr: virtual border router (VBR)

  • clb: classic load balancing (CLB)

Note

You must specify the TargetType parameter when you invoke this operation.

ecs

TargetIpAddress

string

No

The destination IP address.

192.168.XX.XX

TargetPort

integer

No

The destination port.

80

Protocol

string

No

The protocol type. Valid values:

  • tcp: Transmission Control Protocol (TCP)

  • udp: User Datagram Protocol (UDP)

  • icmp: Internet Control Message Protocol (ICMP)

Note

You must specify the Protocol parameter when you call this operation.

tcp

NetworkPathDescription

string

No

The description of the network path.

Analysis ECS to ECS path

Tag

array<object>

No

The list of tags.

object

No

The tag information.

Key

string

No

The tag key. The key can be up to 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can add up to 20 tags in a single call.

role

Value

string

No

The tag value. You can specify up to 20 tag values. The value can be an empty string.

The value can be up to 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

ops

ResourceGroupId

string

No

The ID of the resource group to which the path belongs.

rg-acfm27qsxjj****

Response elements

Element

Type

Description

Example

object

NetworkPathId

string

The ID of the network path.

np-4cbf598673d14d27****

RequestId

string

The request ID.

92DD9FFB-06FB-56F7-83EF-5CEF98F5562A

Examples

Success response

JSON format

{
  "NetworkPathId": "np-4cbf598673d14d27****",
  "RequestId": "92DD9FFB-06FB-56F7-83EF-5CEF98F5562A"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.InternetIP The specified IP address (%s) is not an internet IP address. The specified IP address (%s) is not a public IP address. The IP address must not fall within the following ranges: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, or 192.168.0.0 to 192.168.255.255.
400 IllegalParam.IP The specified IP address (%s) is invalid. The specified IP address (%s) is invalid.
400 QuotaExceeded.NetworkPath The quota of %s is exceeded, usage %s/%s. The specified number of network paths exceeds the upper limit. Usage: %s/%s.
400 ResourceAlreadyExist.NetworkPath The specified resource of %s already exists. The specified network path configuration %s already exists.
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. Reachability Analyzer does not support the scenario in which the public IP addresses of the source and destination are associated with the ECS instance (%s and %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. Both the source and destination are IP addresses, but not Alibaba Cloud public IP addresses. Reachability Analyzer supports only Alibaba Cloud public IP addresses.
400 IllegalParam.SourcePort The specified SourcePort(%s) value is invalid. The value must be within the range of (0,65536]. The value of SourcePort is invalid. Valid values: 0 to 65536.
400 IllegalParam.TargetPort The specified TargetPort(%s) value is invalid. The value must be within the range of (0,65536]. The value of TargetPort is invalid. Valid values: 0 to 65536.
400 IllegalParam.SourceId The specified SourceId(%s) may be not exist. The specified instance (%s) may not exist. Check the spelling.
400 IllegalParam.TargetId The specified TargetId(%s) may be not exist. The specified instance (%s) may not exist. Check the spelling.
400 MissingParameter.TagValue You must specify Tag.N.Value. The tag value must be specified.
400 NumberExceed.Tags The maximum number of Tags is exceeded. The maximum number of tags is exceeded.
400 Duplicate.TagKey The Tag.N.Key contains duplicate keys. The tags contain duplicate keys.
400 MissingParameter.TagKey You must specify Tag.N.Key. The tag key must be specified.
400 InvalidParameter.TagKey The Tag.N.Key parameter is invalid. The tag Key parameter is invalid.
400 InvalidParameter.TagValue The Tag.N.Value parameter is invalid. The tag Value parameter is invalid.
400 IllegalParam.SourceIp Please enter a valid source IP. Please enter a valid source IP
400 IllegalParam.Protocol The specified Protocol(%s) is invalid. The Protocol(%s) parameter is invalid.
400 IllegalParam.TargetType The specified target type (%s) is invalid. The specified destination type () is invalid.
400 IllegalParam.SourceType The specified source type (%s) is invalid. The specified source type (%s) is invalid.
400 IllegalParam.TargetIp The specified target ip (%s) is invalid. The specified destination IP() is not in the correct format.
400 IllegalParam.NotSupportHaVpn The specified VPN(%s), which is not currently supported for such instances. The specified VPN(), which is not currently supported for such instances.
400 IllegalParam.SourceNotBound Elastic public network IP(%s) is not bound to resources, and analysis is not supported for the time being. Elastic public network IP() is not bound to resources, and analysis is not supported for the time being.
400 IllegalParam.TargetNotBound Elastic public network IP(%s) is not bound to resources, and analysis is not supported for the time being. The elastic IP address (%s) is not associated with any resource. Analysis is currently not supported.
400 IllegalParam.NotPublicIp The specified (%s) is invalid. The specified parameter is illegal.
400 IllegalParam.SourceEqualTarget The specified source and destination are identical, which is not supported for analysis. The specified source and destination are the same, and analysis is not supported.
400 IllegalParam.TypeAndIdMismatch The specified instanceId (%s) and type do not match. The specified instanceId and its type do not match.
403 Forbidden.NetworkPath The current user has not activated NIS and is not authorized to use the path analysis interface. The current user has not activated NIS and is not authorized to use the path analysis interface.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.