{"openapi":"3.1.0","info":{"title":"Cloud OTA Log","version":"0.1.0"},"paths":{"/api/device/heartbeat":{"post":{"tags":["device-api"],"summary":"Post Heartbeat","operationId":"post_heartbeat_api_device_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/device/logs":{"post":{"tags":["device-api"],"summary":"Post Logs","operationId":"post_logs_api_device_logs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogUploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/device/ota/check":{"get":{"tags":["device-api"],"summary":"Get Ota Check","operationId":"get_ota_check_api_device_ota_check_get","parameters":[{"name":"device_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtaCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/device/ota/report":{"post":{"tags":["device-api"],"summary":"Post Ota Report","operationId":"post_ota_report_api_device_ota_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtaReportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtaReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/device/ota/progress":{"post":{"tags":["device-api"],"summary":"Post Ota Progress","operationId":"post_ota_progress_api_device_ota_progress_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtaProgressRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtaProgressResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/devices":{"get":{"tags":["web-pages"],"summary":"Get Devices Page","operationId":"get_devices_page_web_devices_get","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/device/{device_id}":{"get":{"tags":["web-pages"],"summary":"Get Device Page","operationId":"get_device_page_web_device__device_id__get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}}],"responses":{"307":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/ota":{"get":{"tags":["web-pages"],"summary":"Get Ota Page","operationId":"get_ota_page_web_ota_get","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/partials/dashboard/summary":{"get":{"tags":["web-pages"],"summary":"Get Rollout Summary Partial","operationId":"get_rollout_summary_partial_web_partials_dashboard_summary_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/web/partials/devices/table":{"get":{"tags":["web-pages"],"summary":"Get Devices Table Partial","operationId":"get_devices_table_partial_web_partials_devices_table_get","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/partials/device-drawer":{"get":{"tags":["web-pages"],"summary":"Get Device Drawer Partial","operationId":"get_device_drawer_partial_web_partials_device_drawer_get","parameters":[{"name":"device_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/partials/device/{device_id}/logs":{"get":{"tags":["web-pages"],"summary":"Get Device Logs Partial","operationId":"get_device_logs_partial_web_partials_device__device_id__logs_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/partials/device/{device_id}/ota-history":{"get":{"tags":["web-pages"],"summary":"Get Device Ota History Partial","operationId":"get_device_ota_history_partial_web_partials_device__device_id__ota_history_get","parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/partials/ota/jobs":{"get":{"tags":["web-pages"],"summary":"Get Ota Jobs Partial","operationId":"get_ota_jobs_partial_web_partials_ota_jobs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/web/firmware/upload":{"post":{"tags":["web-pages"],"summary":"Post Firmware Upload","operationId":"post_firmware_upload_web_firmware_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_post_firmware_upload_web_firmware_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/web/ota/create":{"post":{"tags":["web-pages"],"summary":"Post Ota Create","operationId":"post_ota_create_web_ota_create_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_post_ota_create_web_ota_create_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_post_firmware_upload_web_firmware_upload_post":{"properties":{"version":{"type":"string","title":"Version"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["version","file"],"title":"Body_post_firmware_upload_web_firmware_upload_post"},"Body_post_ota_create_web_ota_create_post":{"properties":{"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"device_ids":{"items":{"type":"string"},"type":"array","title":"Device Ids","default":[]},"firmware_id":{"type":"integer","title":"Firmware Id"}},"type":"object","required":["firmware_id"],"title":"Body_post_ota_create_web_ota_create_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeartbeatRequest":{"properties":{"device_id":{"type":"string","maxLength":128,"minLength":1,"title":"Device Id"},"product":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"},"hw_ver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hw Ver"},"sw_ver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sw Ver"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"rssi":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rssi"},"uptime_s":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Uptime S"}},"type":"object","required":["device_id"],"title":"HeartbeatRequest"},"HeartbeatResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"device_id":{"type":"string","title":"Device Id"},"last_seen":{"type":"string","format":"date-time","title":"Last Seen"}},"type":"object","required":["device_id","last_seen"],"title":"HeartbeatResponse"},"LogUploadItem":{"properties":{"ts":{"type":"integer","minimum":0.0,"title":"Ts"},"level":{"type":"string","enum":["E","W","I","D","V"],"title":"Level"},"tag":{"type":"string","maxLength":64,"minLength":1,"title":"Tag"},"msg":{"type":"string","maxLength":1024,"minLength":1,"title":"Msg"}},"type":"object","required":["ts","level","tag","msg"],"title":"LogUploadItem"},"LogUploadRequest":{"properties":{"device_id":{"type":"string","maxLength":128,"minLength":1,"title":"Device Id"},"logs":{"items":{"$ref":"#/components/schemas/LogUploadItem"},"type":"array","title":"Logs"}},"type":"object","required":["device_id","logs"],"title":"LogUploadRequest"},"LogUploadResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"saved":{"type":"integer","title":"Saved"}},"type":"object","required":["saved"],"title":"LogUploadResponse"},"OtaCheckResponse":{"properties":{"has_job":{"type":"boolean","title":"Has Job"},"job_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Job Id"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sha256"},"size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size"}},"type":"object","required":["has_job"],"title":"OtaCheckResponse"},"OtaProgressRequest":{"properties":{"device_id":{"type":"string","maxLength":128,"minLength":1,"title":"Device Id"},"job_id":{"type":"integer","minimum":1.0,"title":"Job Id"},"progress_percent":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Progress Percent"},"phase":{"anyOf":[{"type":"string","enum":["preparing","downloading","verifying","rebooting"]},{"type":"null"}],"title":"Phase"},"progress_msg":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Msg"}},"type":"object","required":["device_id","job_id","progress_percent"],"title":"OtaProgressRequest"},"OtaProgressResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"OtaProgressResponse"},"OtaReportRequest":{"properties":{"device_id":{"type":"string","maxLength":128,"minLength":1,"title":"Device Id"},"job_id":{"type":"integer","minimum":1.0,"title":"Job Id"},"result":{"type":"string","enum":["success","failed"],"title":"Result"},"result_msg":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Msg"}},"type":"object","required":["device_id","job_id","result"],"title":"OtaReportRequest"},"OtaReportResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"OtaReportResponse"},"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"}}}}