CreatePortRangeList

Updated at:

Creates a port list that can be associated with resources such as security groups.

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

ecs:CreatePortRangeList

create

*PortRangeList

acs:ecs:{#regionId}:{#accountId}:portrangelist/*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the latest Alibaba Cloud regions.

cn-hangzhou

ClientToken

string

No

Ensures the idempotence of the request. You can generate the value from your client and make sure that the value is unique across different requests. ClientToken supports only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-426655440000

MaxEntries

integer

Yes

The maximum number of entries supported by the port list. This parameter cannot be modified after the port list is created. Valid values: 1 to 2000.

Important When a port list is associated with a resource such as a security group, the rule quota is calculated based on the maximum number of entries rather than the actual number of entries. Set this parameter properly.

10

PortRangeListName

string

Yes

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

PortRangeListNameSample

Description

string

No

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

Entry

array<object>

No

The array of port list entries.

object

No

The port list entry.

PortRange

string

No

The port range. Valid values of N: 0 to 200.

  • The number of entries cannot exceed the maximum number of entries (MaxEntries).

  • The PortRange values in multiple entries must be unique.

80/80

Description

string

No

The description of the port range. 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

ResourceGroupId

string

No

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

rg-aek3b6jzp66****

Tag

array<object>

No

The array of tags bound to the port list. The array length ranges from 0 to 20.

object

No

The tag key-value pair bound to the port list.

Key

string

No

The tag key of the port list.

When you use this parameter, it cannot be left empty or set to an empty string. It can be up to 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

key for PortRangeList

Value

string

No

The tag value of the port list.

When you use this parameter, it cannot be left empty, but it can be set to an empty string. It can be up to 128 characters in length, and cannot contain http:// or https://.

value for PortRangeList

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

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

PortRangeListId

string

The ID of the created port list.

prl-2ze9743****

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParam.Entry The specified parameter Entry is not valid. The specified entry parameter is invalid.
400 InvalidOperation.MaxEntriesCountExceed The specified MaxEntries exceeded the upper limit. The specified MaxEntries parameter exceeds the maximum limit.
400 InvalidOperation.EntryCountExceedMaxEntries The number of entries in the port list exceeds MaxEntries. The number of entries specified exceeds the MaxEntries value of the port list.
400 InvalidParameter.PortRange The 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.
400 InvalidParameter.PortRangeListName The specified parameter PortRangeListName is not valid. The specified port list name is invalid.
400 LimitExceed.MaxEntries The number of entries exceeds the MaxEntries of the specified PortRangeList. The number of entries in the port list exceeds the MaxEntries value.
400 LimitExceed.Entry The number of entries added or removed exceeds the limit. The number of entries to add or remove at a time exceeds the upper limit.
400 InvalidOperation.MaxCountExceed The 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.
400 InvalidParameter.PortRangeDuplicated The specified PortRange is duplicated. Duplicate port range specified
400 InvalidDescription.Malformed The 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://.
404 InvalidRegionId.NotFound The specified parameter RegionId is not valid. The specified RegionId parameter does not exist. Check whether the service is available in the specified region.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.