{
  "opencollection": "1.0.0",
  "info": {
    "name": "papi alert-query-proxy explorer API",
    "version": "2.0.0"
  },
  "items": [
    {
      "info": {
        "name": "explorer",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Explorer Health",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/internal/api/v1/health",
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Health check for the explorer API."
        },
        {
          "info": {
            "name": "Get Sli Env",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/internal/api/v1/getSLIEnv",
            "params": [
              {
                "name": "sli",
                "value": "",
                "type": "query",
                "description": "SLX full name (workspace--slx-name)"
              },
              {
                "name": "runnerUUID",
                "value": "",
                "type": "query",
                "description": "Runner UUID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Return execution environment for an SLI.\n\nCalled by runners before executing an SLI check.\nQuery param ``runnerUUID`` replaces the old ``locationUUID`` name."
        },
        {
          "info": {
            "name": "Get Sli Env",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/internal/api/v1/getSLIEnv",
            "params": [
              {
                "name": "sli",
                "value": "",
                "type": "query",
                "description": "SLX full name (workspace--slx-name)"
              },
              {
                "name": "runnerUUID",
                "value": "",
                "type": "query",
                "description": "Runner UUID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Return execution environment for an SLI.\n\nCalled by runners before executing an SLI check.\nQuery param ``runnerUUID`` replaces the old ``locationUUID`` name."
        },
        {
          "info": {
            "name": "Register Runner",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/internal/api/v1/runners/register",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Register or update a runner in the runners table.\n\nPorted from Go pkg/explorer/explorer.go RegisterRunnerLocation.\nLook up by (display name + workspace). If found, return existing\n(preserves any pre-existing rows that were created with random UUIDs).\nIf not found, create a new row with the deterministic\n``f\"{workspace}--{runner}\"`` identity."
        },
        {
          "info": {
            "name": "Runner Status Update",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/internal/api/v1/runners/status",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update runner heartbeat and status for an existing runner.\n\nPorted from Go pkg/explorer/explorer.go UpdateRunnerLocationStatus.\nLooks up the runner by UUID (``runnerUUID`` is the ``name`` column).\nUpdates ``last_heartbeat`` and persists the ``runnerStatus`` payload.\nReturns 404 if the runner is not found."
        },
        {
          "info": {
            "name": "Runner Run Status",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/internal/api/v1/runners/run-status",
            "params": [
              {
                "name": "type",
                "value": "",
                "type": "query",
                "description": "'sli' or 'runbook'"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Receive run-status updates from runners after SLI/Runbook execution.\n\nPorted from Go pkg/explorer/explorer.go LocationUpdate.\n\nBody is a RunnerLocation:\n  { \"runnerUUID\": \"...\", \"status\": { \"name\": \"<slx-full-name>\", \"code\": \"...\", \"message\": \"...\" } }\n\nSteps (independent queries — partial failure is acceptable):\n1. Look up runner by runnerUUID; update last_heartbeat. If not found, log and return early.\n2. Look up SLI or Runbook by slx full name; update last_run_* columns."
        },
        {
          "info": {
            "name": "List Slis",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/internal/api/v1/sli",
            "params": [
              {
                "name": "workspace",
                "value": "",
                "type": "query",
                "description": "Workspace name"
              },
              {
                "name": "runnerUUID",
                "value": "",
                "type": "query",
                "description": "Runner UUID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "List SLIs for a workspace, optionally filtered by runner.\n\nReturns SLI names with workspace and runner info.\nCalled by runner-control for SLI cron scheduling."
        },
        {
          "info": {
            "name": "List Code Collections",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/internal/api/v1/codeCollection",
            "params": [
              {
                "name": "workspace",
                "value": "",
                "type": "query",
                "description": "Workspace name"
              },
              {
                "name": "runnerUUID",
                "value": "",
                "type": "query",
                "description": "Runner UUID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "List code collections used by SLIs and Runbooks assigned to a runner.\n\nMirrors Go ``handleGetCodeCollection``: derives collections dynamically\nfrom SLIs (cronCodeRunCount) and Runbooks (codeRunCount) that are\nassigned to the given runner in the given workspace.  The\n``CodeCollection`` table is NOT queried directly because it may not\nreflect what the runner actually needs to run.\n\nIntentional divergence from the Go handler: when a CCV resolves, ``gitUrl``\nis emitted from the *resolved collection'"
        },
        {
          "info": {
            "name": "Get Code Collection",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/internal/api/v1/codeCollection/:collection_id",
            "params": [
              {
                "name": "collection_id",
                "value": "",
                "type": "path"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get a single code collection by ID with its built CCV image tags."
        }
      ]
    }
  ],
  "bundled": true
}