|
| 1 | +openapi: 3.1.0 |
| 2 | +info: |
| 3 | + title: ESP OTA Server |
| 4 | + version: "0.12.0" |
| 5 | + description: > |
| 6 | + Simple OTA server for ESP8266/ESP32 devices. This spec covers the public |
| 7 | + HTTP endpoints used by devices and operators. |
| 8 | +servers: |
| 9 | + - url: http://localhost:8092 |
| 10 | + |
| 11 | +paths: |
| 12 | + /healthz: |
| 13 | + get: |
| 14 | + summary: Health check |
| 15 | + description: Returns 200 OK when the server is up. |
| 16 | + responses: |
| 17 | + "200": |
| 18 | + description: OK |
| 19 | + content: |
| 20 | + text/plain: |
| 21 | + schema: |
| 22 | + type: string |
| 23 | + examples: |
| 24 | + ok: |
| 25 | + value: ok |
| 26 | + |
| 27 | + /metrics: |
| 28 | + get: |
| 29 | + summary: Prometheus metrics |
| 30 | + description: > |
| 31 | + Exposes Prometheus metrics when the server is started with Prometheus |
| 32 | + enabled. |
| 33 | + responses: |
| 34 | + "200": |
| 35 | + description: Prometheus metrics text format |
| 36 | + content: |
| 37 | + text/plain: |
| 38 | + schema: |
| 39 | + type: string |
| 40 | + |
| 41 | + /bin/{project}/{file}: |
| 42 | + get: |
| 43 | + summary: Fetch firmware binary |
| 44 | + description: > |
| 45 | + Returns the firmware binary if the client needs an update. |
| 46 | + parameters: |
| 47 | + - name: project |
| 48 | + in: path |
| 49 | + required: true |
| 50 | + description: Project identifier. |
| 51 | + schema: |
| 52 | + type: string |
| 53 | + - name: file |
| 54 | + in: path |
| 55 | + required: true |
| 56 | + description: Firmware filename. |
| 57 | + schema: |
| 58 | + type: string |
| 59 | + - name: X-Esp8266-Mode |
| 60 | + in: header |
| 61 | + required: false |
| 62 | + schema: |
| 63 | + type: string |
| 64 | + description: Required for ESP8266 devices. Example: `sketch`. |
| 65 | + - name: X-Esp32-Mode |
| 66 | + in: header |
| 67 | + required: false |
| 68 | + schema: |
| 69 | + type: string |
| 70 | + description: Required for ESP32 devices. Example: `sketch`. |
| 71 | + - name: X-Esp8266-Sketch-Md5 |
| 72 | + in: header |
| 73 | + required: false |
| 74 | + schema: |
| 75 | + type: string |
| 76 | + description: Current firmware MD5 for ESP8266. |
| 77 | + - name: X-Esp32-Sketch-Md5 |
| 78 | + in: header |
| 79 | + required: false |
| 80 | + schema: |
| 81 | + type: string |
| 82 | + description: Current firmware MD5 for ESP32. |
| 83 | + - name: X-Esp8266-Version |
| 84 | + in: header |
| 85 | + required: false |
| 86 | + schema: |
| 87 | + type: string |
| 88 | + description: > |
| 89 | + Version info for ESP8266. Supports `md5:<hash>` among other tokens. |
| 90 | + - name: X-Esp32-Version |
| 91 | + in: header |
| 92 | + required: false |
| 93 | + schema: |
| 94 | + type: string |
| 95 | + description: > |
| 96 | + Version info for ESP32. Supports `md5:<hash>` among other tokens. |
| 97 | + responses: |
| 98 | + "200": |
| 99 | + description: Firmware binary |
| 100 | + headers: |
| 101 | + x-MD5: |
| 102 | + description: MD5 of the firmware. |
| 103 | + schema: |
| 104 | + type: string |
| 105 | + x-SHA512: |
| 106 | + description: SHA512 of the firmware. |
| 107 | + schema: |
| 108 | + type: string |
| 109 | + content: |
| 110 | + application/octet-stream: |
| 111 | + schema: |
| 112 | + type: string |
| 113 | + format: binary |
| 114 | + "304": |
| 115 | + description: Client already has the latest firmware. |
| 116 | + "400": |
| 117 | + description: Missing or invalid headers. |
| 118 | + content: |
| 119 | + text/plain: |
| 120 | + schema: |
| 121 | + type: string |
| 122 | + "404": |
| 123 | + description: Firmware not found. |
| 124 | + content: |
| 125 | + text/plain: |
| 126 | + schema: |
| 127 | + type: string |
| 128 | + |
| 129 | + /: |
| 130 | + get: |
| 131 | + summary: Root |
| 132 | + description: Returns a 403 page. |
| 133 | + responses: |
| 134 | + "403": |
| 135 | + description: Forbidden |
| 136 | + content: |
| 137 | + text/html: |
| 138 | + schema: |
| 139 | + type: string |
0 commit comments