You need to enable JavaScript to run this app.
文档中心
私有网络

私有网络

复制全文
下载 pdf
路由表
AssociateRouteTable - 关联路由表
复制全文
下载 pdf
AssociateRouteTable - 关联路由表
调用 AssociateRouteTable 接口,为指定路由表关联子网。​
使用说明​
  • 待关联子网和路由表需在同一VPC下。​
  • 子网必须且仅支持关联一个路由表,创建子网后,子网默认关联至系统路由表。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:AssociateRouteTable​
接口名称。当前 API 的名称为AssociateRouteTable。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为 2020-04-01。​
​
RouteTableId String 必选 示例值:vtb-2fdzao4h726f45******​
路由表的ID。​
您可以调用 DescribeRouteTableList 接口,查询路由表的ID。​
​
SubnetId String 可选 示例值:subnet-2fdzaou4liw3k5oxruv******​
待关联的子网的ID 。​
您可以调用 DescribeSubnets 接口,查询子网的ID。​
​
GatewayType String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
网关的类型。取值如下:​
  • Ipv4Gateway:IPv4网关​
  • Ipv6Gateway:IPv6网关​
​
GatewayId String 可选 示例值:ipv4gw-bp1fgnh68xyz9****​
网关的ID。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求幂等性。​
  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 仅支持ASCII字符,且不能超过64个字符。​
  • 若不传入ClientToken,则此次API调用不进行幂等校验。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:2021062415303301022514515207C4****​
请求ID。​
​
​
​
请求示例​
​
GET /?Action=AssociateRouteTable&Version=2020-04-01&RouteTableId=vtb-2fdzao4h726f45****&SubnetId=subnet-2fdzaou4liw3k5oxruv**** HTTP/1.1​
Host: vpc.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/vpc/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "AssociateRouteTable",​
"Version": "2020-04-01",​
"Service": "vpc",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2021062415303301022514515207C4****"​
}​
}​
​
错误码​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InvalidGatewayType.Malformed​
The specified gateway type is malformed.​
指定的网关类型不合法。​
400​
InvalidParameter.ClientTokenMalformed​
The specified parameter ClientToken is malformed.​
指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。​
400​
InvalidRouteTable.VpcMismatch​
The specified route table and subnet are in different VPC.​
指定的路由表和子网不在同一个VPC。​
400​
InvalidRouteTableAssociateGateway.Malformed​
The specified gateway route table cannot be associated with the gateway. IPv4 gateway and IPv6 gateway must be associated with the same gateway route table.​
指定的网关路由表无法绑定该网关。IPv4 网关和 IPv6 网关必须绑定到同一个网关路由表上。​
400​
InvalidRouteTableAssociateType.Malformed​
The specified route table associate type is malformed.​
指定的路由表绑定类型不合法。​
400​
InvalidRouteTableGateway.VpcMismatch​
The specified route table and gateway are in different VPC.​
指定的路由表和网关不在同一个VPC。​
400​
InvalidSubnet.InvalidStatus​
The specified subnet is not in the correct status for the request.​
指定的子网所处的状态无法响应该请求。​
400​
InvalidVpc.InvalidStatus​
The specified VPC is not in the correct status for the request.​
指定的VPC所处状态无法响应该请求。​
403​
Forbidden​
You are not authorized to perform operations on the specified gateway. The specified gateway is associated with a route table.​
无权限对指定网关进行操作。指定的网关已经绑定了路由表。​
403​
Forbidden​
You are not authorized to perform operations on the specified route table. The specified route table is associated with the gateway.​
无权限对指定路由表进行操作。指定的路由表已经绑定了网关。​
403​
Forbidden​
You are not authorized to perform operations on the specified route table. The specified route table is associated with this subnet.​
无权限对指定路由表进行操作。指定的路由表已经绑定了指定的子网。​
404​
InvalidIpv4Gateway.NotFound​
The specified Ipv4Gateway does not exist.​
指定的IPv4网关不存在。​
404​
InvalidIpv6Gateway.NotFound​
The specified Ipv6Gateway does not exist.​
指定的IPv6网关不存在。​
404​
InvalidRouteTable.NotFound​
The specified route table does not exist.​
指定的路由表不存在。​
404​
InvalidSubnet.NotFound​
The specified subnet does not exist.​
指定的子网不存在。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.02.09 16:06:03
这个页面对您有帮助吗?
有用
有用
无用
无用