{"openapi":"3.1.0","info":{"title":"Backup Central","version":"0.1.0"},"paths":{"/api/v1/heartbeat":{"post":{"tags":["agent"],"summary":"Heartbeat","operationId":"heartbeat_api_v1_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/jobs":{"get":{"tags":["agent"],"summary":"List Jobs","operationId":"list_jobs_api_v1_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobsResponse"}}}}}}},"/api/v1/commands":{"get":{"tags":["agent"],"summary":"List Commands","description":"Pending remote commands for this agent (e.g. dashboard Run now).","operationId":"list_commands_api_v1_commands_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandsResponse"}}}}}}},"/api/v1/commands/{command_id}":{"patch":{"tags":["agent"],"summary":"Update Command","operationId":"update_command_api_v1_commands__command_id__patch","parameters":[{"name":"command_id","in":"path","required":true,"schema":{"type":"integer","title":"Command Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs":{"post":{"tags":["agent"],"summary":"Start Run","operationId":"start_run_api_v1_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}":{"patch":{"tags":["agent"],"summary":"Update Run","operationId":"update_run_api_v1_runs__run_id__patch","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/login":{"get":{"tags":["dashboard"],"summary":"Login Page","operationId":"login_page_login_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["dashboard"],"summary":"Login Submit","operationId":"login_submit_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_submit_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logout":{"post":{"tags":["dashboard"],"summary":"Logout","operationId":"logout_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"tags":["dashboard"],"summary":"Overview","operationId":"overview__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/fragments/fleet":{"get":{"tags":["dashboard"],"summary":"Fleet Fragment","description":"HTML fragment for HTMX auto-refresh (full page swap of #fleet).","operationId":"fleet_fragment_fragments_fleet_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/jobs/{job_id}":{"get":{"tags":["dashboard"],"summary":"Job Detail","operationId":"job_detail_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fragments/jobs/{job_id}":{"get":{"tags":["dashboard"],"summary":"Job Fragment","operationId":"job_fragment_fragments_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/toggle":{"post":{"tags":["dashboard"],"summary":"Toggle Job","operationId":"toggle_job_jobs__job_id__toggle_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}/run":{"post":{"tags":["dashboard"],"summary":"Run Job Now","description":"Queue a run_now command for the agent that owns this job.","operationId":"run_job_now_jobs__job_id__run_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AgentCommand":{"properties":{"id":{"type":"integer","title":"Id"},"job_id":{"type":"integer","title":"Job Id"},"job_key":{"type":"string","title":"Job Key"},"command":{"$ref":"#/components/schemas/CommandType"},"script_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script Path"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","job_id","job_key","command","created_at"],"title":"AgentCommand"},"Body_login_submit_login_post":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"Body_login_submit_login_post"},"CommandResponse":{"properties":{"id":{"type":"integer","title":"Id"},"job_id":{"type":"integer","title":"Job Id"},"command":{"$ref":"#/components/schemas/CommandType"},"status":{"$ref":"#/components/schemas/CommandStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"claimed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Claimed At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","job_id","command","status","created_at"],"title":"CommandResponse"},"CommandStatus":{"type":"string","enum":["pending","claimed","done","failed"],"title":"CommandStatus"},"CommandType":{"type":"string","enum":["run_now"],"title":"CommandType"},"CommandUpdateRequest":{"properties":{"status":{"$ref":"#/components/schemas/CommandStatus"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["status"],"title":"CommandUpdateRequest"},"CommandsResponse":{"properties":{"commands":{"items":{"$ref":"#/components/schemas/AgentCommand"},"type":"array","title":"Commands"},"server_time":{"type":"string","format":"date-time","title":"Server Time"}},"type":"object","required":["commands","server_time"],"title":"CommandsResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeartbeatRequest":{"properties":{"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname"},"agent_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Version"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"}},"type":"object","title":"HeartbeatRequest"},"HeartbeatResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"server_time":{"type":"string","format":"date-time","title":"Server Time"},"agent_id":{"type":"integer","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"}},"type":"object","required":["server_time","agent_id","agent_name"],"title":"HeartbeatResponse"},"JobConfig":{"properties":{"id":{"type":"integer","title":"Id"},"job_key":{"type":"string","title":"Job Key"},"schedule":{"type":"string","title":"Schedule"},"timezone":{"type":"string","title":"Timezone","default":"UTC"},"enabled":{"type":"boolean","title":"Enabled","default":true},"grace_minutes":{"type":"integer","title":"Grace Minutes","default":120},"config":{"additionalProperties":true,"type":"object","title":"Config"},"script_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Script Path"}},"type":"object","required":["id","job_key","schedule"],"title":"JobConfig"},"JobsResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobConfig"},"type":"array","title":"Jobs"},"server_time":{"type":"string","format":"date-time","title":"Server Time"}},"type":"object","required":["jobs","server_time"],"title":"JobsResponse"},"RunResponse":{"properties":{"id":{"type":"integer","title":"Id"},"job_id":{"type":"integer","title":"Job Id"},"status":{"$ref":"#/components/schemas/RunStatus"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"bytes_transferred":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bytes Transferred"},"dest_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dest Path"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["id","job_id","status","started_at"],"title":"RunResponse"},"RunStartRequest":{"properties":{"job_key":{"type":"string","title":"Job Key"},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname"}},"type":"object","required":["job_key"],"title":"RunStartRequest"},"RunStartResponse":{"properties":{"run_id":{"type":"integer","title":"Run Id"},"job_id":{"type":"integer","title":"Job Id"},"status":{"$ref":"#/components/schemas/RunStatus","default":"running"}},"type":"object","required":["run_id","job_id"],"title":"RunStartResponse"},"RunStatus":{"type":"string","enum":["running","ok","failed","missed"],"title":"RunStatus"},"RunUpdateRequest":{"properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/RunStatus"},{"type":"null"}]},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"bytes_transferred":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bytes Transferred"},"dest_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dest Path"},"log_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Excerpt"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"progress_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Message"}},"type":"object","title":"RunUpdateRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}