Endpoints

Documentação detalhada de todos os endpoints da API DeployAlly.

Templates

GET /templates

Lista templates disponíveis.

Query Parameters:

Parâmetro Tipo Descrição
kingdom string Filtrar por kingdom
family string Filtrar por family
species string Filtrar por species
page int Página (default: 1)
per_page int Itens por página (default: 20)

Request:

curl -X GET "https://sys.deployally.com/api/v1/templates?family=database" \
  -H "Authorization: Bearer da_xxx"

Response:

{
  "success": true,
  "data": [
    {
      "id": "tpl_abc123",
      "name": "MySQL Database Server",
      "version": "8.4",
      "taxonomy": {
        "kingdom": "assets",
        "family": "database",
        "species": "mysql",
        "variant": "standard",
        "specimen": "8.4"
      },
      "spec_hash": "sha256:abc123...",
      "deprecated": false,
      "created_at": "2026-01-15T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 14
  }
}

GET /templates/{id}

Retorna detalhes de um template específico.

Request:

curl -X GET "https://sys.deployally.com/api/v1/templates/tpl_abc123" \
  -H "Authorization: Bearer da_xxx"

Response:

{
  "success": true,
  "data": {
    "id": "tpl_abc123",
    "name": "MySQL Database Server",
    "description": "Banco de dados relacional MySQL",
    "version": "8.4",
    "taxonomy": {
      "kingdom": "assets",
      "family": "database",
      "species": "mysql",
      "variant": "standard",
      "specimen": "8.4"
    },
    "spec": {
      "image": {
        "repository": "mysql",
        "tag": "8.4"
      },
      "user_inputs": {
        "root_password": {
          "type": "password",
          "required": true
        },
        "database_name": {
          "type": "string",
          "required": true
        }
      },
      "profiles": ["minimal", "development", "production"],
      "ports": [{"container_port": 3306}],
      "volumes": [{"mount_path": "/var/lib/mysql"}]
    },
    "spec_hash": "sha256:abc123..."
  }
}

Definitions

GET /definitions

Lista definitions do usuário/servidor.

Query Parameters:

Parâmetro Tipo Descrição
server_id string Filtrar por servidor
status string Filtrar por status
page int Página
per_page int Itens por página

Request:

curl -X GET "https://sys.deployally.com/api/v1/definitions" \
  -H "Authorization: Bearer da_xxx"

Response:

{
  "success": true,
  "data": [
    {
      "id": "def_xyz789",
      "name": "mysql_meu_banco",
      "template_id": "tpl_abc123",
      "server_id": "srv_123",
      "status": "active",
      "current_revision": 2,
      "container_name": "mysql_meu_banco",
      "created_at": "2026-01-20T14:00:00Z",
      "updated_at": "2026-01-25T09:00:00Z"
    }
  ]
}

POST /definitions

Cria uma nova definition.

Request Body:

Campo Tipo Obrigatório Descrição
template_id string Sim ID do template
server_id string Sim ID do servidor
name string Sim Nome da definition
params object Sim Parâmetros do template
profile string Não Profile (default: development)

Request:

curl -X POST "https://sys.deployally.com/api/v1/definitions" \
  -H "Authorization: Bearer da_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "tpl_abc123",
    "server_id": "srv_123",
    "name": "mysql_producao",
    "params": {
      "root_password": "senha_root_segura",
      "database_name": "app_db",
      "user_name": "app_user",
      "user_password": "senha_user_segura"
    },
    "profile": "production"
  }'

Response:

{
  "success": true,
  "data": {
    "id": "def_new123",
    "name": "mysql_producao",
    "status": "pending",
    "current_revision": 1,
    "created_at": "2026-02-13T10:00:00Z"
  }
}

PUT /definitions/{id}

Atualiza uma definition existente (cria nova revisão).

Request:

curl -X PUT "https://sys.deployally.com/api/v1/definitions/def_xyz789" \
  -H "Authorization: Bearer da_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "profile": "production",
    "params": {
      "user_password": "nova_senha_segura"
    }
  }'

DELETE /definitions/{id}

