{"openapi":"3.1.0","info":{"title":"多设备内容发布系统","version":"0.1.0"},"paths":{"/jobs":{"post":{"tags":["jobs"],"summary":"Create Job","operationId":"create_job_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["jobs"],"summary":"List Jobs","operationId":"list_jobs_jobs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get Job","operationId":"get_job_jobs__job_id__get","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}/cancel":{"post":{"tags":["jobs"],"summary":"Cancel","operationId":"cancel_jobs__job_id__cancel_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}/retry":{"post":{"tags":["jobs"],"summary":"Retry","operationId":"retry_jobs__job_id__retry_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}/confirm":{"post":{"tags":["jobs"],"summary":"Confirm","operationId":"confirm_jobs__job_id__confirm_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"}}}}}}},"/devices":{"get":{"tags":["devices"],"summary":"List Devices","operationId":"list_devices_devices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/{node_id}/heartbeat":{"post":{"tags":["control-agent"],"summary":"Heartbeat","operationId":"heartbeat_agent__node_id__heartbeat_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Heartbeat"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{node_id}/claim":{"post":{"tags":["control-agent"],"summary":"Claim","operationId":"claim_agent__node_id__claim_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{node_id}/jobs/{job_id}":{"get":{"tags":["control-agent"],"summary":"Get Agent Job","operationId":"get_agent_job_agent__node_id__jobs__job_id__get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}},{"name":"x-agent-lease","in":"header","required":true,"schema":{"type":"string","title":"X-Agent-Lease"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{node_id}/jobs/{job_id}/assets/{index}":{"get":{"tags":["control-agent"],"summary":"Get Asset","operationId":"get_asset_agent__node_id__jobs__job_id__assets__index__get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","title":"Index"}},{"name":"x-agent-lease","in":"header","required":true,"schema":{"type":"string","title":"X-Agent-Lease"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{node_id}/jobs/{job_id}/artifacts/{name}":{"post":{"tags":["control-agent"],"summary":"Upload Artifact","operationId":"upload_artifact_agent__node_id__jobs__job_id__artifacts__name__post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"x-agent-lease","in":"header","required":true,"schema":{"type":"string","title":"X-Agent-Lease"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{node_id}/jobs/{job_id}/status":{"post":{"tags":["control-agent"],"summary":"Report Status","operationId":"report_status_agent__node_id__jobs__job_id__status_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}},{"name":"x-agent-lease","in":"header","required":true,"schema":{"type":"string","title":"X-Agent-Lease"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobEvent"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/guide":{"get":{"tags":["web"],"summary":"Guide Home","operationId":"guide_home_guide_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/guide/document/{name}":{"get":{"tags":["web"],"summary":"Guide Document","operationId":"guide_document_guide_document__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/readme":{"get":{"tags":["web"],"summary":"Readme Page","description":"Expose the repository README at a short, easy-to-share web address.","operationId":"readme_page_readme_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/dashboard":{"get":{"summary":"Dashboard","operationId":"dashboard_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/dashboard/job/{job_id}":{"get":{"summary":"Job Detail","operationId":"job_detail_dashboard_job__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"}}}}}}}},"components":{"schemas":{"ClaimRequest":{"properties":{"device_ids":{"items":{"type":"string"},"type":"array","title":"Device Ids"},"appium_ready_device_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Appium Ready Device Ids"}},"type":"object","title":"ClaimRequest"},"DeviceReport":{"properties":{"device_id":{"type":"string","title":"Device Id"},"adb_status":{"type":"string","title":"Adb Status","default":"unknown"},"online":{"type":"boolean","title":"Online","default":false},"battery":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Battery"},"locked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Locked"},"appium_status":{"type":"string","title":"Appium Status","default":"unknown"},"quarantined":{"type":"boolean","title":"Quarantined","default":false},"quarantine_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quarantine Reason"}},"type":"object","required":["device_id"],"title":"DeviceReport"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Heartbeat":{"properties":{"devices":{"items":{"$ref":"#/components/schemas/DeviceReport"},"type":"array","title":"Devices"},"agent_version":{"type":"string","title":"Agent Version","default":"0.1.0"}},"type":"object","title":"Heartbeat"},"JobCreate":{"properties":{"platform":{"type":"string","title":"Platform"},"device_id":{"type":"string","title":"Device Id"},"account_alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Alias"},"content_type":{"type":"string","title":"Content Type"},"media_files":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Media Files"},"title":{"type":"string","title":"Title","default":""},"description":{"type":"string","title":"Description","default":""},"hashtags":{"items":{"type":"string"},"type":"array","title":"Hashtags"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"cover_file":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cover File"},"callback_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Callback Url"},"max_retries":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Retries"},"transfer_only":{"type":"boolean","title":"Transfer Only","default":false}},"type":"object","required":["platform","device_id","content_type","media_files"],"title":"JobCreate"},"JobEvent":{"properties":{"status":{"type":"string","title":"Status"},"retry_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retry Count"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"screenshot_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screenshot Name"},"published_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Published Url"}},"type":"object","required":["status"],"title":"JobEvent"},"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"}}}}