FerryDocs
ReferenceAPI reference

Datastores

Managed Postgres and Redis instances with their connection strings and resource limits.

List datastores

GET/api/v1/datastores

Authorization

AuthorizationBearer <token>

An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.

In: header

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/datastores" \  -H "Authorization: Bearer $FERRY_TOKEN"
[  {    "cpu_limit": 0,    "created_at": "2019-08-24T14:15:22Z",    "database": "string",    "error": "string",    "host_port": 0,    "id": "string",    "kind": "postgres",    "memory_limit_mb": 0,    "name": "string",    "password": "string",    "status": "creating",    "updated_at": "2019-08-24T14:15:22Z",    "username": "string",    "version": "string",    "external_url": "string",    "internal_host": "string",    "internal_port": 0,    "internal_url": "string"  }]

Create a datastore

POST/api/v1/datastores

Creates the row (creating) and provisions the container. A failed provisioning still answers 201, with status failed and the reason in error. Datastores and services share one namespace of names. memory_limit_mb (MiB, 16 MiB to 1 TiB) and cpu_limit (CPUs, 0.01 to 512, rounded to 0.01) limit the container; omitted or 0 = the server default (see GET /api/v1/info).

Authorization

AuthorizationBearer <token>

An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST /api/v1/datastores

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/datastores" \  -H "Authorization: Bearer $FERRY_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "kind": "postgres",    "name": "string"  }'
{  "cpu_limit": 0,  "created_at": "2019-08-24T14:15:22Z",  "database": "string",  "error": "string",  "host_port": 0,  "id": "string",  "kind": "postgres",  "memory_limit_mb": 0,  "name": "string",  "password": "string",  "status": "creating",  "updated_at": "2019-08-24T14:15:22Z",  "username": "string",  "version": "string",  "external_url": "string",  "internal_host": "string",  "internal_port": 0,  "internal_url": "string"}

Get a datastore

GET/api/v1/datastores/{id}

Authorization

AuthorizationBearer <token>

An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.

In: header

Path Parameters

id*string

Datastore id or name.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/datastores/string" \  -H "Authorization: Bearer $FERRY_TOKEN"
{  "cpu_limit": 0,  "created_at": "2019-08-24T14:15:22Z",  "database": "string",  "error": "string",  "host_port": 0,  "id": "string",  "kind": "postgres",  "memory_limit_mb": 0,  "name": "string",  "password": "string",  "status": "creating",  "updated_at": "2019-08-24T14:15:22Z",  "username": "string",  "version": "string",  "external_url": "string",  "internal_host": "string",  "internal_port": 0,  "internal_url": "string"}
PATCH/api/v1/datastores/{id}

Every field is optional: memory_limit_mb (MiB, 16 MiB to 1 TiB) and cpu_limit (CPUs, 0.01 to 512, rounded to 0.01); 0 = back to the server default (see GET /api/v1/info). The limits are applied to the datastore's container in place, without a restart, whatever the datastore's status (a memory limit below what the datastore currently uses can fail, or get it killed for running out of memory; a failed datastore gets them for its next start). A datastore whose container is not created yet gets them when it is. When applying them fails after they were saved, the error message says so.

Authorization

AuthorizationBearer <token>

An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.

In: header

Path Parameters

id*string

Datastore id or name.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

PATCH /api/v1/datastores/{id} — change resource limits. 0 clears (server default). Applied to the running container in place (no restart).

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v1/datastores/string" \  -H "Authorization: Bearer $FERRY_TOKEN" \  -H "Content-Type: application/json" \  -d '{}'
{  "cpu_limit": 0,  "created_at": "2019-08-24T14:15:22Z",  "database": "string",  "error": "string",  "host_port": 0,  "id": "string",  "kind": "postgres",  "memory_limit_mb": 0,  "name": "string",  "password": "string",  "status": "creating",  "updated_at": "2019-08-24T14:15:22Z",  "username": "string",  "version": "string",  "external_url": "string",  "internal_host": "string",  "internal_port": 0,  "internal_url": "string"}

Delete a datastore

DELETE/api/v1/datastores/{id}

Removes its container and its data volume. Refused while services reference it in their env (${{datastore.NAME...}}), unless force=true.

Authorization

AuthorizationBearer <token>

An API token: one created in the dashboard or by ferry login, or the server token stored in <data-dir>/api_token. GET requests may send it as ?access_token= instead.

In: header

Path Parameters

id*string

Datastore id or name.

Query Parameters

force?boolean

Delete even though services reference it (they will fail to deploy or restart).

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/datastores/string" \  -H "Authorization: Bearer $FERRY_TOKEN"
Empty