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

AssociateRouteTable

最近更新时间2024.03.22 08:30:20

首次发布时间2021.07.29 14:11:54

调用 AssociateRouteTable 接口,为指定路由表关联子网。

调用说明

  • 待关联子网和路由表需在同一VPC下。
  • 子网必须且仅支持关联一个路由表,创建子网后,子网默认关联至系统路由表。

调试

请求参数

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

RouteTableId

String

vtb-2fdzao4h726f45******

待关联子网的路由表的ID。
您可以调用 DescribeRouteTableList 接口,查询路由表的ID。

SubnetId

String

subnet-2fdzaou4liw3k5oxruv******

待关联的子网的ID。
您可以调用 DescribeSubnets 接口,查询子网的ID。

ClientToken

String

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

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

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

返回数据

参数名称
类型
示例值
描述
RequestIdString2021062415303301022514515207C4****请求ID。

请求示例

GET /?Action=AssociateRouteTable&Version=2020-04-01&RouteTableId=vtb-2fdzao4h726f45****&SubnetId=subnet-2fdzaou4liw3k5oxruv**** HTTP/1.1
Host: open.volcengineapi.com
Service: vpc
Region: cn-beijing

返回示例

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

错误码

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

HttpCode
错误码
错误信息
描述
400IdempotentParameterMismatchArguments on this idempotent request are inconsistent with arguments used in previous request(s).此幂等请求的参数与前一个请求中使用的参数不一致。
400InvalidParameter.ClientTokenMalformedThe specified parameter ClientToken is malformed.指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。
400InvalidRouteTable.VpcMismatchThe specified route table and subnet are in different VPC.指定的路由表和子网不在同一个VPC。
400InvalidRouteTableAssociateType.MalformedThe specified route table associate type is malformed.指定的路由表绑定类型不合法。
400InvalidSubnet.InvalidStatusThe specified subnet is not in the correct status for the request.指定的子网所处的状态无法响应该请求。
400InvalidVpc.InvalidStatusThe specified VPC is not in the correct status for the request.指定的VPC所处状态无法响应该请求。
403ForbiddenYou are not authorized to perform operations on the specified route table. The specified route table is associated with this subnet.无权限对指定路由表进行操作。指定的路由表已经绑定了指定的子网。
404InvalidRouteTable.NotFoundThe specified route table does not exist.指定的路由表不存在。
404InvalidSubnet.NotFoundThe specified subnet does not exist.指定的子网不存在。
412IdempotentProcessingThe request uses the same client token as a previous one that is still in process.幂等请求处理中。