/v1/databases/{uid}/firewall-policiesReturns the firewall policies attached to the database, with their rules and every resource each policy is attached to. Returns an empty list when no policy is attached.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe database's uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The attached firewall policies.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataarray of objectsShow item attributesHide item attributes
uidstringRequiredUnique identifier of the policy.
namestringRequiredName of the policy, unique in the workspace.
slugstringRequiredURL-friendly form of the name.
descriptionstringFree-text description. Omitted when empty.
is_defaultbooleanRequiredWhether the policy is labelled as a workspace default. It is not applied automatically.
rulesarray of objectsThe policy's rules, oldest first. Omitted when the policy has no rules.
Show item attributesHide item attributes
operation_idstringRequiredOn Add a firewall rule and
Update a firewall rule, the UID of the
first firewall.apply operation queued for the change. An empty string when no
operation was queued, and always empty when rules are returned inside a policy.
uidstringRequiredUnique identifier of the rule.
directionstringRequiredTraffic direction the rule applies to.
One ofinboundoutbound
actionstringRequiredWhat happens to matching traffic. Always allow.
One ofallow
protocolstringRequiredIP protocol the rule matches.
One oftcpudpall
port_startintegerRequiredFirst port of the range. 0 with port_end 0 means all ports.
port_endintegerRequiredLast port of the range.
cidrstringRequiredSource address range in CIDR notation.
descriptionstringNote about the rule. Omitted when empty.
is_defaultbooleanRequiredtrue for the SSH and app-port rules added automatically when the policy was created.
attached_resourcesarray of objectsResources the policy is attached to, newest first. Omitted when there are none.
Show item attributesHide item attributes
operation_idstringRequiredOn Attach a firewall policy, the UID
of the firewall.apply operation queued for the resource. An empty string when the
policy was already attached or no operation could be queued, and always empty when
attachments are returned inside a policy.
uidstringRequiredUnique identifier of the attachment. Use it to detach the policy.
resource_typestringRequiredKind of resource the policy is attached to.
One ofvmdatabasedeployment
resourceobjectRequiredShort description of the attached resource. All fields are empty strings if the resource no longer exists.
Show attributesHide attributes
uidstringRequiredUID of the VM, database or deployment.
namestringRequiredName of the resource.
slugstringRequiredSlug of the resource.
statusstringRequiredCurrent status of the resource. For VMs and databases this is the display status.
created_atstring (date-time)RequiredWhen the policy was created (RFC 3339).
updated_atstring (date-time)RequiredWhen the policy itself was last changed. Rule changes do not update it.
Errors
| Status | Meaning |
|---|---|
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | The resource does not exist or you cannot access it. |
Errors use the standard error format.