ModifyNatGatewayAttribute

1. API Description

This API is used to modify the attributes of the NAT gateway.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

natGatewayId

Yes

String

NAT gateway ID.

name

No

String

NAT gateway name.

The length is 2 to 63 characters.

subnetIds

No

Array of String

Subnet ID associated withe the NAT gateway.

isAllSubnet

No

Boolean

Whether the NAT gateway applies to all subnets. This field cannot be set together with subnetIds.

icmpReplyEnabled

No

Boolean

Whether to enable ICMP echo reply or not.

securityGroupId

No

String

Target security group ID bound to the NAT gateway. Currently, a NAT gateway can be associated with only one security group. Specifying this field will unbind the original security group from the NAT gateway.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Code Example

Modify the attributes of the NAT gateway by attaching to specified subnets.

POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyNatGatewayAttribute
<Common Request Params>

Request:
{
    "natGatewayId": "natGatewayId",
    "subnetIds": ["subnetId1", "subnetId2"]
}

Response:
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

HTTP Status Code
Error Code
Description

404

INVALID_NAT_NOT_FOUND

NAT gateway does not exist.

404

INVALID_NAT_SUBNET_IS_MISSING

The subnet range of the NAT gateway is smaller than the subnet range of its associated SNAT.

404

INVALID_SUBNET_NOT_FOUND

Subnet does not exist.

400

OPERATION_DENIED_NAT_STATUS

NAT gateway state is not RUNNING.

400

OPERATION_DENIED_SUBNET_STATUS

Subnet state is not supported.

400

OPERATION_DENIED_SUBNET_TYPE_NOT_SUPPORT

Subnet stack type is not supported.

404

INVALID_SECURITY_GROUP_NOT_FOUND

Security group does not exist.

Last updated