Skip to content

Update Database IP Allowlist

PUT
/dbaas/{managed_db_id}/allowlist/
curl --request PUT \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/allowlist/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"ip_allowlist": [
{
"cidr": "203.0.113.0/24",
"label": "office VPN"
},
"198.51.100.7"
]
}'

Replaces the whole IP allowlist. Only addresses in the list can reach the public endpoint. An empty list turns the public endpoint off and removes its address, leaving only the VPC route. Needs the Update permission on DBaaS.

managed_db_id
required
integer

Database ID

project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json
object
ip_allowlist
required

Each entry is an IPv4 address or CIDR range, as a string or as an object with cidr and an optional label. A bare address becomes a /32 range, host bits are cleared (10.0.0.5/24 becomes 10.0.0.0/24), and a repeated range is kept once. Up to 50 entries. 0.0.0.0/0 allows any address.

Array
One of:
string

Example

[
{
"cidr": "203.0.113.0/24",
"label": "office VPN"
},
"198.51.100.7"
]

The saved allowlist

Media typeapplication/json
object
code
integer
message
string
data
object
ip_allowlist
Array<object>
object
cidr
string
label

Description of the range; empty when none was given.

string
errors
object

Example

{
"code": 200,
"message": "Success",
"data": {
"ip_allowlist": [
{
"cidr": "203.0.113.0/24",
"label": "office VPN"
}
]
},
"errors": {}
}

An entry is not valid; errors.ip_allowlist reads “Too many allowlist rules (max 50).”, “‘’ is not a valid IPv4 address or CIDR range.” or “Allowlist label must be at most 63 characters.”, or ip_allowlist is missing (“This field is required.”). A missing or invalid project ID also gives 400 with errors “Project ID is missing or invalid”.

Media typeapplication/json
object
code
integer
message
string
data
object
errors

Keyed by field.

object

Example

{
"code": 400,
"message": "Bad Request",
"data": {},
"errors": {
"ip_allowlist": [
"'203.0.113.300' is not a valid IPv4 address or CIDR range."
]
}
}

The caller lacks the permission the call needs on the project, or the region is not allowed.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 403,
"message": "Forbidden",
"data": {},
"errors": "You don't have permission to access this service. Please verify your policy or project."
}

No database with that ID in the project and region.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 404,
"message": "Bad Request",
"data": {},
"errors": "Invalid request! Database Not Found"
}

The allowlist could not be applied; nothing changed.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 412,
"message": "Precondition Failed",
"data": {},
"errors": "Error occurred at backend! Please try after sometime."
}