Upload Firmware File
const url = 'https://example.com/api/firmware/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/upload?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://example.com/api/firmware/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/upload?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@fileUpload an OTA-Pulse artifact (.otapulse file) for firmware deployment.
Only pre-built OTA-Pulse artifacts are accepted. To create one from a raw firmware image, use the otapulse-artifact CLI locally:
otapulse-artifact write rootfs-image \
-t radxa-cm5-io \
-n release-v1.0.0 \
-f firmware.ext4 \
-o firmware-v1.0.0.otapulse
Expects a multipart/form-data body with a single field named “file” (the same API contract as before amendment A8 — the console and test harness need no change).
Guardrails (TODO-052/S56 design 3A — see app.services.upload_guardrails):
max upload size (413), free-disk-space floor (507), a GLOBAL concurrent
upload cap (503, amendment A1), per-org storage quota (402), and a
per-firmware upload lock (409) preventing two concurrent uploads from
racing on one row — ALL of them run and, on refusal, respond BEFORE the
body is streamed (amendment A8: this route no longer uses
UploadFile = File(...), which would have made FastAPI itself buffer
the entire body before this function even started — see
app.services.streaming_multipart’s module docstring).
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Query Parameters
Section titled “ Query Parameters ”Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Responses
Section titled “ Responses ”Successful Response
Firmware response
object
Deprecated alias for is_ota_artifact. Use is_ota_artifact.
Firmware status
Example
{ "is_mender_artifact": false, "is_ota_artifact": false, "status": "draft"}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}