Help Center/ NAT Gateway/ API Reference/ V2 APIs of Public NAT Gateways/ SNAT Rules/ Querying Details About a Specified SNAT Rule
Updated on 2023-04-19 GMT+08:00

Querying Details About a Specified SNAT Rule

Function

This API is used to query details about a specified SNAT rule.

URI

GET /v2/{project_id}/snat_rules/{snat_rule_id}

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

snat_rule_id

Yes

String

Specifies the SNAT rule ID.

Request

None

Response

Table 2 lists response parameters.

Table 2 Response parameter

Parameter

Type

Description

snat_rule

Object

Specifies the SNAT rule object. 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

  • Specifies the EIP ID. Multiple EIP IDs must be separated using commas (,).
  • The maximum length of the ID is 4096 bytes.

description

String

Provides supplementary information about the SNAT rule. You can enter up to 255 characters.

status

String

admin_state_up

Boolean

  • Specifies the unfrozen or frozen state.
  • The value can be:
    • true: indicates the unfrozen state.
    • false: indicates the frozen state.

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.

floating_ip_address

String

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

freezed_ip_address

String

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

Examples

  • Example request
    GET https://{Endpoint}/v2/d199ba7e0ba64899b2e81518104b1526/snat_rules/5b95c675-69c2-4656-ba06-58ff72e1d338
  • Example response
    { 
         "snat_rule": { 
             "floating_ip_id": "bdc10a4c-d81a-41ec-adf7-de857f7c812a", 
             "status": "ACTIVE", 
             "nat_gateway_id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8", 
             "admin_state_up": true, 
             "network_id": "eaad9cd6-2372-4be1-9535-9bd37210ae7b",
             "source_type":0,
             "tenant_id": "d199ba7e0ba64899b2e81518104b1526", 
             "created_at": "2017-11-18 07:54:21.665430", 
             "id": "5b95c675-69c2-4656-ba06-58ff72e1d338", 
             "floating_ip_address": "5.21.11.226", 
             "freezed_ip_address": "", 
             "description": "my snat rule 01" 
         } 
     }

Status Codes

See Status Codes.