All Products
Search
Document Center

Virtual Private Cloud:CreateRouteTable

Last Updated:Dec 02, 2023

Creates a custom route table.

Operation Description

  • The CreateRouteTable operation is asynchronous. After you send the request, the system returns a request ID. However, the operation is still being performed in the system background. You can call the DescribeRouteTableList operation to query the status of a custom route table:

    • If the custom route table is in the Creating state, the custom route table is being created.
    • If the custom route table is in the Created state, the custom route table is created.
  • You cannot repeatedly call the CreateRouteTable operation to create a custom route table within the specified period of time.

debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

debugging

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:CreateRouteTableWrite
  • RouteTable
    acs:vpc:{#regionId}:{#accountId}:routetable/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the virtual private cloud (VPC) to which the custom route table belongs.

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

cn-zhangjiakou
VpcIdstringYes

The ID of the VPC to which the custom route table belongs.

If a VPC contains an Elastic Compute Service (ECS) instance that belongs to one of the following instance families, you cannot create a custom route table for the VPC:

ecs.c1, ecs.c2, ecs.c4, ecs.ce4, ecs.cm4, ecs.d1, ecs.e3, ecs.e4, ecs.ga1, ecs.gn4, ecs.gn5, ecs.i1, ecs.m1, ecs.m2, ecs.mn4, ecs.n1, ecs.n2, ecs.n4, ecs.s1, ecs.s2, ecs.s3, ecs.se1, ecs.sn1, ecs.sn2, ecs.t1, and ecs.xn4

You must upgrade or release the ECS instance before you can create a custom route table for the VPC.

Note If a custom route table is created for a VPC that contains an ECS instance from one of the preceding instance families, you must upgrade or release the ECS instance. Otherwise, the custom route table cannot work as expected.
vpc-bp1qpo0kug3a20qqe****
RouteTableNamestringNo

The name of the route table.

The name must be 1 to 128 characters in length, and cannot start with http:// or https://.

myRouteTable
DescriptionstringNo

The description of the route table.

The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

abc
AssociateTypestringNo

The type of the route table. Valid values:

  • VSwitch (default): vSwitch route table
  • Gateway: gateway route table
VSwitch
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, ClientToken is set to the value of RequestId. The value of RequestId in each API request may be different.
02fb3da4-130e-11e9-8e44-0016e04

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

62172DD5-6BAC-45DF-8D44-E11ED28DCAC0
RouteTableIdstring

The IDs of the route tables.

vtb-bp145q7glnuzdvzu2****

Examples

Sample success responses

JSONformat

{
  "RequestId": "62172DD5-6BAC-45DF-8D44-E11ED28DCAC0",
  "RouteTableId": "vtb-bp145q7glnuzdvzu2****"
}

Error codes

HTTP status codeError codeError messageDescription
400UnsupportedRegionThe feature of ipv4Gateway is not supported in the region.IPv4 gateways are not supported in this region.
400InvalidParameter.RouteTableName.MalformedThe specified route table name is not valid.-
400InvalidParameter.Description.MalformedThe specified Description is not valid.The specified description is invalid.
400QuotaExceeded.RouteTableVPC RouteTable quota exceeded.The quota of VPC route tables is exhausted.
400IncorrectStatus.cbnStatusCurrent CBN status does not support this operation.The status of the CEN instance is invalid.
400InvalidVpcId.NotSupportThe vpc is not support.-
404InvalidRegionId.NotFoundSpecified value of RegionId is not supported.-
404InvalidParameter.ActionThis vpc feature is not supported in this region-
404InvalidVpcId.NotFoundSpecified VPC does not exist.The specified VPC does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-23API Description Update,The error codes of the API operation change.see changesets
Change itemChange content
API DescriptionAPI Description Update
Error CodesThe error codes of the API operation change.
    Error Codes 400 change
    delete Error Codes: 404
2023-07-05The error codes of the API operation change.,The input parameters of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: Tag
2023-06-16The error codes of the API operation change.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change
    delete Error Codes: 404
2023-05-22The error codes of the API operation change.,The response structure of the API operation changes.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
Output ParametersThe response structure of the API operation changes.