Modifies the name and description of a NAT gateway.

Description

You can call this operation to query an Internet NAT gateway or a virtual private cloud (VPC) NAT gateway. The term "NAT gateway" in this topic refers to both NAT gateway types.

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 a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyNatGatewayAttribute

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

NatGatewayId String Yes ngw-2ze0dcn4mq31qx2jc****

The ID of the NAT gateway whose configuration you want to modify.

RegionId String Yes cn-hangzhou

The ID of the region where the NAT gateway that you want to upgrade is created.

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

Name String No nat123

The name of the NAT gateway that you want to modify.

The name must be 1 to 128 characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

Note You cannot leave both Name and Description empty.
Description String No fortest

The description of the NAT gateway.

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

IcmpReplyEnabled Boolean No false

Specifies whether to enable the ICMP non-retrieval feature. Valid values:

  • false (default): no
  • true: yes

Response parameters

Parameter Type Example Description
RequestId String AB5F62CF-2B60-4458-A756-42C9DFE108D1

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyNatGatewayAttribute
&NatGatewayId=ngw-2ze0dcn4mq31qx2jc****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<ModifyNatGatewayAttributeResponse>
	  <RequestId>2315DEB7-5E92-423A-91F7-4C1EC9AD97C3</RequestId>
</ModifyNatGatewayAttributeResponse>

JSON format

{
  "RequestId": "2315DEB7-5E92-423A-91F7-4C1EC9AD97C3"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter.Name.Malformed The specified Name is not valid. The error message returned because the specified name format is invalid.
400 InvalidParameter.Description.Malformed The specified Description is not valid. The error message returned because the specified description is invalid.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.
404 InvalidNatGatewayId.NotFound The specified NatGatewayId does not exist in our records. The error message returned because the specified NAT gateway ID does not exist. Check whether the value of the NatGatewayId parameter is valid.

For a list of error codes, visit the API Error Center.