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.

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

As descrições dos endpoints estão em inglês.

O objeto

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.

Requisição
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.

Quem: Developer everywhere, or admin

Corpo

namestringobrigatório
Its name.
Requisição
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.

Requisição
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.

Requisição
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.

Quem: Developer everywhere, or admin

Corpo

namespace_idstringobrigatório
Its namespace.
namestringobrigatório
Its name.
stagesstring[]obrigatório
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.
Requisição
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.

Quem: Developer everywhere, or admin

Requisição
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.

Quem: Developer in its first stage

Corpo

imagestringobrigatório
The image: ghcr.io/acme/api:1.4.0.
Requisição
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.

Quem: Developer in the next stage

Corpo

fromstringobrigatório
The stage it goes from.
Requisição
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.

Quem: Developer everywhere, or admin

Requisição
curl -X DELETE https://cloud.yet.com.br/v1/applications/{id} \
  -H "Authorization: Bearer $YET_API_KEY"
Resposta · 204 Sem conteúdo

Build now

POST/v1/applications/{id}/builds

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

Quem: Developer everywhere, or admin

Requisição
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.

Requisição
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.

Requisição
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.

Quem: Developer everywhere, or admin

Corpo

kindstringobrigatório
overlite, postgres or redis.
env_varstring
The variable it finds it in.
placementstring
Where it runs.
Requisição
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.

Quem: Developer everywhere, or admin

Requisição
curl -X DELETE https://cloud.yet.com.br/v1/applications/{id}/resources/{resource} \
  -H "Authorization: Bearer $YET_API_KEY"
Resposta · 204 Sem conteúdo

Attach a database

POST/v1/applications/{id}/attachments

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

Quem: Developer everywhere, or admin

Corpo

resource_idstringobrigatório
The database.
env_varstringobrigatório
The variable.
Requisição
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.

Quem: Developer everywhere, or admin

Requisição
curl -X DELETE https://cloud.yet.com.br/v1/applications/{id}/attachments/{resource} \
  -H "Authorization: Bearer $YET_API_KEY"
Resposta · 204 Sem conteúdo

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.

Quem: Developer everywhere, or admin

Corpo

kind"logs" | "shell"obrigatório
What to open.
environmentstringobrigatório
The stage.
podstring
One pod’s, for logs.
Requisição
curl -X POST https://cloud.yet.com.br/v1/applications/{id}/sessions \
  -H "Authorization: Bearer $YET_API_KEY"
Resposta · 201
{
  "id": "se_01J9",
  "url": "wss://cloud.yet.com.br/sessions/se_01J9?ticket=…"
}