Skip to content
NebulaCtrldocs
HTTP APIEndpoints

Databases

Database services: templates, connections, queries, readers and point-in-time recovery. Each operation lists its method and path, parameters, request body, responses and an example call.

GET/api/v1/database-templates

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Response Body

application/json

application/problem+json

curl -X GET "https://example.com/api/v1/database-templates"
{  "$schema": "https://example.com/TemplatesOutputBody.json",  "templates": [    {      "engineVersion": "string",      "image": "string",      "port": 0,      "template": "postgres"    }  ]}
GET/api/v1/projects/{id}/database-connections

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Path Parameters

id*string

Response Body

application/json

application/problem+json

curl -X GET "https://example.com/api/v1/projects/string/database-connections"
{  "$schema": "https://example.com/ConnectionsOutputBody.json",  "items": [    {      "reference": "string",      "serviceId": "string",      "serviceName": "string",      "serviceSlug": "string",      "template": "postgres",      "urlKey": "string",      "variable": "string"    }  ]}
POST/api/v1/projects/{id}/databases

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://example.com/api/v1/projects/string/databases" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "template": "postgres"  }'
{  "$schema": "https://example.com/CreatedBody.json",  "changeSet": {    "$schema": "https://example.com/ViewBody.json",    "changeSet": {      "appliedAt": "2019-08-24T14:15:22Z",      "approvalId": "string",      "createdAt": "2019-08-24T14:15:22Z",      "downtimeAccepted": true,      "environmentId": "string",      "id": "string",      "message": "string",      "reason": "string",      "source": "console",      "sourceCommit": "string",      "state": "draft"    },    "environmentId": "string",    "items": [      {        "createdAt": "2019-08-24T14:15:22Z",        "from": "string",        "id": "string",        "key": "string",        "kind": "string",        "label": "string",        "managed": true,        "processId": "string",        "secret": true,        "serviceId": "string",        "serviceSlug": "string",        "to": "string",        "toEmpty": true,        "volumeId": "string"      }    ],    "projectConfig": {      "changeSet": {        "appliedAt": "2019-08-24T14:15:22Z",        "approvalId": "string",        "createdAt": "2019-08-24T14:15:22Z",        "downtimeAccepted": true,        "environmentId": "string",        "id": "string",        "message": "string",        "reason": "string",        "source": "console",        "sourceCommit": "string",        "state": "draft"      },      "items": [        {          "createdAt": "2019-08-24T14:15:22Z",          "from": "string",          "id": "string",          "key": "string",          "kind": "string",          "label": "string",          "managed": true,          "processId": "string",          "secret": true,          "serviceId": "string",          "serviceSlug": "string",          "to": "string",          "toEmpty": true,          "volumeId": "string"        }      ],      "summary": {        "affectedServiceIds": [          "string"        ],        "needsApproval": true,        "requiresDowntime": true      }    },    "summary": {      "affectedServiceIds": [        "string"      ],      "needsApproval": true,      "requiresDowntime": true    }  },  "hint": "string",  "image": "string",  "scheduledBackups": 0,  "service": {    "createdAt": "2019-08-24T14:15:22Z",    "id": "string",    "imageRepository": "string",    "name": "string",    "projectId": "string",    "slug": "string",    "template": "postgres"  }}
GET/api/v1/services/{id}/database

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Path Parameters

id*string

Query Parameters

environmentId*string

Response Body

application/json

application/problem+json

curl -X GET "https://example.com/api/v1/services/string/database?environmentId=string"
{  "$schema": "https://example.com/InfoBody.json",  "cnpgAvailable": true,  "connectionUrlMasked": "string",  "engineVersion": "string",  "image": "string",  "internalHost": "string",  "pitr": {    "enabled": true,    "window": {      "firstRecoverabilityPoint": "2019-08-24T14:15:22Z",      "lastSuccessfulBackup": "2019-08-24T14:15:22Z"    }  },  "port": 0,  "postgres": {    "autoFailover": true,    "autoFailoverAvailable": true,    "readers": [      {        "connections": 0,        "lagSeconds": 0.1,        "maxConnections": 0,        "node": "string",        "podName": "string",        "ready": true,        "state": "string",        "syncState": "string",        "walBytesPerSecond": 0.1,        "writesPerSecond": 0.1      }    ],    "writer": {      "connections": 0,      "lagSeconds": 0.1,      "maxConnections": 0,      "node": "string",      "podName": "string",      "ready": true,      "state": "string",      "syncState": "string",      "walBytesPerSecond": 0.1,      "writesPerSecond": 0.1    }  },  "tables": [    {      "name": "string",      "rows": 0,      "sizeBytes": 0    }  ],  "tablesError": "string",  "template": "postgres"}
POST/api/v1/services/{id}/database/promote

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

curl -X POST "https://example.com/api/v1/services/string/database/promote" \  -H "Content-Type: application/json" \  -d '{    "environmentId": "string",    "podName": "string"  }'
Empty
POST/api/v1/services/{id}/database/query

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://example.com/api/v1/services/string/database/query" \  -H "Content-Type: application/json" \  -d '{    "environmentId": "string",    "query": "string"  }'
{  "$schema": "https://example.com/QueryOutputBody.json",  "columns": [    "string"  ],  "durationMs": 0,  "readOnly": true,  "rowCount": 0,  "rows": [    [      "string"    ]  ],  "truncated": true}
PUT/api/v1/services/{id}/pitr

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X PUT "https://example.com/api/v1/services/string/pitr" \  -H "Content-Type: application/json" \  -d '{    "enabled": true,    "environmentId": "string"  }'
{  "$schema": "https://example.com/PutPITROutputBody.json",  "objectStoreId": "string",  "prefix": "string"}
POST/api/v1/services/{id}/pitr/restore

Authorization

AuthorizationBearer <token>

An API token, sent as Authorization: Bearer <token>. A token belongs to one organization and has the role it was created with, so it needs no X-Nebula-Organization header; if you send one, it must name the token's organization.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://example.com/api/v1/services/string/pitr/restore" \  -H "Content-Type: application/json" \  -d '{    "at": "2019-08-24T14:15:22Z",    "environmentId": "string"  }'
{  "$schema": "https://example.com/RestorePITROutputBody.json",  "environmentId": "string",  "image": "string",  "service": {    "createdAt": "2019-08-24T14:15:22Z",    "id": "string",    "imageRepository": "string",    "name": "string",    "projectId": "string",    "slug": "string",    "template": "postgres"  },  "targetTime": "2019-08-24T14:15:22Z"}