ModifyNatGatewayAttribute
1. API Description
This API (ModifyNatGatewayAttribute) is used to modify the name, associated subnets, ICMP echo reply, and security group configuration of a NAT gateway.
2. Input Parameters
The following request parameter list only provides API request parameters.
name
No
String
NAT gateway name.
The length is 2 to 63 characters.
subnetIds
No
Array of String
Subnet ID of the NAT gateway.
It can be obtained by calling DescribeSubnets.
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
ID of the target security group to be bound to the NAT gateway.
A NAT gateway can be associated with only one security group for now.
Specifying this field unbinds the original security group of the NAT gateway.
It can be obtained by calling DescribeSecurityGroups.
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request.
RequestId is required for locating a problem.
4. Code Example
1. Modify the attributes of a NAT gateway and change the 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"
}
}2. Modify the attributes of a NAT gateway and change it to all subnets.
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.
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
Operations on subnets with such IP stack type is not supported.
404
INVALID_SECURITY_GROUP_NOT_FOUND
The specified security group does not exist.
Last updated