Database connections
Get database connections accessible by a user
Mock APIs
Teams
Organisations
Data sources
Database connections
Usage
Access control
Stub Mappings
- GETGet all stub mappings
- POSTCreate a new stub mapping
- DELDelete all stub mappings
- POSTReset stub mappings
- POSTPersist stub mappings
- POSTImport stub mappings
- GETGet stub mapping by ID
- PUTUpdate a stub mapping
- DELDelete a stub mapping
- POSTFind stub mappings matching metadata
- POSTDelete stub mappings matching metadata
Requests
OpenAPI
Imports
Database connections
Get database connections accessible by a user
GET
/
v1
/
users
/
{userId}
/
database-connections
curl --request GET \
--url https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections \
--header 'Authorization: Basic <encoded-value>'
{
"databaseConnections": [
{
"id": "abc123",
"connectionName": "My database connection",
"databaseType": "POSTGRESQL",
"host": "my-db.example.com",
"port": 5432,
"databaseName": "my-test-data",
"username": "alice",
"links": {
"self": "/v1/data-connections/abc123"
}
},
{
"id": "def456",
"connectionName": "My other database connection",
"databaseType": "MYSQL",
"host": "my.sql.com",
"port": 3306,
"databaseName": "my-sql-data",
"username": "bob",
"links": {
"self": "/v1/data-connections/def456"
}
}
],
"links": {
"self": "/v1/users/my-user/database-connections?page=2&limit=20",
"next": "/v1/users/my-user/database-connections?page=3&limit=20",
"previous": "/v1/users/my-user/database-connections?page=1&limit=20"
},
"meta": {
"start": 21,
"end": 40,
"total": 123,
"page": 2,
"totalPages": 7
}
}
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
Query Parameters
The amount of page items to retrieve.
The index of the page to retrieve.
A filter for the retrieved items. Only items whose name contains the filter value will be retrieved. The filter is case insensitive.
Response
200
application/json
200 response
The ID of the connection.
The name of the connection, for display purposes.
The SQL flavour of the database.
Available options:
POSTGRESQL
, MYSQL
, SQLSERVER
, ORACLE
The host name or address of the database.
The port number of the database.
The name of the database.
The name of the user to connect to the database as.
curl --request GET \
--url https://wmc.wiremockapi.cloud/v1/users/{userId}/database-connections \
--header 'Authorization: Basic <encoded-value>'
{
"databaseConnections": [
{
"id": "abc123",
"connectionName": "My database connection",
"databaseType": "POSTGRESQL",
"host": "my-db.example.com",
"port": 5432,
"databaseName": "my-test-data",
"username": "alice",
"links": {
"self": "/v1/data-connections/abc123"
}
},
{
"id": "def456",
"connectionName": "My other database connection",
"databaseType": "MYSQL",
"host": "my.sql.com",
"port": 3306,
"databaseName": "my-sql-data",
"username": "bob",
"links": {
"self": "/v1/data-connections/def456"
}
}
],
"links": {
"self": "/v1/users/my-user/database-connections?page=2&limit=20",
"next": "/v1/users/my-user/database-connections?page=3&limit=20",
"previous": "/v1/users/my-user/database-connections?page=1&limit=20"
},
"meta": {
"start": 21,
"end": 40,
"total": 123,
"page": 2,
"totalPages": 7
}
}