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" ]}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/allowlist/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "ip_allowlist": [ { "cidr": "203.0.113.0/24", "label": "office VPN", }, "198.51.100.7", ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/allowlist/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "ip_allowlist": [ { "cidr": "203.0.113.0/24", "label": "office VPN" }, "198.51.100.7" ] }),});console.log(await response.json());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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Database ID
Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
object
Example
203.0.113.0/24Optional description, up to 63 characters.
Example
office VPNExample
[ { "cidr": "203.0.113.0/24", "label": "office VPN" }, "198.51.100.7"]Responses
Section titled “Responses”The saved allowlist
object
object
object
Description of the range; empty when none was given.
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).”, “‘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”.
object
object
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.
object
object
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.
object
object
Example
{ "code": 404, "message": "Bad Request", "data": {}, "errors": "Invalid request! Database Not Found"}The allowlist could not be applied; nothing changed.
object
object
Example
{ "code": 412, "message": "Precondition Failed", "data": {}, "errors": "Error occurred at backend! Please try after sometime."}