Skip to content

Commit ec9bc67

Browse files
authored
Add nat gateways spec (#1077)
* Add nat gateways spec * Fix lints
1 parent 8961fa5 commit ec9bc67

19 files changed

+700
-0
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,16 @@ tags:
535535
536536
To interact with Uptime, you will generally send requests to the Uptime endpoint at `/v2/uptime/`.
537537
538+
- name: "[Public Preview] VPC NAT Gateways"
539+
description: |-
540+
[VPC NAT Gateways](https://docs.digitalocean.com/products/networking/vpc/how-to/create-nat-gateway/)
541+
allow resources in a private VPC to access the public internet without
542+
exposing them to incoming traffic.
543+
544+
By sending requests to the `/v2/vpc_nat_gateways` endpoint, you can create,
545+
configure, list, and delete VPC NAT Gateways as well as retrieve information
546+
about the resources assigned to them.
547+
538548
- name: VPC Peerings
539549
description: |-
540550
[VPC Peerings](https://docs.digitalocean.com/products/networking/vpc/how-to/create-peering/)
@@ -2018,6 +2028,23 @@ paths:
20182028
delete:
20192029
$ref: "resources/vpc_peerings/vpc_peerings_delete.yml"
20202030

2031+
/v2/vpc_nat_gateways:
2032+
get:
2033+
$ref: "resources/vpc_nat_gateways/vpc_nat_gateway_list.yml"
2034+
2035+
post:
2036+
$ref: "resources/vpc_nat_gateways/vpc_nat_gateway_create.yml"
2037+
2038+
/v2/vpc_nat_gateways/{id}:
2039+
get:
2040+
$ref: "resources/vpc_nat_gateways/vpc_nat_gateway_get.yml"
2041+
2042+
put:
2043+
$ref: "resources/vpc_nat_gateways/vpc_nat_gateway_update.yml"
2044+
2045+
delete:
2046+
$ref: "resources/vpc_nat_gateways/vpc_nat_gateway_delete.yml"
2047+
20212048
/v2/uptime/checks:
20222049
get:
20232050
$ref: "resources/uptime/list_checks.yml"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
vpc_nat_gateway_create_request:
2+
value:
3+
name: "test-vpc-nat-gateways"
4+
type: "PUBLIC"
5+
region: "tor1"
6+
size: 1
7+
vpcs:
8+
- vpc_uuid: "0eb1752f-807b-4562-a077-8018e13ab1fb"
9+
udp_timeout_seconds: 30
10+
icmp_timeout_seconds: 30
11+
tcp_timeout_seconds: 30
12+
13+
vpc_nat_gateway_update_request:
14+
value:
15+
name: "test-vpc-nat-gateways-updated"
16+
type: "PUBLIC"
17+
region: "tor1"
18+
size: 2
19+
udp_timeout_seconds: 60
20+
icmp_timeout_seconds: 60
21+
tcp_timeout_seconds: 60
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
lang: cURL
2+
source: |-
3+
curl -X POST \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
-d '{
7+
"name": "test-vpc-nat-gateways",
8+
"type": "PUBLIC",
9+
"region": "tor1",
10+
"size": 1,
11+
"vpcs": [
12+
{
13+
"vpc_uuid": "0eb1752f-807b-4562-a077-8018e13ab1fb"
14+
}
15+
],
16+
"udp_timeout_seconds": 30,
17+
"icmp_timeout_seconds": 30,
18+
"tcp_timeout_seconds": 30
19+
}' \
20+
"https://api.digitalocean.com/v2/vpc_nat_gateways"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X DELETE \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/vpc_nat_gateways/a21d90fe-dc75-4097-993a-2dc7d1a8a438"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/vpc_nat_gateways/a21d90fe-dc75-4097-993a-2dc7d1a8a438"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/vpc_nat_gateways?page=1&per_page=10"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
lang: cURL
2+
source: |-
3+
curl -X PUT \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
-d '{
7+
"name": "test-vpc-nat-gateways",
8+
"type": "PUBLIC",
9+
"region": "tor1",
10+
"size": 5,
11+
"vpcs": [
12+
{
13+
"vpc_uuid": "0eb1752f-807b-4562-a077-8018e13ab1fb"
14+
}
15+
],
16+
"udp_timeout_seconds": 30,
17+
"icmp_timeout_seconds": 30,
18+
"tcp_timeout_seconds": 300
19+
}' \
20+
"https://api.digitalocean.com/v2/vpc_nat_gateways/a21d90fe-dc75-4097-993a-2dc7d1a8a438"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
type: object
2+
3+
properties:
4+
name:
5+
type: string
6+
example: my-vpc-nat-gateway
7+
description: The human-readable name of the VPC NAT gateway.
8+
9+
type:
10+
type: string
11+
enum:
12+
- PUBLIC
13+
example: PUBLIC
14+
description: The type of the VPC NAT gateway.
15+
16+
region:
17+
type: string
18+
enum:
19+
- nyc1
20+
- nyc2
21+
- nyc3
22+
- ams2
23+
- ams3
24+
- sfo1
25+
- sfo2
26+
- sfo3
27+
- sgp1
28+
- lon1
29+
- fra1
30+
- tor1
31+
- blr1
32+
- syd1
33+
- atl1
34+
example: tor1
35+
description: The region in which the VPC NAT gateway is created.
36+
37+
size:
38+
type: integer
39+
example: 1
40+
description: The size of the VPC NAT gateway.
41+
42+
vpcs:
43+
type: array
44+
items:
45+
type: object
46+
properties:
47+
vpc_uuid:
48+
type: string
49+
example: 0d3db13e-a604-4944-9827-7ec2642d32ac
50+
description: The unique identifier of the VPC to which the NAT gateway is attached.
51+
description: An array of VPCs associated with the VPC NAT gateway.
52+
53+
udp_timeout_seconds:
54+
type: integer
55+
example: 30
56+
description: The UDP timeout in seconds for the VPC NAT gateway.
57+
58+
icmp_timeout_seconds:
59+
type: integer
60+
example: 30
61+
description: The ICMP timeout in seconds for the VPC NAT gateway.
62+
63+
tcp_timeout_seconds:
64+
type: integer
65+
example: 30
66+
description: The TCP timeout in seconds for the VPC NAT gateway.
67+
68+
required:
69+
- name
70+
- type
71+
- region
72+
- size
73+
- vpcs
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
type: object
2+
3+
properties:
4+
id:
5+
type: string
6+
example: 70e1b58d-cdec-4e95-b3ee-2d4d95feff51
7+
description: The unique identifier for the VPC NAT gateway. This is automatically generated upon creation.
8+
9+
name:
10+
type: string
11+
example: my-vpc-nat-gateway
12+
description: The human-readable name of the VPC NAT gateway.
13+
14+
type:
15+
type: string
16+
enum:
17+
- PUBLIC
18+
example: PUBLIC
19+
description: The type of the VPC NAT gateway.
20+
21+
state:
22+
type: string
23+
enum:
24+
- NEW
25+
- PROVISIONING
26+
- ACTIVE
27+
- DELETING
28+
- ERROR
29+
- INVALID
30+
description: The current state of the VPC NAT gateway.
31+
example: ACTIVE
32+
33+
region:
34+
type: string
35+
enum:
36+
- nyc1
37+
- nyc2
38+
- nyc3
39+
- ams2
40+
- ams3
41+
- sfo1
42+
- sfo2
43+
- sfo3
44+
- sgp1
45+
- lon1
46+
- fra1
47+
- tor1
48+
- blr1
49+
- syd1
50+
- atl1
51+
example: tor1
52+
description: The region in which the VPC NAT gateway is created.
53+
54+
size:
55+
type: integer
56+
example: 1
57+
description: The size of the VPC NAT gateway.
58+
59+
vpcs:
60+
type: array
61+
items:
62+
type: object
63+
properties:
64+
vpc_uuid:
65+
type: string
66+
example: 0d3db13e-a604-4944-9827-7ec2642d32ac
67+
description: The unique identifier of the VPC to which the NAT gateway is attached.
68+
gateway_ip:
69+
type: string
70+
example: 10.118.0.35
71+
description: The gateway IP address of the VPC NAT gateway.
72+
description: An array of VPCs associated with the VPC NAT gateway.
73+
74+
egresses:
75+
type: object
76+
properties:
77+
public_gateways:
78+
type: array
79+
description: An array of public gateway IP addresses for the VPC NAT gateway.
80+
items:
81+
type: object
82+
properties:
83+
ipv4:
84+
type: string
85+
example: 174.138.113.197
86+
description: IPv4 address of the public gateway.
87+
description: An object containing egress information for the VPC NAT gateway.
88+
89+
udp_timeout_seconds:
90+
type: integer
91+
example: 30
92+
description: The UDP timeout in seconds for the VPC NAT gateway.
93+
94+
icmp_timeout_seconds:
95+
type: integer
96+
example: 30
97+
description: The ICMP timeout in seconds for the VPC NAT gateway.
98+
99+
tcp_timeout_seconds:
100+
type: integer
101+
example: 30
102+
description: The TCP timeout in seconds for the VPC NAT gateway.
103+
104+
created_at:
105+
format: date-time
106+
title: The creation time of the VPC NAT gateway.
107+
type: string
108+
example: 2020-07-28T18:00:00Z
109+
description: A time value given in ISO8601 combined date and time format
110+
that represents when the VPC NAT gateway was created.
111+
112+
updated_at:
113+
format: date-time
114+
title: The last update time of the VPC NAT gateway.
115+
type: string
116+
example: 2020-07-28T18:00:00Z
117+
description: A time value given in ISO8601 combined date and time format
118+
that represents when the VPC NAT gateway was last updated.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
type: object
2+
3+
properties:
4+
name:
5+
type: string
6+
example: my-vpc-nat-gateway
7+
description: The human-readable name of the VPC NAT gateway.
8+
9+
size:
10+
type: integer
11+
example: 1
12+
description: The size of the VPC NAT gateway.
13+
14+
udp_timeout_seconds:
15+
type: integer
16+
example: 30
17+
description: The UDP timeout in seconds for the VPC NAT gateway.
18+
19+
icmp_timeout_seconds:
20+
type: integer
21+
example: 30
22+
description: The ICMP timeout in seconds for the VPC NAT gateway.
23+
24+
tcp_timeout_seconds:
25+
type: integer
26+
example: 30
27+
description: The TCP timeout in seconds for the VPC NAT gateway.
28+
29+
required:
30+
- name
31+
- size

0 commit comments

Comments
 (0)