Remove uma definition e seu container.

Request:

curl -X DELETE "https://sys.deployally.com/api/v1/definitions/def_xyz789" \
  -H "Authorization: Bearer da_xxx"

Instances

GET /instances

Lista instances (containers em execução).

Request:

curl -X GET "https://sys.deployally.com/api/v1/instances" \
  -H "Authorization: Bearer da_xxx"

Response:

{
  "success": true,
  "data": [
    {
      "id": "inst_abc",
      "definition_id": "def_xyz789",
      "container_id": "abc123def456",
      "container_name": "mysql_meu_banco",
      "status": "running",
      "health": "healthy",
      "started_at": "2026-02-10T08:00:00Z",
      "uptime_seconds": 259200
    }
  ]
}

POST /instances/{id}/restart

Reinicia um container.

curl -X POST "https://sys.deployally.com/api/v1/instances/inst_abc/restart" \
  -H "Authorization: Bearer da_xxx"

POST /instances/{id}/stop

Para um container.

curl -X POST "https://sys.deployally.com/api/v1/instances/inst_abc/stop" \
  -H "Authorization: Bearer da_xxx"

POST /instances/{id}/start

Inicia um container parado.

curl -X POST "https://sys.deployally.com/api/v1/instances/inst_abc/start" \
  -H "Authorization: Bearer da_xxx"

Servers

GET /servers

Lista servidores registrados.

curl -X GET "https://sys.deployally.com/api/v1/servers" \
  -H "Authorization: Bearer da_xxx"

POST /servers

Registra um novo servidor.

Request Body:

Campo Tipo Descrição
name string Nome do servidor
environment string development, staging, production
description string Descrição opcional
curl -X POST "https://sys.deployally.com/api/v1/servers" \
  -H "Authorization: Bearer da_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "servidor-producao-01",
    "environment": "production",
    "description": "Servidor principal de produção"
  }'

Response:

{
  "success": true,
  "data": {
    "id": "srv_new123",
    "name": "servidor-producao-01",
    "api_key": "da_server_xxx",
    "status": "pending",
    "created_at": "2026-02-13T10:00:00Z"
  }
}

Importante: A api_key do servidor só é retornada uma vez. Armazene-a com segurança.


Deployments

GET /deployments

Lista histórico de deployments.

curl -X GET "https://sys.deployally.com/api/v1/deployments" \
  -H "Authorization: Bearer da_xxx"

POST /deployments

Executa um deployment.

Request Body:

Campo Tipo Descrição
definition_id string ID da definition
server_id string ID do servidor (opcional se definition já tem)
curl -X POST "https://sys.deployally.com/api/v1/deployments" \
  -H "Authorization: Bearer da_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "definition_id": "def_xyz789"
  }'

Response:

{
  "success": true,
  "data": {
    "id": "deploy_abc123",
    "definition_id": "def_xyz789",
    "server_id": "srv_123",
    "status": "pending",
    "created_at": "2026-02-13T10:00:00Z"
  }
}

GET /deployments/{id}

Detalhes de um deployment específico, incluindo logs.

curl -X GET "https://sys.deployally.com/api/v1/deployments/deploy_abc123" \
  -H "Authorization: Bearer da_xxx"

Health Check

GET /health

Verifica se a API está funcionando (não requer autenticação).

curl -X GET "https://sys.deployally.com/api/v1/health"

Response:

{
  "status": "healthy",
  "version": "0.5.1",
  "timestamp": "2026-02-13T12:00:00Z"
}

Webhooks

POST /webhooks

Configura webhook para notificações.

curl -X POST "https://sys.deployally.com/api/v1/webhooks" \
  -H "Authorization: Bearer da_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://meu-site.com/webhook",
    "events": ["deployment.success", "deployment.failed", "instance.unhealthy"],
    "secret": "meu_webhook_secret"
  }'

Eventos disponíveis:

  • deployment.started
  • deployment.success
  • deployment.failed
  • instance.started
  • instance.stopped
  • instance.unhealthy
  • definition.created
  • definition.updated
By Borlot.com.br on 13/02/2026