-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathdatabases_update_firewall_rules.yml
More file actions
73 lines (59 loc) · 2.23 KB
/
databases_update_firewall_rules.yml
File metadata and controls
73 lines (59 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
operationId: databases_update_firewall_rules
summary: Update Firewall Rules (Trusted Sources) for a Database
description: >-
To update a database cluster's firewall rules (known as "trusted sources" in
the control panel), send a PUT request to
`/v2/databases/$DATABASE_ID/firewall` specifying which resources should be
able to open connections to the database. You may limit connections to
specific Droplets, Kubernetes clusters, or IP addresses. When a tag is
provided, any Droplet or Kubernetes node with that tag applied to it will
have access. The firewall is limited to 2000 IPs or CIDR addresses. Each rule can resolve to multiple IP addresses (type k8s, for example).
When possible, we recommend [placing your databases into a VPC network](https://docs.digitalocean.com/products/networking/vpc/)
to limit access to them instead of using a firewall. In addition, we recommend using CIDR addresses when possible instead of individual IPs,
as both types contribute the same amount to the 2000 limit.
tags:
- Databases
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
rules:
type: array
items:
$ref: 'models/firewall_rule.yml'
example:
rules:
- type: ip_addr
value: '192.168.1.1'
description: 'my home IP address'
- type: k8s
value: ff2a6c52-5a44-4b63-b99c-0e98e7a63d61
- type: droplet
value: '163973392'
- type: tag
value: backend
parameters:
- $ref: 'parameters.yml#/database_cluster_uuid'
responses:
'204':
$ref: '../../shared/responses/no_content.yml'
'401':
$ref: '../../shared/responses/unauthorized.yml'
'404':
$ref: '../../shared/responses/not_found.yml'
'429':
$ref: '../../shared/responses/too_many_requests.yml'
'500':
$ref: '../../shared/responses/server_error.yml'
default:
$ref: '../../shared/responses/unexpected_error.yml'
x-codeSamples:
- $ref: 'examples/curl/databases_update_firewall_rules.yml'
- $ref: 'examples/go/databases_update_firewall_rules.yml'
- $ref: 'examples/python/databases_update_firewall_rules.yml'
security:
- bearer_auth:
- 'database:update'