Cloud API
Databases
URL base https://cloud.yet.com.br/v1
As descrições dos endpoints estão em inglês.
O objeto
idstring- Its id.
kind"overlite" | "postgres" | "redis"- What it is.
namestring- Its name in its environment.
environment_idstring- Where it runs.
versionstring- What it runs;
versionslists the others. env_varstring- The variable attached applications find it in.
memory_mbnumber- The memory it may use.
stoppedboolean- Kept, not running.
List databases
/v1/databasesThe environments’, then the applications’.
curl https://cloud.yet.com.br/v1/databases \
-H "Authorization: Bearer $YET_API_KEY"Get a database
/v1/databases/{id}One database, and how it runs on each runtime.
curl https://cloud.yet.com.br/v1/databases/{id} \
-H "Authorization: Bearer $YET_API_KEY"Create a database
/v1/databasesIn an environment, at its newest version.
Quem: Developer everywhere, or admin
Corpo
kindstringobrigatóriooverlite,postgresorredis.namestringobrigatório- Its name.
environment_idstringobrigatório- Where it runs.
curl -X POST https://cloud.yet.com.br/v1/databases \
-H "Authorization: Bearer $YET_API_KEY" \
-d '{
"kind": "postgres",
"name": "orders",
"environment_id": "en_02K4"
}'{
"id": "db_01J9",
"kind": "postgres",
"name": "orders",
"environment_id": "en_02K4",
"version": "17",
"env_var": "DATABASE_URL"
}Change a database
/v1/databases/{id}Its name, version, memory, features, hostname, or the studio’s access; stopped or running.
Quem: Developer everywhere, or admin
Corpo
versionstring- One of
versions. memory_mbnumber- The memory it may use.
stoppedboolean- Stops it, or runs it again.
featuresstring[]pgvector;volatile,evictfor Redis.
curl -X PATCH https://cloud.yet.com.br/v1/databases/{id} \
-H "Authorization: Bearer $YET_API_KEY" \
-d '{
"memory_mb": 1024,
"features": [
"pgvector"
]
}'Back up now
/v1/databases/{id}/backupsA backup, to where its backups go.
Quem: Developer everywhere, or admin
curl -X POST https://cloud.yet.com.br/v1/databases/{id}/backups \
-H "Authorization: Bearer $YET_API_KEY"Delete a database
/v1/databases/{id}It stops; its volume stays on the server.
Quem: Developer everywhere, or admin
curl -X DELETE https://cloud.yet.com.br/v1/databases/{id} \
-H "Authorization: Bearer $YET_API_KEY"List its backups
/v1/databases/{id}/backupsHow it is copied, and its copies, the latest first.
curl https://cloud.yet.com.br/v1/databases/{id}/backups \
-H "Authorization: Bearer $YET_API_KEY"Set how it is backed up
/v1/databases/{id}/backupsEvery so many hours (0 is never), how many kept, and where: Yet’s bucket, or the company’s.
Quem: Developer everywhere, or admin
Corpo
everynumber- Hours between copies.
keepnumber- How many kept.
target"" | "company"- Where they go.
company{ region, access_key_id, secret_access_key, bucket, prefix }- The company’s bucket, with
target: "company".
curl -X PUT https://cloud.yet.com.br/v1/databases/{id}/backups \
-H "Authorization: Bearer $YET_API_KEY" \
-d '{
"every": 24,
"keep": 7
}'Download a backup
/v1/databases/{id}/backups/{backup}/downloadAn address to download it from, good for a while.
curl https://cloud.yet.com.br/v1/databases/{id}/backups/{backup}/download \
-H "Authorization: Bearer $YET_API_KEY"{
"url": "https://…"
}Run a query
/v1/databases/{id}/queriesIn one of its stages, by its runtime’s agent: answers at once, pending; ask for it again.
Quem: The database’s studio role
Corpo
statementstringobrigatório- The statement.
environment_idstring- The stage it runs in.
curl -X POST https://cloud.yet.com.br/v1/databases/{id}/queries \
-H "Authorization: Bearer $YET_API_KEY" \
-d '{
"statement": "select count(*) from orders"
}'Get a query
/v1/databases/{id}/queries/{query}Its status, and its result once done.
curl https://cloud.yet.com.br/v1/databases/{id}/queries/{query} \
-H "Authorization: Bearer $YET_API_KEY"