Get the list of OTA updates for a given platform

This commit is contained in:
2024-10-05 19:35:23 +02:00
parent 2feb3f6490
commit d38040cb98
5 changed files with 48 additions and 8 deletions

View File

@ -53,6 +53,18 @@ pub async fn upload_firmware(
Ok(HttpResponse::Accepted().body("OTA update successfully saved."))
}
#[derive(serde::Deserialize)]
pub struct ListOTAPath {
platform: OTAPlatform,
}
/// List OTA software updates for a given platform
pub async fn list_updates_platform(path: web::Path<ListOTAPath>) -> HttpResult {
let list = ota_manager::get_ota_updates_for_platform(path.platform)?;
Ok(HttpResponse::Ok().json(list))
}
#[derive(serde::Deserialize)]
pub struct SetDesiredDeviceVersion {
devices: Option<Vec<DeviceId>>,