For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
Usage
client.VPCNATGateways.Get(ctx context.Context, id string) (*godo.VPCNATGateway, *godo.Response, error)
Description
Get an existing VPC NAT Gateway
This method sends a GET request to /v2/vpc_nat_gateways/{}.
Parameters
id string required
Returns
- *godo.VPCNATGateway
- *godo.Response
The HTTP response, with pagination Links, Meta, and Rate limit information.
- error
Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.
Fields of godo.VPCNATGateway
VPCNATGateway represents a DigitalOcean VPC NAT Gateway resource
ID string
JSON key: id
Name string
JSON key: name
Type string
JSON key: type
State string
JSON key: state
Region string
JSON key: region
Size uint32
JSON key: size
VPCs []*godo.IngressVPC
JSON key: vpcs
Egresses *godo.Egresses
Omitted from JSON when empty. JSON key: egresses
UDPTimeoutSeconds uint32
Omitted from JSON when empty. JSON key: udp_timeout_seconds
ICMPTimeoutSeconds uint32
Omitted from JSON when empty. JSON key: icmp_timeout_seconds
TCPTimeoutSeconds uint32
Omitted from JSON when empty. JSON key: tcp_timeout_seconds
CreatedAt time.Time
JSON key: created_at
UpdatedAt time.Time
JSON key: updated_at
ProjectID string
Omitted from JSON when empty. JSON key: project_id
Request Sample
Show Request Sample
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/digitalocean/godo"
)
func main() {
client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
ctx := context.TODO()
result, _, err := client.VPCNATGateways.Get(ctx, "<your-id>")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)
}
Response Example
Show Response Example
{
"vpc_nat_gateway": {
"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",
"default_gateway": true
}
],
"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"
}
}
See GET /v2/vpc_nat_gateways/{} in the API reference for additional detail on responses, headers, parameters, and more.
See the Go package documentation for the source of this method.