Skip to content

Commit c31efb9

Browse files
authored
Add missing GLB create params (#962)
* Add missing GLB create params Also add new endpoint supported for purging CDN cache. * Update domains description
1 parent 19beba4 commit c31efb9

File tree

7 files changed

+160
-0
lines changed

7 files changed

+160
-0
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,10 @@ paths:
12491249
delete:
12501250
$ref: 'resources/load_balancers/loadBalancers_delete.yml'
12511251

1252+
/v2/load_balancers/{lb_id}/cache:
1253+
delete:
1254+
$ref: 'resources/load_balancers/loadBalancers_delete_cache.yml'
1255+
12521256
/v2/load_balancers/{lb_id}/droplets:
12531257
post:
12541258
$ref: 'resources/load_balancers/loadBalancers_add_droplets.yml'
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/load_balancers/4de7ac8b-495b-4884-9a69-1050c6793cd6/cache"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
lang: Go
2+
source: |-
3+
import (
4+
"context"
5+
"os"
6+
7+
"github.com/digitalocean/godo"
8+
)
9+
10+
func main() {
11+
token := os.Getenv("DIGITALOCEAN_TOKEN")
12+
13+
client := godo.NewFromToken(token)
14+
ctx := context.TODO()
15+
16+
_, err := client.LoadBalancers.PurgeCache(ctx, "4de7ac8b-495b-4884-9a69-1050c6793cd6")
17+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
operationId: loadBalancers_delete_cache
2+
3+
summary: Delete a Global Load Balancer CDN Cache
4+
5+
description: |
6+
To delete a Global load balancer CDN cache, send a DELETE request to
7+
`/v2/load_balancers/$LOAD_BALANCER_ID/cache`.
8+
9+
A successful request will receive a 204 status code with no body in response.
10+
This indicates that the request was processed successfully.
11+
12+
tags:
13+
- Load Balancers
14+
15+
parameters:
16+
- $ref: 'parameters.yml#/load_balancer_id'
17+
18+
responses:
19+
'204':
20+
$ref: '../../shared/responses/no_content.yml'
21+
22+
'401':
23+
$ref: '../../shared/responses/unauthorized.yml'
24+
25+
'404':
26+
$ref: '../../shared/responses/not_found.yml'
27+
28+
'429':
29+
$ref: '../../shared/responses/too_many_requests.yml'
30+
31+
'500':
32+
$ref: '../../shared/responses/server_error.yml'
33+
34+
default:
35+
$ref: '../../shared/responses/unexpected_error.yml'
36+
37+
x-codeSamples:
38+
- $ref: 'examples/curl/loadBalancers_delete_cache.yml'
39+
- $ref: 'examples/go/loadBalancers_delete_cache.yml'
40+
41+
security:
42+
- bearer_auth:
43+
- 'load_balancer:delete'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
type: object
2+
3+
description: An object specifying domain configurations for a Global load balancer.
4+
5+
properties:
6+
name:
7+
type: string
8+
example: example.com
9+
description: FQDN to associate with a Global load balancer.
10+
11+
is_managed:
12+
type: boolean
13+
example: true
14+
description: A boolean value indicating if the domain is already managed
15+
by DigitalOcean. If true, all A and AAAA records required to enable Global
16+
load balancers will be automatically added.
17+
18+
certificate_id:
19+
type: string
20+
example: 892071a0-bb95-49bc-8021-3afd67a210bf
21+
description: The ID of the TLS certificate used for SSL termination.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
type: object
2+
3+
description: An object specifying forwarding configurations for a Global load balancer.
4+
5+
properties:
6+
target_protocol:
7+
type: string
8+
enum:
9+
- http
10+
- https
11+
- http2
12+
example: http
13+
description: The protocol used for forwarding traffic from the load balancer to the
14+
target backends. The possible values are `http`, `https` and `http2`.
15+
16+
target_port:
17+
type: integer
18+
example: 80
19+
description: An integer representing the port on the target backends which the
20+
load balancer will forward traffic to.
21+
22+
cdn:
23+
type: object
24+
properties:
25+
is_enabled:
26+
type: boolean
27+
example: true
28+
description: A boolean flag to enable CDN caching.
29+
description: An object specifying CDN configurations for a Global load balancer.
30+
31+
region_priorities:
32+
type: object
33+
additionalProperties:
34+
type: integer
35+
example:
36+
"nyc1": 1
37+
"fra1": 2
38+
"sgp1": 3
39+
description: A map of region string to an integer priority value indicating preference
40+
for which regional target a Global load balancer will forward traffic to. A lower
41+
value indicates a higher priority.
42+
43+
failover_threshold:
44+
type: integer
45+
example: 50
46+
description: An integer value as a percentage to indicate failure threshold to decide how
47+
the regional priorities will take effect. A value of `50` would indicate that the Global
48+
load balancer will choose a lower priority region to forward traffic to once this failure
49+
threshold has been reached for the higher priority region.

specification/resources/load_balancers/models/load_balancer_base.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,25 @@ properties:
181181
regional HTTP load balancer, a regional network load balancer that routes traffic
182182
at the TCP/UDP transport layer, or a global load balancer.
183183

184+
domains:
185+
type: array
186+
items:
187+
$ref: 'domains.yml'
188+
description: An array of objects specifying the domain configurations for a
189+
Global load balancer.
190+
191+
glb_settings:
192+
$ref: 'glb_settings.yml'
193+
194+
target_load_balancer_ids:
195+
type: array
196+
items:
197+
type: string
198+
example:
199+
- 7dbf91fe-cbdb-48dc-8290-c3a181554905
200+
- 996fa239-fac3-42a2-b9a1-9fa822268b7a
201+
description: An array containing the UUIDs of the Regional load balancers to be used as target
202+
backends for a Global load balancer.
203+
184204
required:
185205
- forwarding_rules

0 commit comments

Comments
 (0)