ModifySnatEntry

1. API Description

This API (ModifySnatEntry) is used to modify a SNAT rule.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

snatEntryId

Yes

String

SNAT entry ID.

eipIds

No

Array of String

The elastic IP ID list configured in the SNAT rule. If the value is empty, it means all the elastic IPs bound to the NAT gateway.

isAllEip

No

Boolean

Whether the public egress IPs are all elastic IPs bound to this NAT gateway

cidr

No

String

CIDR block.

Either cidr or subnetIds must be specified.

sourceCidrBlocks

No

Array of String

List of source CIDR blocks.

One of sourceCidrBlocks or subnetIds must be specified.

To use the full address range, specify 0.0.0.0/0.

subnetIds

No

Array of String

IDs of subnets.

Either cidr or subnetIds must be specified.

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 a SNAT entry of type subnet.

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

Request:
{
  "snatEntryId": "<snatEntryId>",
  "subnetIds": ["<subnetId>"],
  "eipIds": ["<eipId>"]
}

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_SNAT_ENTRY_NOT_FOUND

SNAT entry does not exist.

404

INVALID_NAT_NOT_FOUND

NAT gateway does not exist.

400

OPERATION_DENIED_NAT_STATUS

NAT gateway state is not RUNNING.

404

INVALID_EIP_NOT_FOUND

Elastic IP does not exist.

400

OPERATION_DENIED_EIP_NOT_ASSIGNED

Elastic IP is not bound.

400

OPERATION_DENIED_EIP_NOT_ASSIGN_NAT

The elastic IP isn't assigned to the NAT gateway.

400

OPERATION_DENIED_ANYPORT_DNAT_ENTRY

DNAT mapping method is Any Port.

400

OPERATION_DENIED_SNAT_ENTRY_COUNT_LIMIT

The number of SNAT entries is limited.

400

INVALID_CIDR_FORMAT

The specified CIDR block format error.

404

INVALID_NAT_SUBNET_NOT_FOUND

The specified subnet does not exist on the NAT gateway.

400

OPERATION_DENIED_CIDR_CONFLICT_WITH_SNAT_ENTRY

The specified CIDR conflicts with another SNAT rule.

400

OPERATION_DENIED_NAT_SUBNET_CONFLICT

Subnet is associated already.

400

OPERATION_DENIED_NAT_ENTRY_CONFIG_CONFLICT

NAT rules conflict.

400

OPERATION_DENIED_SUBNET_CONFLICT_WITH_SNAT_ENTRY

The specified subnet conflicts with another SNAT rule.

Last updated