All Products
Search
Document Center

Network Intelligence Service:CreateNetworkPath

Last Updated:Sep 13, 2024

Creates a network path for reachability analysis.

Operation description

  • You can call the CreateNetworkPath operation to create network paths in multiple networking scenarios and between multiple resources. After a path is created, the path parameters are saved for repeated analysis.
  • You can create up to 100 network paths within one Alibaba Cloud account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
nis:CreateNetworkPathcreate
  • NetworkPath
    acs:nis:*:{#accountId}:networkpath/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

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

cn-hangzhou
NetworkPathNamestringYes

The name of the network path.

ecs2PublicIp
SourceIdstringYes

The ID of the source resource.

i-2zef4ngqfarepyun****
SourceTypestringYes

The type of the source resource. Valid values:

  • ecs: the Elastic Compute Service (ECS) instance
  • internetIp: the public IP address
  • vsw: the vSwitch
  • vpn: the VPN gateway
  • vbr: the virtual border router (VBR)
ecs
SourceIpAddressstringNo

The source IP address.

172.17.XX.XX
SourcePortintegerNo

The source port.

443
TargetIdstringNo

The ID of the destination resource.

i-bp13d0e064gubm****
TargetTypestringNo

The type of the destination resource. Valid values:

  • ecs: the ECS instance
  • internetIp: the public IP address
  • vsw: the vSwitch
  • vpn: the VPN gateway
  • vbr: the VBR
  • clb: the Classic Load Balancer (CLB) instance
ecs
TargetIpAddressstringNo

The destination IP address.

192.168.0.210
TargetPortintegerNo

The destination port.

80
ProtocolstringNo

The protocol type. Valid values:

  • tcp: Transmission Control Protocol (TCP)
  • udp: User Datagram Protocol (UDP)
  • icmp: Internet Control Message Protocol (ICMP)
tcp
NetworkPathDescriptionstringNo

The description of the network path.

Analyze the path from ECS to ECS
Tagarray<object>No

The tags to add to the resource.

objectNo
KeystringNo

The key of tag N to add to the resource. The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

You can add up to 20 tags in each call.

role
ValuestringNo

The value of tag N to add to the resource. You can specify up to 20 tag values. The tag value can be an empty string.

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

ops
ResourceGroupIdstringNo

The resource group ID.

rg-acfm27qsxjj****

Response parameters

ParameterTypeDescriptionExample
object
NetworkPathIdstring

The ID of the network path.

np-4cbf598673d14d27****
RequestIdstring

The request ID.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.InternetIPThe 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.
400IllegalParam.IPThe specified IP address (%s) is invalid.The specified IP address (%s) is invalid.
400QuotaExceeded.NetworkPathThe quota of %s is exceeded, usage %s/%s.The specified number of network paths exceeds the upper limit. Usage: %s/%s.
400ResourceAlreadyExist.NetworkPathThe specified resource of %s already exists.The specified network path configuration %s already exists.
400Mismatch.SourceIdAndTargetIdReachability 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).
400IllegalParam.SourceAndTargetInternetIpBoth 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.
400IllegalParam.SourcePortThe 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.
400IllegalParam.TargetPortThe 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.
400IllegalParam.SourceIdThe specified SourceId(%s) may be not exist.The specified instance (%s) may not exist. Check the spelling.
400IllegalParam.TargetIdThe specified TargetId(%s) may be not exist.The specified instance (%s) may not exist. Check the spelling.
400MissingParameter.TagValueYou must specify Tag.N.Value.-
400NumberExceed.TagsThe maximum number of Tags is exceeded.-
400Duplicate.TagKeyThe Tag.N.Key contains duplicate keys.-
400MissingParameter.TagKeyYou must specify Tag.N.Key.-
400InvalidParameter.TagKeyThe Tag.N.Key parameter is invalid.-
400InvalidParameter.TagValueThe Tag.N.Value parameter is invalid.-
400IllegalParam.SourceIpPlease enter a valid source IP.Please enter a valid source IP
400IllegalParam.ProtocolThe specified Protocol(%s) is invalid.The Protocol(%s) parameter is invalid.
400IllegalParam.TargetTypeThe specified target type (%s) is invalid.The specified destination type () is invalid.
400IllegalParam.SourceTypeThe specified source type (%s) is invalid.-
400IllegalParam.TargetIpThe specified target ip (%s) is invalid.The specified destination IP() is not in the correct format.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-23The Error code has changedView Change Details
2024-04-09The Error code has changedView Change Details
2024-03-22The Error code has changedView Change Details
2023-12-12The Error code has changedView Change Details
2023-11-06The Error code has changed. The request parameters of the API has changedView Change Details
2023-07-11The Error code has changed. The request parameters of the API has changedView Change Details
2022-06-17The Error code has changedView Change Details