Files

3976 lines
135 KiB
Go

// Package apiswagger Code generated by swaggo/swag. DO NOT EDIT
package apiswagger
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/": {
"get": {
"description": "Get server version and info",
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "Server info",
"responses": {
"200": {
"description": "Server information",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/health": {
"get": {
"description": "Check if the server is running",
"produces": [
"application/json"
],
"tags": [
"Health"
],
"summary": "Health check",
"responses": {
"200": {
"description": "status: ok",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/health/ready": {
"get": {
"description": "Check if the server is ready to accept requests",
"produces": [
"application/json"
],
"tags": [
"Health"
],
"summary": "Readiness check",
"responses": {
"200": {
"description": "status: ready",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/osm/api/artifacts": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of artifacts with optional filtering and existence checks",
"produces": [
"application/json"
],
"tags": [
"Artifacts"
],
"summary": "List artifacts",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
},
{
"type": "string",
"description": "Search in artifact name/path",
"name": "search",
"in": "query"
},
{
"type": "integer",
"description": "Filter by HTTP status code (also accepts statusCode)",
"name": "status_code",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "Annotate results with path_exists and path_is_dir",
"name": "verify_exist",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of artifacts with pagination",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch artifacts",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/artifacts/{workspace_name}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Download a single file under the given workspace by relative artifact path",
"produces": [
"application/octet-stream"
],
"tags": [
"Artifacts"
],
"summary": "Download workspace artifact",
"parameters": [
{
"type": "string",
"description": "Workspace name",
"name": "workspace_name",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Relative path to artifact under workspace",
"name": "artifact_path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Artifact file",
"schema": {
"type": "file"
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Artifact not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to download artifact",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/asset-stats": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get unique values for technologies, sources, remarks, and asset types across all assets or filtered by workspace",
"produces": [
"application/json"
],
"tags": [
"Stats"
],
"summary": "Get asset statistics",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
}
],
"responses": {
"200": {
"description": "Asset statistics",
"schema": {
"$ref": "#/definitions/database.AssetStatsData"
}
},
"500": {
"description": "Failed to get stats",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/assets": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of assets with optional filtering",
"produces": [
"application/json"
],
"tags": [
"Assets"
],
"summary": "List assets",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
},
{
"type": "string",
"description": "Search in asset_value, url, title, host_ip",
"name": "search",
"in": "query"
},
{
"type": "integer",
"description": "Filter by HTTP status code",
"name": "status_code",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of assets with pagination",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch assets",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/assets/diff": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Compare assets between two time points to find added, removed, and changed assets",
"produces": [
"application/json"
],
"tags": [
"Assets"
],
"summary": "Get asset diff",
"parameters": [
{
"type": "string",
"description": "Workspace name",
"name": "workspace",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Start time (RFC3339 format or Unix timestamp)",
"name": "from",
"in": "query",
"required": true
},
{
"type": "string",
"description": "End time (default: now)",
"name": "to",
"in": "query"
}
],
"responses": {
"200": {
"description": "Asset diff result",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid parameters",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to get asset diff",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/assets/diffs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of stored asset diff snapshots",
"produces": [
"application/json"
],
"tags": [
"Assets"
],
"summary": "List asset diff snapshots",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of asset diff snapshots with pagination",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch asset diff snapshots",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/database/tables": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get list of all database tables with row counts",
"produces": [
"application/json"
],
"tags": [
"Database"
],
"summary": "List database tables",
"responses": {
"200": {
"description": "List of tables with counts",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/database/tables/{table}/clear": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete all records from a specific database table (destructive operation)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Database"
],
"summary": "Clear database table",
"parameters": [
{
"type": "string",
"description": "Table name (runs, step_results, event_logs, artifacts, assets, schedules, workspaces, vulnerabilities, asset_diffs, vuln_diffs)",
"name": "table",
"in": "path",
"required": true
},
{
"description": "Confirmation with force=true required",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ClearTableRequest"
}
}
],
"responses": {
"200": {
"description": "Table cleared successfully",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request or missing force confirmation",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to clear table",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/event-logs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of event logs with optional filtering",
"produces": [
"application/json"
],
"tags": [
"EventLogs"
],
"summary": "List event logs",
"parameters": [
{
"type": "string",
"description": "Filter by event topic (e.g., run.started, run.completed)",
"name": "topic",
"in": "query"
},
{
"type": "string",
"description": "Filter by event name",
"name": "name",
"in": "query"
},
{
"type": "string",
"description": "Filter by source (scheduler, api, webhook)",
"name": "source",
"in": "query"
},
{
"type": "string",
"description": "Filter by workspace",
"name": "workspace",
"in": "query"
},
{
"type": "string",
"description": "Filter by run UUID",
"name": "run_uuid",
"in": "query"
},
{
"type": "string",
"description": "Filter by workflow name",
"name": "workflow_name",
"in": "query"
},
{
"type": "string",
"description": "Filter by processed status (true/false)",
"name": "processed",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of event logs with pagination",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch event logs",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/event-receiver/status": {
"get": {
"description": "Returns the status of the event receiver including enabled state and counts",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"event-receiver"
],
"summary": "Get event receiver status",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.EventReceiverStatusResponse"
}
}
}
}
},
"/osm/api/event-receiver/workflows": {
"get": {
"description": "Returns all workflows registered with the event receiver",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"event-receiver"
],
"summary": "List event receiver workflows",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.EventReceiverWorkflowsResponse"
}
}
}
}
},
"/osm/api/events/emit": {
"post": {
"description": "Emits an event that can trigger event-triggered workflows",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"event-receiver"
],
"summary": "Emit an event",
"parameters": [
{
"description": "Event to emit",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.EmitEventRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.EmitEventResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/functions/eval": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Execute a utility function script with template rendering and JavaScript execution",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Functions"
],
"summary": "Execute utility function",
"parameters": [
{
"description": "Function evaluation request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.FunctionEvalRequest"
}
}
],
"responses": {
"200": {
"description": "Evaluation result",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/functions/list": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a flat list of all available utility functions with metadata",
"produces": [
"application/json"
],
"tags": [
"Functions"
],
"summary": "List utility functions",
"responses": {
"200": {
"description": "List of functions with total count",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/jobs/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get the aggregated status of a job and its runs",
"produces": [
"application/json"
],
"tags": [
"Jobs"
],
"summary": "Get job status",
"parameters": [
{
"type": "string",
"description": "Job ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Job status",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Job not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/llm/v1/chat/completions": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Send a chat completion request to the configured LLM provider (OpenAI-compatible)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"LLM"
],
"summary": "LLM Chat Completion",
"parameters": [
{
"description": "Chat request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LLMChatRequest"
}
}
],
"responses": {
"200": {
"description": "Chat response",
"schema": {
"$ref": "#/definitions/handlers.LLMChatResponse"
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "LLM error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/llm/v1/embeddings": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Generate embeddings for input text using the configured LLM provider",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"LLM"
],
"summary": "Generate Embeddings",
"parameters": [
{
"description": "Embedding request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LLMEmbeddingRequest"
}
}
],
"responses": {
"200": {
"description": "Embedding response",
"schema": {
"$ref": "#/definitions/handlers.LLMEmbeddingResponse"
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "LLM error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/login": {
"post": {
"description": "Authenticate user and get JWT token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "User login",
"parameters": [
{
"description": "Login credentials",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "JWT token",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "Invalid credentials",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/logout": {
"post": {
"description": "Clear the session cookie",
"produces": [
"application/json"
],
"tags": [
"Auth"
],
"summary": "User logout",
"responses": {
"200": {
"description": "Logout message",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/osm/api/registry-info": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get binary registry with mode support (direct-fetch or nix-build)",
"produces": [
"application/json"
],
"tags": [
"Install"
],
"summary": "Get registry info",
"parameters": [
{
"type": "string",
"default": "direct-fetch",
"description": "Registry mode: direct-fetch or nix-build",
"name": "registry_mode",
"in": "query"
},
{
"type": "string",
"description": "Custom registry URL or local file path. In direct-fetch mode: source for the full binary list. In nix-build mode: metadata overlay (desc, tags, version).",
"name": "registry_url",
"in": "query"
}
],
"responses": {
"200": {
"description": "Registry data",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to load registry",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/registry-install": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Install binaries from registry or workflows from git/zip URL. Supports direct-fetch and nix-build modes.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Install"
],
"summary": "Install binaries or workflows",
"parameters": [
{
"description": "Installation configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.InstallRequest"
}
}
],
"responses": {
"200": {
"description": "Installation result",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Installation failed",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/runs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of workflow runs with optional filters",
"produces": [
"application/json"
],
"tags": [
"Runs"
],
"summary": "List runs",
"parameters": [
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "Filter by status (pending, running, completed, failed, cancelled)",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "Filter by workflow name",
"name": "workflow",
"in": "query"
},
{
"type": "string",
"description": "Filter by target (partial match)",
"name": "target",
"in": "query"
},
{
"type": "string",
"description": "Filter by workspace name (exact match)",
"name": "workspace",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of runs",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Execute a workflow against one or more targets. Supports multiple targets via array or file, concurrency control, priority levels, custom timeouts, runner configuration (host/docker/ssh), and scheduling via cron expressions.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Runs"
],
"summary": "Create a new run",
"parameters": [
{
"description": "Run configuration with optional priority, timeout, runner config, and scheduling",
"name": "run",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CreateRunRequest"
}
}
],
"responses": {
"202": {
"description": "Run started",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Workflow not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/runs/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details of a specific run by ID, including steps and artifacts",
"produces": [
"application/json"
],
"tags": [
"Runs"
],
"summary": "Get run details",
"parameters": [
{
"type": "string",
"description": "Run ID or RunID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "boolean",
"default": false,
"description": "Include step results",
"name": "include_steps",
"in": "query"
},
{
"type": "boolean",
"default": false,
"description": "Include artifacts",
"name": "include_artifacts",
"in": "query"
}
],
"responses": {
"200": {
"description": "Run details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Run not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Cancel a running workflow execution. This will terminate all running processes associated with the run.",
"produces": [
"application/json"
],
"tags": [
"Runs"
],
"summary": "Cancel a run",
"parameters": [
{
"type": "string",
"description": "Run ID or RunID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Run cancelled",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Run cannot be cancelled",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Run not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/runs/{id}/duplicate": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a copy of an existing run with pending status. The duplicate will have the same workflow, target, and parameters but a new UUID.",
"produces": [
"application/json"
],
"tags": [
"Runs"
],
"summary": "Duplicate a run",
"parameters": [
{
"type": "string",
"description": "Run ID or RunUUID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"description": "Run duplicated",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Run not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/runs/{id}/start": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Start a run that is in pending status. This triggers the workflow execution.",
"produces": [
"application/json"
],
"tags": [
"Runs"
],
"summary": "Start a pending run",
"parameters": [
{
"type": "string",
"description": "Run ID or RunUUID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"202": {
"description": "Run started",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Run cannot be started (not in pending status)",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Run or workflow not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/schedules": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of all scheduled workflows",
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "List all schedules",
"parameters": [
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of schedules",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a scheduled workflow execution with cron expression",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "Create a new schedule",
"parameters": [
{
"description": "Schedule configuration",
"name": "schedule",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CreateScheduleRequest"
}
}
],
"responses": {
"201": {
"description": "Schedule created",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/schedules/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details of a specific schedule by ID",
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "Get schedule details",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Schedule details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Schedule not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update an existing schedule",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "Update a schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Schedule update data",
"name": "schedule",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.UpdateScheduleRequest"
}
}
],
"responses": {
"200": {
"description": "Schedule updated",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Schedule not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a schedule by ID",
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "Delete a schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Schedule deleted",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Schedule not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/schedules/{id}/disable": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Disable an enabled schedule",
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "Disable a schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Schedule disabled",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/schedules/{id}/enable": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Enable a disabled schedule",
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "Enable a schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Schedule enabled",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/schedules/{id}/trigger": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Manually trigger a scheduled workflow execution",
"produces": [
"application/json"
],
"tags": [
"Schedules"
],
"summary": "Trigger a schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"202": {
"description": "Schedule triggered",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/settings/reload": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Forces an immediate reload of the configuration file. Hot reload must be enabled.",
"produces": [
"application/json"
],
"tags": [
"Settings"
],
"summary": "Force config reload",
"responses": {
"200": {
"description": "Configuration reloaded successfully",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Hot reload not enabled",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to reload configuration",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/settings/status": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns the current configuration version and hot reload status",
"produces": [
"application/json"
],
"tags": [
"Settings"
],
"summary": "Get config status",
"responses": {
"200": {
"description": "Configuration status",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/settings/yaml": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Returns the entire configuration file with sensitive fields redacted",
"produces": [
"text/yaml"
],
"tags": [
"Settings"
],
"summary": "Get YAML configuration",
"responses": {
"200": {
"description": "YAML configuration content",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/snapshot-download/{workspace_name}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Compress a workspace folder into a zip file and download it",
"produces": [
"application/zip"
],
"tags": [
"Snapshots"
],
"summary": "Download workspace snapshot",
"parameters": [
{
"type": "string",
"description": "Workspace name",
"name": "workspace_name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Zip file download",
"schema": {
"type": "file"
}
},
"404": {
"description": "Workspace not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to create snapshot",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/snapshots": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of available snapshot files in the snapshot directory",
"produces": [
"application/json"
],
"tags": [
"Snapshots"
],
"summary": "List snapshots",
"responses": {
"200": {
"description": "List of snapshots",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to list snapshots",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/snapshots/export": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Export a workspace to a compressed zip archive and download it",
"consumes": [
"application/json"
],
"produces": [
"application/zip"
],
"tags": [
"Snapshots"
],
"summary": "Export workspace snapshot",
"parameters": [
{
"description": "Workspace to export",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SnapshotExportRequest"
}
}
],
"responses": {
"200": {
"description": "Snapshot zip file",
"schema": {
"type": "file"
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Workspace not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to create snapshot",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/snapshots/import": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Import a workspace from an uploaded zip file or URL",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Snapshots"
],
"summary": "Import workspace snapshot",
"parameters": [
{
"type": "file",
"description": "Snapshot zip file to import",
"name": "file",
"in": "formData"
},
{
"type": "string",
"description": "URL of snapshot to download and import",
"name": "url",
"in": "formData"
},
{
"type": "boolean",
"description": "Overwrite existing workspace if present",
"name": "force",
"in": "formData"
},
{
"type": "boolean",
"description": "Skip database import (files only)",
"name": "skip_db",
"in": "formData"
}
],
"responses": {
"200": {
"description": "Import result",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to import snapshot",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/snapshots/{name}": {
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a snapshot file by name",
"produces": [
"application/json"
],
"tags": [
"Snapshots"
],
"summary": "Delete snapshot",
"parameters": [
{
"type": "string",
"description": "Snapshot filename",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Snapshot deleted",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Snapshot not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to delete snapshot",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/stats": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get aggregated counts for workflows, runs, workspaces, assets, vulnerabilities, and schedules",
"produces": [
"application/json"
],
"tags": [
"Stats"
],
"summary": "Get system statistics",
"responses": {
"200": {
"description": "System statistics",
"schema": {
"$ref": "#/definitions/database.SystemStats"
}
},
"500": {
"description": "Failed to get stats",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/step-results": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of step results with optional filtering",
"produces": [
"application/json"
],
"tags": [
"Steps"
],
"summary": "List step results",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
},
{
"type": "string",
"description": "Filter by status (pending, running, completed, failed)",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "Filter by step type (bash, function, etc.)",
"name": "step_type",
"in": "query"
},
{
"type": "string",
"description": "Filter by run UUID",
"name": "run_uuid",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of step results with pagination",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch step results",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/tasks": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all running and completed tasks",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "List all tasks",
"responses": {
"200": {
"description": "List of running and completed tasks",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to list tasks",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Submit a new task to the distributed worker queue",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "Submit a new task",
"parameters": [
{
"description": "Task configuration",
"name": "task",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SubmitTaskRequest"
}
}
],
"responses": {
"202": {
"description": "Task submitted",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to submit task",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/tasks/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details for a specific task by ID",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "Get task details",
"parameters": [
{
"type": "string",
"description": "Task ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Task details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Task not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/upload-file": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Upload a file containing a list of inputs (targets, URLs, etc.) for later use in runs",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Files"
],
"summary": "Upload input file",
"parameters": [
{
"type": "file",
"description": "Input file to upload",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "File uploaded with path",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/vulnerabilities": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of vulnerabilities with optional workspace, severity, and confidence filtering",
"produces": [
"application/json"
],
"tags": [
"Vulnerabilities"
],
"summary": "List vulnerabilities",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
},
{
"type": "string",
"description": "Filter by severity (critical, high, medium, low, info)",
"name": "severity",
"in": "query"
},
{
"type": "string",
"description": "Filter by confidence (certain, firm, tentative, manual review required)",
"name": "confidence",
"in": "query"
},
{
"type": "string",
"description": "Filter by asset value (partial match)",
"name": "asset_value",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of vulnerabilities with pagination",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch vulnerabilities",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new vulnerability record",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Vulnerabilities"
],
"summary": "Create vulnerability",
"parameters": [
{
"description": "Vulnerability data",
"name": "vulnerability",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CreateVulnerabilityInput"
}
}
],
"responses": {
"201": {
"description": "Created vulnerability",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid input",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to create vulnerability",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/vulnerabilities/diff": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Compare vulnerabilities between two time points to find added, removed, and changed vulnerabilities",
"produces": [
"application/json"
],
"tags": [
"Vulnerabilities"
],
"summary": "Get vulnerability diff",
"parameters": [
{
"type": "string",
"description": "Workspace name",
"name": "workspace",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Start time (RFC3339 format or Unix timestamp)",
"name": "from",
"in": "query",
"required": true
},
{
"type": "string",
"description": "End time (default: now)",
"name": "to",
"in": "query"
}
],
"responses": {
"200": {
"description": "Vulnerability diff result",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid parameters",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to get vulnerability diff",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/vulnerabilities/diffs": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a paginated list of stored vulnerability diff snapshots",
"produces": [
"application/json"
],
"tags": [
"Vulnerabilities"
],
"summary": "List vulnerability diff snapshots",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of vulnerability diff snapshots with pagination",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch vulnerability diff snapshots",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/vulnerabilities/summary": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a summary of vulnerabilities grouped by severity",
"produces": [
"application/json"
],
"tags": [
"Vulnerabilities"
],
"summary": "Get vulnerability summary",
"parameters": [
{
"type": "string",
"description": "Filter by workspace name",
"name": "workspace",
"in": "query"
}
],
"responses": {
"200": {
"description": "Vulnerability summary by severity",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to get summary",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/vulnerabilities/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a single vulnerability by its ID",
"produces": [
"application/json"
],
"tags": [
"Vulnerabilities"
],
"summary": "Get vulnerability by ID",
"parameters": [
{
"type": "integer",
"description": "Vulnerability ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Vulnerability details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid ID",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Vulnerability not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to fetch vulnerability",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a vulnerability by ID",
"produces": [
"application/json"
],
"tags": [
"Vulnerabilities"
],
"summary": "Delete vulnerability",
"parameters": [
{
"type": "integer",
"description": "Vulnerability ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Vulnerability deleted",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid ID",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Vulnerability not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to delete vulnerability",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workers": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all registered workers in the distributed pool",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "List all workers",
"responses": {
"200": {
"description": "List of workers",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to list workers",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workers/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details for a specific worker by ID",
"produces": [
"application/json"
],
"tags": [
"Distributed"
],
"summary": "Get worker details",
"parameters": [
{
"type": "string",
"description": "Worker ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Worker details",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Worker not found",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to get worker",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflow-upload": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Upload a raw YAML workflow file and save it to the workflows directory",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Workflows"
],
"summary": "Upload workflow file",
"parameters": [
{
"type": "file",
"description": "Workflow YAML file",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"201": {
"description": "Workflow uploaded",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request or YAML",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflows": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available workflows with details",
"produces": [
"application/json"
],
"tags": [
"Workflows"
],
"summary": "List all workflows",
"responses": {
"200": {
"description": "List of workflows",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to load workflows",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflows/refresh": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Re-index all workflows from filesystem to database",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Workflows"
],
"summary": "Refresh workflow index",
"parameters": [
{
"type": "boolean",
"description": "Force re-index all workflows regardless of checksum",
"name": "force",
"in": "query"
}
],
"responses": {
"200": {
"description": "Indexing result",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Indexing failed",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflows/tags": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all unique tags from indexed workflows in database",
"produces": [
"application/json"
],
"tags": [
"Workflows"
],
"summary": "Get all workflow tags",
"responses": {
"200": {
"description": "List of tags",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to get tags",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workflows/{name}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get workflow content. Returns raw YAML by default. Use json=true to get JSON with parsed details.",
"produces": [
"application/json",
"text/yaml"
],
"tags": [
"Workflows"
],
"summary": "Get workflow details",
"parameters": [
{
"type": "string",
"description": "Workflow name",
"name": "name",
"in": "path",
"required": true
},
{
"type": "boolean",
"description": "Return JSON with parsed details instead of raw YAML",
"name": "json",
"in": "query"
}
],
"responses": {
"200": {
"description": "Workflow details (JSON) or raw YAML content",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "Workflow not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workspace-names": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a sorted list of workspace names from the database",
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "List workspace names",
"responses": {
"200": {
"description": "Workspace names",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"500": {
"description": "Failed to list workspace names",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/osm/api/workspaces": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all run workspaces. By default returns full workspace records from database. Use filesystem=true to list workspaces derived from assets.",
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "List all workspaces",
"parameters": [
{
"type": "boolean",
"default": false,
"description": "List workspaces from filesystem/assets instead of workspaces table",
"name": "filesystem",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Number of records to skip",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"default": 20,
"description": "Maximum number of records to return (max 10000)",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of workspaces",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Failed to read workspaces",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/server-info": {
"get": {
"description": "Get server version and info in JSON",
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "Server info JSON",
"responses": {
"200": {
"description": "Server information",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"core.LLMMessage": {
"type": "object",
"properties": {
"content": {
"description": "string or []LLMContentPart"
},
"name": {
"type": "string"
},
"role": {
"$ref": "#/definitions/core.LLMMessageRole"
},
"tool_call_id": {
"type": "string"
},
"tool_calls": {
"type": "array",
"items": {
"$ref": "#/definitions/core.LLMToolCall"
}
}
}
},
"core.LLMMessageRole": {
"type": "string",
"enum": [
"system",
"user",
"assistant",
"tool"
],
"x-enum-varnames": [
"LLMRoleSystem",
"LLMRoleUser",
"LLMRoleAssistant",
"LLMRoleTool"
]
},
"core.LLMResponseFormat": {
"type": "object",
"properties": {
"json_schema": {
"type": "object",
"additionalProperties": true
},
"type": {
"description": "\"text\", \"json_object\", \"json_schema\"",
"type": "string"
}
}
},
"core.LLMTool": {
"type": "object",
"properties": {
"function": {
"$ref": "#/definitions/core.LLMToolFunction"
},
"type": {
"description": "\"function\"",
"type": "string"
}
}
},
"core.LLMToolCall": {
"type": "object",
"properties": {
"function": {
"$ref": "#/definitions/core.LLMToolCallFunction"
},
"id": {
"type": "string"
},
"type": {
"description": "\"function\"",
"type": "string"
}
}
},
"core.LLMToolCallFunction": {
"type": "object",
"properties": {
"arguments": {
"description": "JSON string",
"type": "string"
},
"name": {
"type": "string"
}
}
},
"core.LLMToolFunction": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"parameters": {
"type": "object",
"additionalProperties": true
}
}
},
"database.AssetStats": {
"type": "object",
"properties": {
"total": {
"type": "integer"
}
}
},
"database.AssetStatsData": {
"type": "object",
"properties": {
"asset_types": {
"type": "array",
"items": {
"type": "string"
}
},
"remarks": {
"type": "array",
"items": {
"type": "string"
}
},
"sources": {
"type": "array",
"items": {
"type": "string"
}
},
"technologies": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"database.RunStats": {
"type": "object",
"properties": {
"completed": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"pending": {
"type": "integer"
},
"running": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
},
"database.ScheduleStats": {
"type": "object",
"properties": {
"enabled": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
},
"database.SystemStats": {
"type": "object",
"properties": {
"assets": {
"$ref": "#/definitions/database.AssetStats"
},
"runs": {
"$ref": "#/definitions/database.RunStats"
},
"schedules": {
"$ref": "#/definitions/database.ScheduleStats"
},
"vulnerabilities": {
"$ref": "#/definitions/database.VulnerabilityStats"
},
"workflows": {
"$ref": "#/definitions/database.WorkflowStats"
},
"workspaces": {
"$ref": "#/definitions/database.WorkspaceStats"
}
}
},
"database.VulnerabilityStats": {
"type": "object",
"properties": {
"critical": {
"type": "integer"
},
"high": {
"type": "integer"
},
"low": {
"type": "integer"
},
"medium": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
},
"database.WorkflowStats": {
"type": "object",
"properties": {
"flows": {
"type": "integer"
},
"modules": {
"type": "integer"
},
"total": {
"type": "integer"
}
}
},
"database.WorkspaceStats": {
"type": "object",
"properties": {
"total": {
"type": "integer"
}
}
},
"handlers.ClearTableRequest": {
"type": "object",
"properties": {
"force": {
"description": "Must be true to confirm the destructive operation",
"type": "boolean"
}
}
},
"handlers.CreateRunRequest": {
"type": "object",
"properties": {
"concurrency": {
"description": "Concurrency control",
"type": "integer"
},
"docker_image": {
"description": "Docker image to use when runner_type=docker",
"type": "string"
},
"empty_target": {
"description": "Run without target (generates placeholder target)",
"type": "boolean"
},
"flow": {
"description": "Workflow identification",
"type": "string"
},
"heuristics_check": {
"description": "Heuristics check level: none, basic, advanced",
"type": "string"
},
"module": {
"description": "Module workflow name",
"type": "string"
},
"notify_on_complete": {
"description": "Send notification when run completes",
"type": "boolean"
},
"params": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"priority": {
"description": "Priority and timeout",
"type": "string"
},
"repeat": {
"description": "Repeat run after completion",
"type": "boolean"
},
"repeat_wait_time": {
"description": "Wait time between repeats (e.g., 30s, 20m, 10h, 1d)",
"type": "string"
},
"run_mode": {
"description": "local, distributed, cloud (default: local)",
"type": "string"
},
"runner_type": {
"description": "Runner configuration",
"type": "string"
},
"schedule": {
"description": "Scheduling options",
"type": "string"
},
"schedule_enabled": {
"description": "Enable scheduled execution",
"type": "boolean"
},
"skip_validation": {
"description": "Validation",
"type": "boolean"
},
"ssh_host": {
"description": "SSH host when runner_type=ssh",
"type": "string"
},
"target": {
"type": "string"
},
"target_file": {
"description": "Path to file containing targets (one per line)",
"type": "string"
},
"targets": {
"description": "Multi-target support",
"type": "array",
"items": {
"type": "string"
}
},
"threads_hold": {
"description": "Execution options (mirrors CLI flags)",
"type": "integer"
},
"timeout": {
"description": "Timeout in minutes (0 = no timeout)",
"type": "integer"
}
}
},
"handlers.CreateScheduleRequest": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"event_topic": {
"type": "string"
},
"name": {
"type": "string"
},
"params": {
"type": "object",
"additionalProperties": true
},
"runner_type": {
"type": "string"
},
"schedule": {
"description": "cron expression",
"type": "string"
},
"target": {
"type": "string"
},
"trigger_type": {
"description": "cron, event, watch, manual",
"type": "string"
},
"watch_path": {
"type": "string"
},
"workflow_kind": {
"description": "\"module\" or \"flow\"",
"type": "string"
},
"workflow_name": {
"type": "string"
},
"workspace": {
"type": "string"
}
}
},
"handlers.CreateVulnerabilityInput": {
"type": "object",
"properties": {
"asset_type": {
"type": "string"
},
"asset_value": {
"type": "string"
},
"detail_http_request": {
"type": "string"
},
"detail_http_response": {
"type": "string"
},
"raw_vuln_json": {
"type": "string"
},
"severity": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"vuln_desc": {
"type": "string"
},
"vuln_info": {
"type": "string"
},
"vuln_poc": {
"type": "string"
},
"vuln_title": {
"type": "string"
},
"workspace": {
"type": "string"
}
}
},
"handlers.EmitEventRequest": {
"type": "object",
"properties": {
"data": {
"type": "object",
"additionalProperties": true
},
"data_type": {
"type": "string"
},
"name": {
"type": "string"
},
"source": {
"type": "string"
},
"topic": {
"type": "string"
}
}
},
"handlers.EmitEventResponse": {
"type": "object",
"properties": {
"event_id": {
"type": "string"
},
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
}
},
"handlers.EventReceiverStatusResponse": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"running": {
"type": "boolean"
},
"trigger_count": {
"type": "integer"
},
"workflow_count": {
"type": "integer"
}
}
},
"handlers.EventReceiverTriggerResponse": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"topic": {
"type": "string"
},
"trigger_name": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
}
},
"handlers.EventReceiverWorkflowResponse": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"kind": {
"type": "string"
},
"name": {
"type": "string"
},
"triggers": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"handlers.EventReceiverWorkflowsResponse": {
"type": "object",
"properties": {
"triggers": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.EventReceiverTriggerResponse"
}
},
"workflows": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.EventReceiverWorkflowResponse"
}
}
}
},
"handlers.FunctionEvalRequest": {
"type": "object",
"properties": {
"params": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"script": {
"type": "string"
},
"target": {
"type": "string"
}
}
},
"handlers.InstallRequest": {
"type": "object",
"properties": {
"install_all": {
"description": "Install all binaries from registry (for type=binary)",
"type": "boolean"
},
"install_optional": {
"description": "Include optional binaries (only with install_all)",
"type": "boolean"
},
"names": {
"description": "Binary names to install (for type=binary)",
"type": "array",
"items": {
"type": "string"
}
},
"registry_mode": {
"description": "\"direct-fetch\" or \"nix-build\" (default: direct-fetch)",
"type": "string"
},
"registry_url": {
"description": "Custom registry URL (optional, for type=binary)",
"type": "string"
},
"source": {
"description": "Git URL, zip URL, or file path (for type=workflow)",
"type": "string"
},
"type": {
"description": "\"binary\" or \"workflow\"",
"type": "string"
}
}
},
"handlers.LLMChatRequest": {
"type": "object",
"properties": {
"max_tokens": {
"type": "integer"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/core.LLMMessage"
}
},
"model": {
"type": "string"
},
"n": {
"type": "integer"
},
"response_format": {
"$ref": "#/definitions/core.LLMResponseFormat"
},
"stream": {
"type": "boolean"
},
"temperature": {
"type": "number"
},
"tool_choice": {},
"tools": {
"type": "array",
"items": {
"$ref": "#/definitions/core.LLMTool"
}
},
"top_k": {
"type": "integer"
},
"top_p": {
"type": "number"
}
}
},
"handlers.LLMChatResponse": {
"type": "object",
"properties": {
"content": {},
"finish_reason": {
"type": "string"
},
"id": {
"type": "string"
},
"model": {
"type": "string"
},
"tool_calls": {
"type": "array",
"items": {
"$ref": "#/definitions/core.LLMToolCall"
}
},
"usage": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
}
},
"handlers.LLMEmbeddingRequest": {
"type": "object",
"properties": {
"input": {
"type": "array",
"items": {
"type": "string"
}
},
"model": {
"type": "string"
}
}
},
"handlers.LLMEmbeddingResponse": {
"type": "object",
"properties": {
"embeddings": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
}
},
"model": {
"type": "string"
},
"usage": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
}
}
},
"handlers.LoginRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handlers.SnapshotExportRequest": {
"type": "object",
"properties": {
"workspace": {
"type": "string"
}
}
},
"handlers.SubmitTaskRequest": {
"type": "object",
"properties": {
"params": {
"type": "object",
"additionalProperties": true
},
"target": {
"type": "string"
},
"workflow_kind": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
}
},
"handlers.UpdateScheduleRequest": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"name": {
"type": "string"
},
"params": {
"type": "object",
"additionalProperties": true
},
"schedule": {
"type": "string"
},
"target": {
"type": "string"
},
"workspace": {
"type": "string"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}