All Products
Search
Document Center

VPN Gateway:PublishVpnRouteEntry

最終更新日:Dec 20, 2024

Advertises a VPN route to a VPC.

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.

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:PublishVpnRouteEntryupdate
*VpnGateway
acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region where the VPN gateway is created.

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

cn-hangzhou
ClientTokenstringNo

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.
d7d24a21-f4ba-4454-9173-b382****
VpnGatewayIdstringYes

The ID of the VPN gateway.

vpn-bp1a3kqjiiq9legfx****
RouteDeststringYes

The destination CIDR block of the VPN gateway route.

10.0.0.0/24
NextHopstringYes

The next hop of the VPN gateway route.

vco-bp15oes1py4i66rmd****
RouteTypestringYes

The type of the VPN gateway route. Valid values:

  • pbr: policy-based route
  • dbr: destination-based route
pbr
PublishVpcbooleanYes

Specifies whether to advertise the VPN gateway route to the VPC route table. Valid values:

  • true
  • false
true

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

RequestIdstring

The request ID.

5BE01CD7-5A50-472D-AC14-CA181C5C03BE

Examples

Sample success responses

JSONformat

{
  "RequestId": "5BE01CD7-5A50-472D-AC14-CA181C5C03BE\t"
}

Error codes

HTTP status codeError codeError messageDescription
400Resource.QuotaFullThe quota of resource is fullThe resource quota is exhausted.
400VpnGateway.ConfiguringThe specified service is configuring.The service is being configured. Try again later.
400VpnGateway.FinancialLockedThe specified service is financial locked.The service is suspended due to overdue payments. Top up your account first.
400VpnRouteEntry.AlreadyExistsThe specified route entry is already exist.The route already exists.
400VpnRouteEntry.ConflictThe specified route entry has conflict.Route conflicts exist.
400InvalidVpnRouteEntry.NotFoundThe specified route entry does not exist.The error message returned because the specified route does not exist.
400OperationFailed.InvalidStatusRoute entry is not allowed to operate in current status.You are not allowed to manage the route in the current state.
400OperationFailed.RouteConflictOperation failed because there is already a route in VPC route table to another VPN on the same network block.Operation failed because there is already a route in VPC route table to another VPN on the same network block.
400OperationFailed.InvalidCidrBlockOperation failed because the specified network block is invalid.The CIDR block is invalid.
400OperationFailed.RouteConflictOperation failed because there is already a route in VPC route table to a non-RI and non-VPN next hop on the same network block.Routes that point to resources other than the router interface or VPN gateway already exists on the same CIDR block in the route table of the VPC.
400QuotaExceeded.VpnRouteEntryThe number of route entries to the VPN gateway in the VPC routing table has reached the quota limit.The number of route entries to the VPN gateway in the VPC routing table has reached the quota limit.
400TaskConflictThe operation is too frequent, please wait a moment and try again.Your requests are too frequent. Try again later.
400IllegalParam.CidrBlockThe specified CidrBlock is illegal.The operation failed because CidrBlock is set to an invalid value.
400QuotaExceededRoute entry quota exceeded in this route table.The number of route entries in the route table has reached the upper limit.
400MissingParameterMiss mandatory parameter.Some required parameters are not specified. Specify all required parameters and try again.
400InvalidCidrBlock.MalformedSpecified CIDR block is not valid.The format of the CIDR block is invalid.
400InvalidCIDRBlock.DuplicateSpecified CIDR block is already exists.This CIDR block already exists in the routing table.
400IncorrectVpcStatusCurrent VPC status does not support this operation.This operation cannot be performed when the VPC is in the current state.
400IncorrectInstanceStatusCurrent instance status does not support this operation.This operation cannot be performed while the instance is in the current state.
400IncorrectRouteEntryStatusSome route entry status blocked this operation.The operation is not supported because the route table contains routes in the Pending or Modifying state.
400IncorrectVSwitchStatusThe current virtual switch status does not support this operation.The error message returned because the vSwitch is in the Pending state and cannot be deleted.
400InvalidCidrBlockSpecified CIDR block is not valid.Possible reasons for error reporting: 1. You are not in the whitelist of the 10.0.0.0/8 CIDR block and cannot use this CIDR block. 2. The target CIDR block of the added custom route cannot belong to the CIDR block of all vSwitches under the same VPC. 3. Because 100.64.0.0/10 is a cloud service address, you cannot add this CIDR block to point to the IDC under the cloud. 4. Except for 100.64.0.0/10, the detailed route network segments such as 100.64.0.0/11 and 100.96.0.0/11 cannot be used in the IDC under the cloud.
400InvalidNextHopTypeSpecified parameter "NextHopType" is not validThe specified next hop type is invalid.
400InvalidNextHop.NotFoundSpecified next hop does not exist.The specified next hop does not exist.
400InvalidVRouter.NotFoundvRouter not exists.The specified vRouter does not exist. Check whether the specified vRouter is valid.
400InvalidVPC.NotFoundvpc not exists.The VPC does not exist. Check whether the specified VPC is valid.
400InvalidNexthopTypeAndList.BothNullboth nexthopType and nextHopList are null.NextHopType and NextHopList are not specified.
400InvalidNexthopTypeAndList.BothNotNullboth nexthopType and nextHopList are not null.You cannot leave both NextHopType and NextHopList empty.
400InvalidRouterInterfaceinvalid router interface.The specified router interface does not exist.
400InvalidOppositeRouterTypenexthop list cannot only contain router interface whose opposite router interface is on vbr.The specified next hop is invalid. The peer router of the router interface that you specify as the next hop must be a VBR.
400InvalidNexthopListSizenexthop size is illegal. Must be between 2 and 4.You must specify two to four router interfaces as next hops.
400InvalidEntryRuleQuota.NotFoundRoute entry quota rule not exists.The quota rules of route entries do not exist.
400Forbidden.CheckEntryRuleQuotaRoute entry quota rule check error.An error occurred when the system was checking the quota of route entries.
400InvalidVBRStatusinvalid virtual border router status.The VBR is in an invalid state.
400InvalidPhysicalConnectionBusinessStatusinvalid physical connection business status.The Express Connect circuit is in an invalid state.
400IncorrectHaVipStatusThis operation is denied because satus of the specified HaVip is neither Available nor InUse.You cannot perform the operation when the specified HAVIP is in the Available or InUse state.
400CountLimitExceed.HaVipRouteEntryThere can be 5 route entry to HaVip at most in one route table.The number of route entries that point to the HAVIP has reached the upper limit.
400InvalidRouteEntry.DuplicateThe route entry already exist.The specified route entry already exists.
400IncorrectRouteEntryStatusSpecified routeEntry status error.The operation is not supported because the route table contains routes in the Pending or Modifying state.
400IncorrectRouteEntryStatusVBR has NotStable route entry.The operation is not supported because the route table contains routes in the Pending or Modifying state.
400INVALID_WEIGHT_PARAMSpecified value of weight invalidThe specified weight is invalid.
400FORBIDDEN_USE_VPC_AS_INTERNET_GATEWAYThe Specified CIDR must be in vpc CIDR.The specified CIDR block must be a subset of the VPC CIDR block.
400INVALID_VPC_IDThe Specified VpcId not match.The specified VPC does not exist.
400InvalidRouteEntrySizeThe Specified routerEntry size not legal.You must specify two to four router interfaces as next hops if you want to configure ECMP routing.
400RouteConflict.AlreadyExistRoute conflict exists in routing table.Route conflicts exist in the route table.
400InvalidRouteEntryName.MalformedSpecified RouteEntry name is not valid.The new name of the route is invalid.
400Duplicated.VpcNextHopRoute entry nexthop duplicate.Duplicate next hops are specified.
400InvalidNexthop.DirectEniThe direct Eni cannot be nexthop.An ENI in cut-through mode cannot be specified as a next hop.
400InvalidAttachment.NotFoundThe attachment is not found.The specified transit router does not exist.
400OperationFailed.ActiveNetworkInterfaceNotFoundNo active network interface is found on the attachment.No ENI is available on the specified transit router.
400InvalidNetworkInterface.NotFoundThe network interface is not found on the attachment.No ENI is associated with the specified transit router.
400OperationFailed.QueryAttachmentInfoFailed to query attachment information.The system fails to query the transit router.
400IllegalParam.AttachmentIdThe attachment is invalid.The specified transit router is invalid.
400OperationFailed.NotSupportIPV6The specified next hop does not support IPv6.The specified next hop does not support IPv6.
400IncorrectStatus.Ipv6AddressThe IPv6 address of the specified next hop is being assigned or deleted.The IPv6 address that is specified as the next hop is being created or being deleted.
400OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterfaceYou cannot create IPv6 route entries on a primary network interface.You cannot create an IPv6 route whose next hop is a primary ENI.
400OperationUnsupported.SpecifyIpOnIpv6EntryYou cannot specify the private IP address when you create IPv6 route entries.You cannot specify a private IPv6 address as the destination CIDR block.
400OperationUnsupported.MutipleIpv6AddressYou cannot specify a next hop that has bound multiple IPv6 addresses.You cannot specify a next hop that is assigned multiple IPv6 addresses.
400OperationDenied.Ipv6EntryOnCustomTableYou cannot create any IPv6 route entry on a custom route table.-
403Forbbiden.SubUserUser not authorized to operate on the specified resource as your account is created by another user.You are unauthorized to perform this operation on the specified resource. Acquire the required permissions and try again.
403ForbiddenUser not authorized to operate on the specified resource.You do not have the permissions to manage the specified resource. Apply for the permissions and try again.
404InvalidVpnGatewayInstanceId.NotFoundThe specified vpn gateway instance id does not exist.The specified VPN gateway does not exist. Check whether the specified VPN gateway is valid.

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

Change history

Change timeSummary of changesOperation
2023-07-21API Description Update. The Error code has changedView Change Details