All Products
Search
Document Center

:AssociateRouteTableWithGateway

最終更新日:Aug 28, 2023

Associates a gateway route table with an IPv4 gateway in the same virtual private cloud (VPC).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AssociateRouteTableWithGateway

The operation that you want to perform. Set the value to AssociateRouteTableWithGateway.

RegionId String Yes ap-southeast-6

The region ID of the IPv4 gateway with which you want to associate the gateway route table.

You can call the DescribeRegions operation to query the most recent region list.

RouteTableId String Yes vtb-5ts0ohchwkp3dydt2****

The ID of the gateway route table.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

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.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
DryRun Boolean No false

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
GatewayId String Yes ipv4gw-5tsnc6s4ogsedtp3k****

The ID of the IPv4 gateway.

The IPv4 gateway must be in the Activated state.

Response parameters

Parameter Type Example Description
RequestId String F89C2176-8F10-55EF-90CF-CF99D1E3F816

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AssociateRouteTableWithGateway
&RegionId=ap-southeast-6
&RouteTableId=vtb-5ts0ohchwkp3dydt2****
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&DryRun=false
&GatewayId=ipv4gw-5tsnc6s4ogsedtp3k****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<AssociateRouteTableWithGatewayResponse>
    <RequestId>F89C2176-8F10-55EF-90CF-CF99D1E3F816</RequestId>
</AssociateRouteTableWithGatewayResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "F89C2176-8F10-55EF-90CF-CF99D1E3F816"
}

Error codes

HttpCode Error code Error message Description
400 ResourceNotFound.Ipv4Gateway The specified resource ipv4Gateway is not found. The specified IPv4 gateway is not found and cannot be found.
400 ResourceAlreadyAssociated.Ipv4Gateway The specified resource %s is already associated. The IPv4 gateway is already associated.
400 OperationDenied.Ipv4GatewayNotActive The operation is not allowed because of ipv4Gateway [%s] is not active. The operation is not allowed because the IPv4 gateway is not activated.
400 OperationDenied.RouteTableTypeIncorrect The operation is not allowed because of routeTableType is incorrect. The operation is not allowed because the type of route table is not supported.
400 ResourceNotFound.RouteTable The specified resource gatewayRouteTable is not found. The gateway route table does not exist.
400 IncorrectStatus.RouteTable The status of the specified route table is incorrect. The route table is in an invalid state.

For a list of error codes, see Service error codes.