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

Function remove_gateways

chirpstack/src/storage/fuota.rs:662–679  ·  view source on GitHub ↗
(
    fuota_deployment_id: Uuid,
    gateway_ids: Vec<EUI64>,
)

Source from the content-addressed store, hash-verified

660}
661
662pub async fn remove_gateways(
663 fuota_deployment_id: Uuid,
664 gateway_ids: Vec<EUI64>,
665) -> Result<(), Error> {
666 diesel::delete(
667 fuota_deployment_gateway::table
668 .filter(
669 fuota_deployment_gateway::dsl::fuota_deployment_id
670 .eq(fields::Uuid::from(fuota_deployment_id)),
671 )
672 .filter(fuota_deployment_gateway::dsl::gateway_id.eq_any(gateway_ids)),
673 )
674 .execute(&mut get_async_db_conn().await?)
675 .await?;
676
677 info!(fuota_deployment_id = %fuota_deployment_id, "Gateway IDs removed from FUOTA Deployment");
678 Ok(())
679}
680
681pub async fn get_gateway_count(fuota_deployment_id: Uuid) -> Result<i64, Error> {
682 fuota_deployment_gateway::dsl::fuota_deployment_gateway

Callers 2

test_fuota_gatewaysFunction · 0.85
remove_gatewaysMethod · 0.85

Calls 2

deleteFunction · 0.70
get_async_db_connFunction · 0.70

Tested by 1

test_fuota_gatewaysFunction · 0.68