Saagie Log-proxy API

You can run queries in a command line like curl or Postman request on your local computer.

Get Your Token

To generate your token and save it in a variable, enter the following command line:

YOUR_TOKEN=$(curl -k -X "POST" -H "Content-Type: application/json" -H "Saagie-Realm: YOUR_REALM" "https://<your_saagie_host>/authentication/api/open/authenticate" -d '{"login":"<LOGIN>", "password":"<PASSWORD>"}')

Endpoint Servers

Queries:

  • Get all logs from a specific entity

    • log-proxy/api/logs e.g.

      https://<your_saagie_host>/log-proxy/api/logs/...
  • Download a log file from a specific entity

    • log-proxy/api/download e.g.

      https://<your_saagie_host>/log-proxy/api/download/...

Path params:

Path Description

realm

The realm (e.g. saagie)

platform id

The platform ID (e.g. 1)

project id

The project uuid

entity type

The type of entity (e.g. job_instance, app_execution, condition_instance)

entity id

The entity uuid

Query params:

Query Description

streams

The streams to filter logs (e.g. STDOUT, STDERR, ORCHESTRATION_STDOUT, ORCHESTRATION_STDERR, ENVVARS_STDOUT, ENVVARS_STDERR)

skip

The number of logs to skip

limit

The maximum number of logs to return (default 10000)

source

The source of the logs (e.g. elastic, mongo, unknown)

Examples:

curl --location 'https://<your_saagie_host>/api/logs/<realm>/platform/<platform_id>/project/<project_id>/<entity_type>/<entity_id>?streams=STDOUT,STDERR&limit=2&skip=0' \
--header 'Authorization: Bearer <SAAGIE_TOKEN>'

Response:

{
    "logs": [
        {
            "index": 0,
            "stream": "STDOUT",
            "time": "2025-01-13T08:56:55.058057435Z",
            "value": "Rewriting url based on Saagie Base Path"
        },
        {
            "index": 1,
            "stream": "STDOUT",
            "time": "2025-01-13T08:56:55.370537625Z",
            "value": "smart_replace - replacementsEverywhere - ASSET_DIR - .js"
        }
    ],
    "limit": 2,
    "total": 3702,
    "order": "asc",
    "source": "elastic"
}