Querying SNAT Rules

Function

This API is used to query an SNAT rule list.

URI

GET /v2.0/snat_rules

You can type the question mark (?) and ampersand (&) at the end of the URI to define multiple search criteria. All optional parameters can be filtered. For details, see the example request.

Table 1 Parameter description

Parameter

Mandatory

Type

Description

id

No

String

Specifies the SNAT rule ID.

limit

No

Integer

Specifies the number of records on each page.

tenant_id

No

String

Specifies the project ID.

nat_gateway_id

No

String

Specifies the NAT gateway ID.

network_id

No

String

Specifies the network ID used by the SNAT rule.

cidr

No

String

Specifies a subset of the VPC subnet CIDR block or a CIDR block of Direct Connect connection.

source_type

No

Integer

0: Either network_id or cidr can be specified in a VPC.

1: Only cidr can be specified over a Direct Connect connection.

If no value is entered, the default value 0 (VPC) is used.

floating_ip_id

No

String(4096)

Specifies the EIP ID.

floating_ip_address

No

String(1024)

Specifies the EIP.

status

No

String

  • Specifies the status of the SNAT rule.
  • For details about all its values, see Table 1.

admin_state_up

No

Boolean

  • Specifies whether the SNAT rule is enabled or disabled.
  • The value can be:
    • true: The SNAT rule is enabled.
    • false: The SNAT rule is disabled.

created_at

No

String

Specifies when the SNAT rule is created (UTC time). Its value rounds to 6 decimal places for seconds. The format is yyyy-mm-dd hh:mm:ss.

Request

None

Response

Table 2 lists response parameters.

Table 2 Response parameters

Parameter

Type

Description

snat_rules

List (SNAT rules)

Specifies the SNAT rule objects. For details, see Table 3.

Table 3 Description of the snat_rule field

Parameter

Type

Description

id

String

Specifies the SNAT rule ID.

tenant_id

String

Specifies the project ID.

nat_gateway_id

String

Specifies the NAT gateway ID.

network_id

String

Specifies the network ID used by the SNAT rule.

cidr

String

Specifies a subset of the VPC subnet CIDR block or a CIDR block of Direct Connect connection.

source_type

Integer

0: Either network_id or cidr can be specified in a VPC.

1: Only cidr can be specified over a Direct Connect connection.

If no value is entered, the default value 0 (VPC) is used.

floating_ip_id

String(4096)

  • Specifies the EIP ID. Multiple EIPs are separated using commas (,).
  • The maximum length of the ID is 4096 bytes.
  • The number of EIP IDs cannot exceed 20.

floating_ip_address

String(1024)

  • Specifies the EIP. Multiple EIPs are separated using commas (,).
  • The maximum length is 1024 bytes.

status

String

  • Specifies the status of the SNAT rule.
  • For details about all its values, see Table 1.

admin_state_up

Boolean

  • Specifies whether the SNAT rule is enabled or disabled.
  • The value can be:
    • true: The SNAT rule is enabled.
    • false: The SNAT rule is disabled.

created_at

String

Specifies when the SNAT rule is created (UTC time). Its value rounds to 6 decimal places for seconds. The format is yyyy-mm-dd hh:mm:ss.

Examples

Status Code

See Status Codes.