Cloud API

Applications

Something the company runs, in a namespace, through its stages — one environment each, in order. Built from a GitHub repository, or released from an image.

Base URL https://cloud.yet.com.br/v1

The object

idstring
Its id.
namespace_idstring
Its namespace.
namestring
Its name.
stagesstring[]
Its environments, in order.
subdomainstring
The name it answers at under its stages’ domains.
portnumber
8080 unless set.
replicasnumber
1 unless set.
envobject
Its variables, in every stage.
stage_envobject
Each stage’s own, by environment id.
repositorystring
owner/name on the company’s GitHub.
auto_promotestring[]
Stages that promote to the next by themselves.

List namespaces

GET/v1/namespaces

The groups applications belong to.

Request
curl https://cloud.yet.com.br/v1/namespaces \
  -H "Authorization: Bearer $YET_API_KEY"

Create a namespace

POST/v1/namespaces

A group of applications: a product, a team.

Who: Developer everywhere, or admin

Body

namestringrequired
Its name.
Request
curl -X POST https://cloud.yet.com.br/v1/namespaces \
  -H "Authorization: Bearer $YET_API_KEY" \
  -d '{
    "name": "shop"
  }'

List applications

GET/v1/applications

Those in environments the key’s person sees.

Request
curl https://cloud.yet.com.br/v1/applications \
  -H "Authorization: Bearer $YET_API_KEY"

Get an application

GET/v1/applications/{id}

With each stage: what runs there, and its address.

Request
curl https://cloud.yet.com.br/v1/applications/{id} \
  -H "Authorization: Bearer $YET_API_KEY"

Create an application

POST/v1/applications

In a namespace, with its stages.

Who: Developer everywhere, or admin

Body

namespace_idstringrequired
Its namespace.
namestringrequired
Its name.
stagesstring[]required
Its environments, in order, each on a runtime of its own.
repositorystring
Built from: owner/name.
branchstring
The branch whose pushes are built.
portnumber
The port it listens on.
replicasnumber
How many run in each stage.
envobject
Its variables.
Request
curl -X POST https://cloud.yet.com.br/v1/applications \
  -H "Authorization: Bearer $YET_API_KEY" \
  -d '{
    "namespace_id": "ns_01J9",
    "name": "api",
    "stages": [
      "en_01J9",
      "en_02K4"
    ],
    "repository": "acme/api",
    "branch": "main",
    "port": 3000
  }'

Change an application

PATCH/v1/applications/{id}

Any of its fields; each given whole.

Who: Developer everywhere, or admin

Request
curl -X PATCH https://cloud.yet.com.br/v1/applications/{id} \
  -H "Authorization: Bearer $YET_API_KEY"

Release an image

POST/v1/applications/{id}/releases

A numbered release of an image, deployed to the first stage.

Who: Developer in its first stage

Body

imagestringrequired
The image: ghcr.io/acme/api:1.4.0.
Request
curl -X POST https://cloud.yet.com.br/v1/applications/{id}/releases \
  -H "Authorization: Bearer $YET_API_KEY" \
  -d '{
    "image": "ghcr.io/acme/api:1.4.0"
  }'

Promote

POST/v1/applications/{id}/promote

What runs in one stage, to the next.

Who: Developer in the next stage

Body

fromstringrequired
The stage it goes from.
Request
curl -X POST https://cloud.yet.com.br/v1/applications/{id}/promote \
  -H "Authorization: Bearer $YET_API_KEY" \
  -d '{
    "from": "en_01J9"
  }'

Delete an application

DELETE/v1/applications/{id}

It stops running in every stage.

Who: Developer everywhere, or admin

Request
curl -X DELETE https://cloud.yet.com.br/v1/applications/{id} \
  -H "Authorization: Bearer $YET_API_KEY"
Response · 204 No Content

Build now

POST/v1/applications/{id}/builds

From its repository’s branch, now — the release follows when it is built.

Who: Developer everywhere, or admin

Request
curl -X POST https://cloud.yet.com.br/v1/applications/{id}/builds \
  -H "Authorization: Bearer $YET_API_KEY"

Get a build

GET/v1/applications/{id}/builds/{build}

The build, and how it ran on each runtime — its log among it.

Request
curl https://cloud.yet.com.br/v1/applications/{id}/builds/{build} \
  -H "Authorization: Bearer $YET_API_KEY"

List its own databases

GET/v1/applications/{id}/resources

The databases of its own, beside it in each stage.

Request
curl https://cloud.yet.com.br/v1/applications/{id}/resources \
  -H "Authorization: Bearer $YET_API_KEY"

Give it a database

POST/v1/applications/{id}/resources

Of its own, beside it in each stage.

Who: Developer everywhere, or admin

Body

kindstringrequired
overlite, postgres or redis.
env_varstring
The variable it finds it in.
placementstring
Where it runs.
Request
curl -X POST https://cloud.yet.com.br/v1/applications/{id}/resources \
  -H "Authorization: Bearer $YET_API_KEY"

Remove its database

DELETE/v1/applications/{id}/resources/{resource}

It stops; its volume stays.

Who: Developer everywhere, or admin

Request
curl -X DELETE https://cloud.yet.com.br/v1/applications/{id}/resources/{resource} \
  -H "Authorization: Bearer $YET_API_KEY"
Response · 204 No Content

Attach a database

POST/v1/applications/{id}/attachments

One of its environments’ databases, handed in a variable.

Who: Developer everywhere, or admin

Body

resource_idstringrequired
The database.
env_varstringrequired
The variable.
Request
curl -X POST https://cloud.yet.com.br/v1/applications/{id}/attachments \
  -H "Authorization: Bearer $YET_API_KEY" \
  -d '{
    "resource_id": "db_01J9",
    "env_var": "ORDERS_URL"
  }'

Detach a database

DELETE/v1/applications/{id}/attachments/{resource}

The variable goes at the next deploy.

Who: Developer everywhere, or admin

Request
curl -X DELETE https://cloud.yet.com.br/v1/applications/{id}/attachments/{resource} \
  -H "Authorization: Bearer $YET_API_KEY"
Response · 204 No Content

Open a session

POST/v1/applications/{id}/sessions

Its logs as they come, or a shell in a copy of it: answers with a WebSocket address, good for a moment.

Who: Developer everywhere, or admin

Body

kind"logs" | "shell"required
What to open.
environmentstringrequired
The stage.
podstring
One pod’s, for logs.
Request
curl -X POST https://cloud.yet.com.br/v1/applications/{id}/sessions \
  -H "Authorization: Bearer $YET_API_KEY"
Response · 201
{
  "id": "se_01J9",
  "url": "wss://cloud.yet.com.br/sessions/se_01J9?ticket=…"
}