Deletes an IPv4 gateway.

Usage notes

  • Before you delete an IPv4 gateway, make sure that no route tables are associated with the IPv4 gateway.
  • DeleteIpv4Gateway is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the GetIpv4GatewayAttribute operation to query the status of the task.
    • If the IPv4 gateway is in the Deleting state, the IPv4 gateway is being deleted.
    • If the IPv4 gateway cannot be queried, the IPv4 gateway is deleted.
  • You cannot repeatedly call DeleteIpv4Gateway within a specific period of time.

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 DeleteIpv4Gateway

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

Ipv4GatewayId String Yes ipv4gw-5tsnc6s4ogsedtp3k****

The ID of the IPv4 gateway that you want to delete.

RegionId String Yes ap-southeast-6

The region ID of the IPv4 gateway that you want to delete.

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

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.

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 a dry run. Valid values:

  • true: performs a dry run, without performing the actual request. 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.

Response parameters

Parameter Type Example Description
RequestId String 21133AC0-0636-521B-A400-253818691A56

The request ID.

Examples

Sample requests

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

Sample success responses

XML format

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

<DeleteIpv4GatewayResponse>
    <RequestId>21133AC0-0636-521B-A400-253818691A56</RequestId>
</DeleteIpv4GatewayResponse>

JSON format

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

{
  "RequestId" : "21133AC0-0636-521B-A400-253818691A56"
}

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 OperationDenied.RouteEntryExist The operation is not allowed because of existing routeEntry point to ipv4Gateway. You cannot delete the IPv4 gateway because routes that point to the IPv4 gateway exist.
400 OperationDenied.GatewayAlreadyAssociated The operation is not allowed because of the specified resource %s is already associated. The operation is not allowed because the IPv4 gateway is in the Associated state.
400 OperationFailed.Ipv4GatewayUsedByEipBindIpAddress Failed to delete the IPv4 gateway because the EIP associated with a private IP address requires the IPv4 gateway to implement outbound Internet access. The EIP is associated with a private IP address and this feature requires an IPv4 gateway. Therefore, you cannot delete the IPv4 gateway.

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