FerryDocs
DevelopersAPI reference

Datastores

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

List datastores

GET/api/v1/datastores

Every datastore with its connection info, or those of one environment.

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

Query Parameters

environment?string

Only those of this environment (id or name). 404 when there is no such environment.

Response Body

application/json

application/json

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",    "environment": "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) in its environment (omitted: production) and provisions the container on that environment's private network: only its services reach it. A failed provisioning still answers 201, with status failed and the reason in error. A name is unique in its environment, which datastores and services share: another environment may use the same 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",  "environment": "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: a name is looked up in the environment of environment (omitted: production).

Query Parameters

environment?string

The environment (id or name) of the service or datastore the path names. Omitted = production. With an id in the path, the environment must be that one's. 404 when there is no such environment.

Response Body

application/json

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",  "environment": "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: a name is looked up in the environment of environment (omitted: production).

Query Parameters

environment?string

The environment (id or name) of the service or datastore the path names. Omitted = production. With an id in the path, the environment must be that one's. 404 when there is no such environment.

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",  "environment": "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: a name is looked up in the environment of environment (omitted: production).

Query Parameters

environment?string

The environment (id or name) of the service or datastore the path names. Omitted = production. With an id in the path, the environment must be that one's. 404 when there is no such environment.

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