Skip to content

Get Database Connection Bundle

GET
/dbaas/{managed_db_id}/connect/
curl --request GET \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/connect/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>'

Returns the connection details for all three purposes in one call, each as in Get Database Connection Info. No part holds a password. The database must be Running. Needs the Read 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

The connection details

Media typeapplication/json
object
code
integer
message
string
data
object
connection
object
application
object
purpose
string
Allowed values: application psql
host

The database’s public address. While the database has no IP allowlist it has no public address, and this is its internal name, which cannot be reached from outside.

string
port
integer
database

The database created at launch.

string
user

The admin username set at creation.

string
password_note
string
connection_strings

The same connection in four forms. None holds the password.

object
url
string
env
string
psql
string
jdbc
string
snippets

Short code samples that read the URL from DATABASE_URL.

object
nodejs
string
python
string
django
string
sqlalchemy
string
go
string
ssl_required

Connections must use SSL.

boolean
psql
object
purpose
string
Allowed values: application psql
host

The database’s public address. While the database has no IP allowlist it has no public address, and this is its internal name, which cannot be reached from outside.

string
port
integer
database

The database created at launch.

string
user

The admin username set at creation.

string
password_note
string
connection_strings

The same connection in four forms. None holds the password.

object
url
string
env
string
psql
string
jdbc
string
snippets

Short code samples that read the URL from DATABASE_URL.

object
nodejs
string
python
string
django
string
sqlalchemy
string
go
string
ssl_required

Connections must use SSL.

boolean
errors
object

Example

{
"code": 200,
"message": "Success",
"data": {
"connection": {
"application": {
"purpose": "application",
"host": "<host>",
"port": 5432,
"database": "defaultdb",
"user": "appadmin",
"password_note": "Replace <password> with the password of 'appadmin'. In the URL form, percent-encode special characters in the password (for example @ as %40, : as %3A, / as %2F).",
"connection_strings": {
"url": "postgresql://appadmin:<password>@<host>:5432/defaultdb?sslmode=require",
"env": "DATABASE_URL=postgresql://appadmin:<password>@<host>:5432/defaultdb?sslmode=require",
"psql": "psql \"host=<host> port=5432 dbname=defaultdb user=appadmin sslmode=require\"",
"jdbc": "jdbc:postgresql://<host>:5432/defaultdb?user=appadmin&ssl=true"
},
"ssl_required": true
},
"psql": {
"purpose": "application",
"host": "<host>",
"port": 5432,
"database": "defaultdb",
"user": "appadmin",
"password_note": "Replace <password> with the password of 'appadmin'. In the URL form, percent-encode special characters in the password (for example @ as %40, : as %3A, / as %2F).",
"connection_strings": {
"url": "postgresql://appadmin:<password>@<host>:5432/defaultdb?sslmode=require",
"env": "DATABASE_URL=postgresql://appadmin:<password>@<host>:5432/defaultdb?sslmode=require",
"psql": "psql \"host=<host> port=5432 dbname=defaultdb user=appadmin sslmode=require\"",
"jdbc": "jdbc:postgresql://<host>:5432/defaultdb?user=appadmin&ssl=true"
},
"ssl_required": true
}
}
},
"errors": {}
}

The project ID is missing or is not a number.

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

Example

{
"code": 400,
"message": "Bad Request",
"data": {},
"errors": "Project ID is missing or invalid"
}

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 database is not Running (“Database NOT in RUNNING state. Please try again later.”).

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

Example

{
"code": 412,
"message": "Precondition Failed",
"data": {},
"errors": "Database NOT in RUNNING state. Please try again later."
}