You need to enable JavaScript to run this app.
导航

CreatePrefixList

最近更新时间2024.04.22 11:15:01

首次发布时间2023.09.05 08:11:45

调用 CreatePrefixList 接口,创建前缀列表。

说明

前缀列表功能正在邀测中,如需试用,请联系客户经理。

调用说明

单个账号单个地域默认最多可创建前缀列表的数量为100个。

调试

请求参数

参数名称
类型
是否必选
示例值
描述
ActionStringCreatePrefixList要执行的操作,取值为CreatePrefixList。
VersionString2020-04-01API版本信息,当前版本为2020-04-01。

PrefixListName

String

PrefixList-1

前缀列表的名称。

  • 长度限制为1 ~ 128个字符。
  • 需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短划线(-)。
  • 不填默认是前缀列表的ID。

Description

String

PrefixList_Common

前缀列表的描述。

  • 长度限制为0~ 255个字符。
  • 不填默认为空字符串。
  • 需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。

IpVersion

String

IPv4

IP版本类型。取值:

  • IPv4(默认值):IPv4类型。
  • IPv6:IPv6类型。
MaxEntriesInteger100最大条目数,即前缀列表最多可添加条目的数量。取值范围为1~200。

PrefixListEntries.N.Cidr

String

PrefixListEntries.1.Cidr=192.168.1.0/28&PrefixListEntries.2.Cidr=192.168.4.0/28

前缀列表条目的CIDR。

  • 参数 - N:表示前缀列表条目的序号,取值范围:1~MaxEntries,且N应按照连续的从小到大的顺序。
  • 多个CIDR之间用&分隔。

PrefixListEntries.N.Description

String

PrefixListEntries.1.Description=cidr_1&PrefixListEntries.2.Description=cidr_2

前缀列表条目的描述。

  • 参数 - N:表示前缀列表条目的序号,取值范围:1~MaxEntries,且N应按照连续的从小到大的顺序。
  • 多条前缀列表条目的描述之间用&分隔。
  • 长度限制为0~255个字符。
  • 不填默认为空字符串。
  • 需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。

ClientToken

String

123e4567-e89b-12d3-a456-42665544****

客户端Token,用于保证请求幂等性。

  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。
  • 仅支持ASCII字符,且不能超过64个字符。
  • 若不传入ClientToken,则此次API调用不进行幂等校验。

DryRun

Boolean

false

是否只预检此次请求。取值:

  • true:发送检查请求,不会创建前缀列表。检查项包括是否填写了必需参数、请求格式、业务限制。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation

  • false(默认值):发送正常请求,通过检查后返回HTTP 2xx状态码并直接创建前缀列表。

返回数据

参数名称
类型
示例值
描述
RequestIdString2021062415303301022514515207C4****请求ID。
PrefixListIdStringpl-bp1fg655nh68xyz9****VPC前缀列表ID。

请求示例

GET /?Action=CreatePrefixList&Version=2020-04-01&PrefixListName=PrefixList-1&MaxEntries=50&IpVersion=IPv4 HTTP/1.1
Host: open.volcengineapi.com
Service: vpc
Region: cn-beijing

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2021062415303301022514515207C4****",
        "Action": "CreatePrefixList",
        "Version": "2020-04-01",
        "Service": "vpc",
        "Region": "cn-beijing"
    },
    "Result": {
        "RequestId": "2021062415303301022514515207C4****",
        "PrefixListId": "pl-bp1fg655nh68xyz9****"
    }
}

错误码

此处仅展示当前API的错误码,更多错误码请参见公共错误码

HttpCode
错误码
错误信息
描述
400DryRunOperationException raised to indicate a successfully authorized action when the DryRun flag is set to true.该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。
400IdempotentParameterMismatchArguments on this idempotent request are inconsistent with arguments used in previous request(s).此幂等请求的参数与前一个请求中使用的参数不一致。
400InvalidCidr.MalformedThe specified cidr block is malformed.指定的网段格式不合法。
400InvalidCidr.ProtocolMismatchThe specified cidr block mismatch the protocol type.指定的网段格式和协议类型不匹配。
400InvalidDescription.MalformedThe specified description is malformed. Ensure the maximum length of description is 255.指定的描述格式不合法。描述长度不能超过255个字符。
400InvalidDescription.MalformedThe specified description is malformed.指定的描述格式不合法。请修复描述格式后重试。
400InvalidMaxEntries.MalformedThe maximum number of entries is malformed.最大条目数格式错误。
400InvalidName.MalformedThe specified name is malformed.指定的名称格式不合法。请修复名称格式后重试。
400InvalidName.MalformedThe specified name is malformed. Ensure the maximum length of name is 128.指定的名称格式不合法。名称长度不能超过128个字符。
400InvalidParameter.CidrCountExceedMaxCountThe number of CIDR blocks exceeded the maximum number of entries allowed.网段数量超过前缀列表的最大条目数。
400InvalidParameter.ClientTokenMalformedThe specified parameter ClientToken is malformed.指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。
400InvalidParameter.EnableIpv6The EnableIpv6 parameter is currently not supported.当前不支持EnableIpv6请求参数。
400InvalidParameter.IpVersionThe specified IP version is not supported.指定的IP地址类型不支持。
400InvalidPrefixListEntry.ConflictThe specified CIDR block conflicts with another one in the specified prefix list.指定的前缀列表条目中存在重复的CIDR地址块。
400LimitExceeded.MaxEntriesYou've reached the limit on the number of MaxEntries per prefix list that you can assign.已达到前缀列表支持配置的最大CIDR地址块条目数。
400QuotaExceeded.PrefixListYou've reached the limit on the number of prefix lists that you can create.前缀列表数量超过配额限制。
403ForbiddenYou are not authorized to access VPC prefix list.您无权限访问VPC前缀列表。
404InvalidProject.NotFoundThe specified Project does not exist.指定的项目不存在。
409InvalidOperation.ConflictThe specified resource operation conflicts.指定的资源操作冲突。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.幂等请求处理中。