dots.v2.vpc_nat_gateways.get()

Generated on 13 Nov 2026 from DoTs version v1.24.0

Usage

client.v2.vpc_nat_gateways.get(requestConfiguration?: RequestConfiguration<Vpc_nat_gatewaysRequestBuilderGetQueryParameters>): Promise<undefined | Vpc_nat_gatewaysGetResponse>

Description

To list all VPC NAT gateways in your team, send a GET request to /v2/vpc_nat_gateways. The response body will be a JSON object with a key of vpc_nat_gateways containing an array of VPC NAT gateway objects. These each contain the standard VPC NAT gateway attributes.

Parameters

perPage integer optional

Example: 2

Number of items returned per page

Default: 20

Min: 1

Max: 200

page integer optional

Example: 1

Which 'page' of paginated results to return.

Default: 1

Min: 1

state string optional

The current state of the VPC NAT gateway.

One of: new, provisioning, active, deleting, error, invalid

region string optional

The region where the VPC NAT gateway is located.

One of: nyc1, nyc2, nyc3, ams2, ams3, sfo1, sfo2, sfo3, sgp1, lon1, fra1, tor1, blr1, syd1, atl1

type string optional

Example: public

The type of the VPC NAT gateway.

name string optional

Example: my-vpc-nat-gateway

The name of the VPC NAT gateway.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.vpc_nat_gateways.get();

Pagination

This method returns paginated results. The response includes a links.pages object with URLs for navigating between pages. To retrieve the next page, parse the next URL and pass the page query parameter:

let response = await client.v2.vpc_nat_gateways.get();
let pages = response?.links?.pages;

while (pages && "next" in pages && typeof pages.next === "string") {
    const page = Number(new URL(pages.next).searchParams.get("page"));
    response = await client.v2.vpc_nat_gateways.get({
        queryParameters: {
            page,
        },
    });
    pages = response?.links?.pages;
}

Response Example

Show Response Example
{
  "vpc_nat_gateways": [
    {
      "id": "70e1b58d-cdec-4e95-b3ee-2d4d95feff51",
      "name": "test-vpc-nat-gateways",
      "type": "PUBLIC",
      "state": "ACTIVE",
      "region": "tor1",
      "size": 1,
      "vpcs": [
        {
          "vpc_uuid": "0eb1752f-807b-4562-a077-8018e13ab1fb",
          "subnet_uuid": "cbd79771-23eb-49be-b5ea-59cc56222622",
          "gateway_ip": "10.118.0.35"
        }
      ],
      "egresses": {
        "public_gateways": [
          {
            "ipv4": "174.138.113.197"
          }
        ]
      },
      "udp_timeout_seconds": 30,
      "icmp_timeout_seconds": 30,
      "tcp_timeout_seconds": 30,
      "created_at": "2025-08-12T18:43:14Z",
      "updated_at": "2025-08-12T19:00:04Z",
      "project_id": "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30"
    }
  ],
  "links": {},
  "meta": {
    "total": 1
  }
}

More Information

See /v2/vpc_nat_gateways in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.