MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / remove_devices

Method remove_devices

chirpstack/src/api/fuota.rs:440–469  ·  view source on GitHub ↗
(
        &self,
        request: Request<api::RemoveDevicesFromFuotaDeploymentRequest>,
    )

Source from the content-addressed store, hash-verified

438 }
439
440 async fn remove_devices(
441 &self,
442 request: Request<api::RemoveDevicesFromFuotaDeploymentRequest>,
443 ) -> Result<Response<()>, Status> {
444 let req = request.get_ref();
445 let dp_id = Uuid::from_str(&req.fuota_deployment_id).map_err(|e| e.status())?;
446
447 self.validator
448 .validate(
449 request.extensions(),
450 validator::ValidateFuotaDeploymentAccess::new(validator::Flag::Update, dp_id),
451 )
452 .await?;
453
454 let mut dev_euis = Vec::with_capacity(req.dev_euis.len());
455 for dev_eui in &req.dev_euis {
456 dev_euis.push(EUI64::from_str(dev_eui).map_err(|e| e.status())?);
457 }
458
459 fuota::remove_devices(dp_id, dev_euis)
460 .await
461 .map_err(|e| e.status())?;
462
463 let mut resp = Response::new(());
464 resp.metadata_mut().insert(
465 "x-log-fuota_deployment_id",
466 req.fuota_deployment_id.parse().unwrap(),
467 );
468 Ok(resp)
469 }
470
471 async fn list_devices(
472 &self,

Callers 1

test_fuotaFunction · 0.80

Calls 6

remove_devicesFunction · 0.85
statusMethod · 0.80
pushMethod · 0.80
insertMethod · 0.80
unwrapMethod · 0.80
validateMethod · 0.45

Tested by 1

test_fuotaFunction · 0.64