Scaleway logo
Public Gateways API

PAT (Port Address Translation) rules, aka static NAT rules, belong to a specified Public Gateway. They define the forwarding of a public port to a specific device on a Private Network, enabling enables ingress traffic from the public Internet to reach the correct device in the Private Network.


List PAT rules

GET
https://api.scaleway.com
/vpc-gw/v2/zones/{zone}/pat-rules

List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol.

List PAT rules › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
it-mil-1
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2

List PAT rules › query Parameters

Order in which to return results.

Enum values:
created_at_asc
created_at_desc
public_port_asc
public_port_desc
Default: created_at_asc
page
​integer · int32

Page number.

page_size
​integer · uint32

PAT rules per page.

gateway_ids
​string[]

Filter for PAT rules on these gateways.

private_ips
​string[]

Filter for PAT rules targeting these private ips.

Filter for PAT rules with this protocol.

Enum values:
unknown_protocol
both
tcp
udp
Default: unknown_protocol

List PAT rules › Responses

200

Array of PAT rules matching the filter.

total_count
​integer · uint64

Total count of PAT rules matching the filter.


Set all PAT rules

PUT
https://api.scaleway.com
/vpc-gw/v2/zones/{zone}/pat-rules

Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly.

Set all PAT rules › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
it-mil-1
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2

Set all PAT rules › Request Body

New list of PAT rules.

gateway_id
​string

ID of the gateway on which to set the PAT rules. (UUID format)

Set all PAT rules › Responses


Create a PAT rule

POST
https://api.scaleway.com
/vpc-gw/v2/zones/{zone}/pat-rules

Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to.

Create a PAT rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
it-mil-1
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2

Create a PAT rule › Request Body

gateway_id
​string

ID of the Gateway on which to create the rule. (UUID format)

public_port
​integer · uint32

Public port to listen on.

private_ip
​string

Private IP to forward data to. (IP address)

private_port
​integer · uint32

Private port to translate to.

Protocol the rule should apply to.

Enum values:
unknown_protocol
both
tcp
udp
Default: unknown_protocol

Create a PAT rule › Responses

200
id
​string

PAT rule ID. (UUID format)

srn
​string

The SRN of the PAT rule.

gateway_id
​string

Gateway the PAT rule applies to. (UUID format)

created_at
​string | null · date-time

PAT rule creation date. (RFC 3339 format)

updated_at
​string | null · date-time

PAT rule last modification date. (RFC 3339 format)

public_port
​integer · uint32

Public port to listen on.

private_ip
​string

Private IP address to forward data to. (IP address)

private_port
​integer · uint32

Private port to translate to.

Protocol the rule applies to.

Enum values:
unknown_protocol
both
tcp
udp
Default: unknown_protocol
zone
​string

Zone of the PAT rule.


Get a PAT rule

GET
https://api.scaleway.com
/vpc-gw/v2/zones/{zone}/pat-rules/{pat_rule_id}

Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol.

Get a PAT rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
it-mil-1
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
pat_rule_id
​string · required

ID of the PAT rule to get. (UUID format)

Get a PAT rule › Responses

200
id
​string

PAT rule ID. (UUID format)

srn
​string

The SRN of the PAT rule.

gateway_id
​string

Gateway the PAT rule applies to. (UUID format)

created_at
​string | null · date-time

PAT rule creation date. (RFC 3339 format)

updated_at
​string | null · date-time

PAT rule last modification date. (RFC 3339 format)

public_port
​integer · uint32

Public port to listen on.

private_ip
​string

Private IP address to forward data to. (IP address)

private_port
​integer · uint32

Private port to translate to.

Protocol the rule applies to.

Enum values:
unknown_protocol
both
tcp
udp
Default: unknown_protocol
zone
​string

Zone of the PAT rule.


Delete a PAT rule

DELETE
https://api.scaleway.com
/vpc-gw/v2/zones/{zone}/pat-rules/{pat_rule_id}

Delete a PAT rule, identified by its PAT rule ID. This action is irreversible.

Delete a PAT rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
it-mil-1
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
pat_rule_id
​string · required

ID of the PAT rule to delete. (UUID format)

Delete a PAT rule › Responses

No data returned

Update a PAT rule

PATCH
https://api.scaleway.com
/vpc-gw/v2/zones/{zone}/pat-rules/{pat_rule_id}

Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated.

Update a PAT rule › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
it-mil-1
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
pat_rule_id
​string · required

ID of the PAT rule to update. (UUID format)

Update a PAT rule › Request Body

public_port
​integer | null · uint32

Public port to listen on.

private_ip
​string | null

Private IP to forward data to. (IP address)

private_port
​integer | null · uint32

Private port to translate to.

Protocol the rule should apply to.

Enum values:
unknown_protocol
both
tcp
udp
Default: unknown_protocol

Update a PAT rule › Responses

200
id
​string

PAT rule ID. (UUID format)

srn
​string

The SRN of the PAT rule.

gateway_id
​string

Gateway the PAT rule applies to. (UUID format)

created_at
​string | null · date-time

PAT rule creation date. (RFC 3339 format)

updated_at
​string | null · date-time

PAT rule last modification date. (RFC 3339 format)

public_port
​integer · uint32

Public port to listen on.

private_ip
​string

Private IP address to forward data to. (IP address)

private_port
​integer · uint32

Private port to translate to.

Protocol the rule applies to.

Enum values:
unknown_protocol
both
tcp
udp
Default: unknown_protocol
zone
​string

Zone of the PAT rule.