All Products
Search
Document Center

:CreatePortRangeList

Last Updated:Apr 25, 2025

Creates a port list. You can associate a port list with resources, such as security groups.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the port list. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-426655440000
MaxEntriesintegerYes

The maximum number of entries in the port list. The value cannot be changed after you create the port list. Valid values: 1 to 2000.

Note When you reference a port list in a resource, such as a security group, the maximum number of entries (instead of the actual number of entries) in the port list counts against the rule quota for the resource. Set a proper value for MaxEntries.
10
PortRangeListNamestringYes

The name of the port list. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http://, https://, com.aliyun, or com.alibabacloud. The name can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

PortRangeListNameSample
DescriptionstringNo

The description of the port list. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

Description information of PortRangeList
Entryarray<object>No

The port list entries.

objectNo

The port list entry.

PortRangestringNo

Port range N. Valid values of N: 0 to 200.

  • The total number of entries cannot exceed the MaxEntries value.
  • PortRange in multiple entries cannot be duplicated.
80/80
DescriptionstringNo

The description of port range N. The description must be 2 to 32 characters in length and cannot start with http:// or https://. Valid values of N: 0 to 200.

Description information of Entry
ResourceGroupIdstringNo

The ID of the resource group to which the port list belongs.

rg-aek3b6jzp66****
Tagarray<object>No

The tags to add to the port list. You can add 0 to 20 tags to the port list.

objectNo

Tag N to add to the port list.

KeystringNo

The key of tag N to add to the port list.

The tag key cannot be empty or an empty string. 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.

key for PortRangeList
ValuestringNo

The value of tag N to add to the port list.

The tag value cannot be empty but can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://.

value for PortRangeList

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****
PortRangeListIdstring

The ID of the port list.

prl-2ze9743****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "PortRangeListId": "prl-2ze9743****"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParam.EntryThe specified parameter Entry is not valid.The specified entry parameter is invalid.
400InvalidOperation.MaxEntriesCountExceedThe specified MaxEntries exceeded the upper limit.The specified MaxEntries parameter exceeds the maximum limit.
400InvalidOperation.EntryCountExceedMaxEntriesThe number of entries in the port list exceeds MaxEntries.The number of entries specified exceeds the MaxEntries value of the port list.
400InvalidParameter.PortRangeThe specified parameter PortRange is not valid. It should be two integers less than 65535 in specified format.Entries in the port list PortRange not in the required format. Two integers less than 65535 should be specified, separated by a slash.
400InvalidParameter.PortRangeListNameThe specified parameter PortRangeListName is not valid.The specified port list name is invalid.
400LimitExceed.MaxEntriesThe number of entries exceeds the MaxEntries of the specified PortRangeList.The number of entries in the port list exceeds the MaxEntries value.
400LimitExceed.EntryThe number of entries added or removed exceeds the limit.The number of entries to add or remove at a time exceeds the upper limit.
400InvalidOperation.MaxCountExceedThe number of port range list in the current account has exceeded quota.The number of port lists under the current account exceeds the limit of the number of port lists under the user account.
400InvalidParameter.PortRangeDuplicatedThe specified PortRange is duplicated.Duplicate port range specified
400InvalidDescription.MalformedThe specifid Description is not valid.The resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
404InvalidRegionId.NotFoundThe specified parameter RegionId is not valid.The specified RegionId parameter does not exist. Check whether the service is available in the specified region.

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