curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/update/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "extensions": [ "pg_trgm" ], "ip_allowlist": [ { "cidr": "203.0.113.0/24", "label": "office VPN" } ]}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/update/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "extensions": [ "pg_trgm", ], "ip_allowlist": [ { "cidr": "203.0.113.0/24", "label": "office VPN", }, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/update/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "extensions": [ "pg_trgm" ], "ip_allowlist": [ { "cidr": "203.0.113.0/24", "label": "office VPN" } ] }),});console.log(await response.json());Changes several settings in one call. Send the fields to change: extensions, pg_id (or parameter_group_id), ip_allowlist, vpc_id and disk_size. They are applied in that order, each on its own, and results holds each one’s own response. The call answers 200 when all succeed, otherwise with the status of the first that failed; the others are still applied. pg_id: null detaches the parameter group and vpc_id: null detaches the VPC, when one is attached.
To make a single change instead, send action with that action’s fields; the response is then that change’s own response.
- Extensions install only while the database is
Running. Adding only extensions that are already installed is refused with “Already installed:”. - A parameter group attaches while the database is
RunningorScaling, and its values are set on the database at once. Values set by an earlier group stay unless the new group sets the same parameter. Detaching only removes the link; the values already applied stay. - The IP allowlist replaces the whole list, as in Update Database IP Allowlist.
- A VPC attaches or detaches while the database is
RunningorScaling, and the database restarts to take the change. Attaching a different VPC moves the database to it. On detach, the database moves onto the project’s default VPC, which is created then if the project has none. The default VPC itself cannot be detached. - The disk grows only while the database is
Running, as in Resize Database Storage.
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
Make only this change. extensions uses extensions; attach_pg uses pg_id; detach_pg takes nothing more; allowlist uses ip_allowlist; vpc uses vpc_id, subnet_id and vpc_action; scale uses disk_size.
Extensions to install, from List Database Extensions.
Example
[ "pg_trgm", "citext"]Parameter group to attach; null detaches.
Example
8Same as pg_id.
Example
8The whole new allowlist. 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"]VPC to attach; null detaches.
Example
17Subnet of the VPC. Optional; without it the VPC’s subnet is used.
Example
23With action: vpc. Without it, the VPC attaches when vpc_id is sent and detaches otherwise.
New disk size in GB, at least the current size.
Example
200Example
{ "extensions": [ "pg_trgm" ], "ip_allowlist": [ { "cidr": "203.0.113.0/24", "label": "office VPN" } ]}Responses
Section titled “Responses”Every change was applied or started. Without action, the body below; with action, that change’s own response.
object
The fields that were applied, in order.
Each field’s own response, with its code, message, data and errors.
object
Example
{ "code": 200, "updated": [ "extensions", "ip_allowlist" ], "results": { "extensions": { "code": 200, "data": { "installed": [ "pg_trgm" ], "already_installed": [], "failed": {}, "extensions": [ "pg_stat_statements", "pg_trgm", "plpgsql", "vector" ] }, "errors": {}, "message": "Success" }, "ip_allowlist": { "code": 200, "data": { "ip_allowlist": [ { "cidr": "203.0.113.0/24", "label": "office VPN" } ] }, "errors": {}, "message": "Success" } }}No field to change was sent (“No updatable fields provided. Send one or more of: disk_size, ip_allowlist, vpc_id, pg_id, extensions (or an explicit ‘action’).”) or action is not one this call accepts; these two come back as {"error": "..."}. Otherwise a change was refused, for example “Already installed: errors “Project ID is missing or invalid”.
object
Example
{ "error": "No updatable fields provided. Send one or more of: disk_size, ip_allowlist, vpc_id, pg_id, extensions (or an explicit 'action')."}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 (“Invalid request! Database Not Found”), or the parameter group, VPC or subnet was not found (“Parameter group not found.”, “VPC not found.”, “Subnet not found in this VPC.”).
object
object
Example
{ "code": 404, "message": "Bad Request", "data": {}, "errors": "Invalid request! Database Not Found"}The database is not Running (“Database NOT in RUNNING state. Please try again later.”) for a change that needs it, or a change could not be made (“Error occurred at backend! Please try after sometime.”, “Could not attach the VPC. Please try again.”, “Could not detach the VPC. Please try again.”, “This VPC cannot be detached. Attach another VPC instead.”).
object
object
Example
{ "code": 412, "message": "Precondition Failed", "data": {}, "errors": "Database NOT in RUNNING state. Please try again later."}