Updated on 2023-12-14 GMT+08:00

Updating a Public NAT Gateway

Function

This API is used to update a public NAT gateway.

The name, description, and specifications of a public NAT gateway can be updated when admin_state_up is True and status is ACTIVE.

URI

PUT /v2.0/nat_gateways/{nat_gateway_id}

Table 1 Parameter description

Parameter

Type

Mandatory

Description

nat_gateway_id

String

Yes

Specifies the public NAT gateway ID.

Request

Table 2 lists the request parameter.

Table 2 Request parameter

Parameter

Mandatory

Type

Description

nat_gateway

Yes

Object

Specifies the NAT gateway object. For details, see Table 3.

Mandatory field: None. Only the name, description, and spec fields can be updated. At least one attribute must be specified for the NAT gateway to be updated.

Table 3 Description of the nat_gateway field

Parameter

Mandatory

Type

Description

name

No

String

Specifies the name of the public NAT gateway. You can enter up to 64 characters.

The name can contain only digits, letters, underscores (_), and hyphens (-).

description

No

String

Provides supplementary information about the public NAT gateway. You can enter up to 255 characters.

spec

No

String

Specifies the public NAT gateway type.

The value can be:

  • 1: small type, which supports up to 10,000 SNAT connections.
  • 2: medium type, which supports up to 50,000 SNAT connections.
  • 3: large type, which supports up to 200,000 SNAT connections.
  • 4: extra-large type, which supports up to 1,000,000 SNAT connections.

Response

Table 4 lists the response parameter.

Table 4 Response parameter

Parameter

Type

Description

nat_gateway

Object

Specifies the NAT gateway object. For details, see Table 5.

Table 5 Description of the nat_gateway field

Parameter

Type

Description

id

String

Specifies the public NAT gateway ID.

tenant_id

String

Specifies the project ID.

name

String

Specifies the name of the public NAT gateway. You can enter up to 64 characters.

The name can contain only digits, letters, underscores (_), and hyphens (-).

description

String

Provides supplementary information about the public NAT gateway. You can enter up to 255 characters.

spec

String

Specifies the public NAT gateway type.

The value can be:

  • 1: small type, which supports up to 10,000 SNAT connections.
  • 2: medium type, which supports up to 50,000 SNAT connections.
  • 3: large type, which supports up to 200,000 SNAT connections.
  • 4: extra-large type, which supports up to 1,000,000 SNAT connections.

router_id

String

Specifies the router ID.

internal_network_id

String

Specifies the network ID of the downstream interface (the next hop of DVR) of the public NAT gateway.

status

String

  • Specifies the public NAT gateway status.
  • For details about all its values, see Table 1.

admin_state_up

Boolean

  • Specifies whether the NAT gateway is frozen.
  • The value can be:
    • true: The NAT gateway is unfrozen.
    • false: The NAT gateway is frozen.

created_at

String

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

Examples

  • Example request
    PUT https://{Endpoint}/v2.0/nat_gateways/a78fb3eb-1654-4710-8742-3fc49d5f04f8 
      {
        "nat_gateway": {
            "name": "new_name",
            "description": "new description",
            "spec": "1"
        }
    }
  • Example response
    {
        "nat_gateway": {
            "router_id": "d84f345c-80a1-4fa2-a39c-d0d397c3f09a", 
             "status": "ACTIVE", 
             "description": "new description", 
             "admin_state_up": true, 
             "tenant_id": "27e25061336f4af590faeabeb7fcd9a3", 
             "created_at": "2017-11-18 07:34:32.203044", 
             "spec": "1", 
             "internal_network_id": "89d66639-aacb-4929-969d-07080b0f9fd9", 
             "id": "a78fb3eb-1654-4710-8742-3fc49d5f04f8", 
             "name": "new_name"
        }
    } 

Status Codes

See Status Codes.