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

Method remove_gateways

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

Source from the content-addressed store, hash-verified

568 }
569
570 async fn remove_gateways(
571 &self,
572 request: Request<api::RemoveGatewaysFromFuotaDeploymentRequest>,
573 ) -> Result<Response<()>, Status> {
574 let req = request.get_ref();
575 let dp_id = Uuid::from_str(&req.fuota_deployment_id).map_err(|e| e.status())?;
576
577 self.validator
578 .validate(
579 request.extensions(),
580 validator::ValidateFuotaDeploymentAccess::new(validator::Flag::Update, dp_id),
581 )
582 .await?;
583
584 let mut gateway_ids = Vec::with_capacity(req.gateway_ids.len());
585 for gateway_id in &req.gateway_ids {
586 gateway_ids.push(EUI64::from_str(gateway_id).map_err(|e| e.status())?);
587 }
588
589 fuota::remove_gateways(dp_id, gateway_ids)
590 .await
591 .map_err(|e| e.status())?;
592
593 let mut resp = Response::new(());
594 resp.metadata_mut().insert(
595 "x-log-fuota_deployment_id",
596 req.fuota_deployment_id.parse().unwrap(),
597 );
598 Ok(resp)
599 }
600
601 async fn list_gateways(
602 &self,

Callers 1

test_fuotaFunction · 0.80

Calls 6

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

Tested by 1

test_fuotaFunction · 0.64