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

Function get_meta

chirpstack/src/storage/gateway.rs:419–437  ·  view source on GitHub ↗
(gateway_id: &EUI64)

Source from the content-addressed store, hash-verified

417}
418
419pub async fn get_meta(gateway_id: &EUI64) -> Result<GatewayMeta, Error> {
420 let meta = gateway::dsl::gateway
421 .inner_join(tenant::table)
422 .select((
423 gateway::gateway_id,
424 gateway::tenant_id,
425 gateway::latitude,
426 gateway::longitude,
427 gateway::altitude,
428 tenant::private_gateways_up,
429 tenant::private_gateways_down,
430 gateway::downlink_priority,
431 ))
432 .filter(gateway::dsl::gateway_id.eq(&gateway_id))
433 .first(&mut get_async_db_conn().await?)
434 .await
435 .map_err(|e| Error::from_diesel(e, gateway_id.to_string()))?;
436 Ok(meta)
437}
438
439#[cfg(feature = "postgres")]
440pub async fn get_counts_by_state(tenant_id: &Option<Uuid>) -> Result<GatewayCountsByState, Error> {

Callers 1

update_gateway_metadataFunction · 0.85

Calls 2

to_stringMethod · 0.80
get_async_db_connFunction · 0.70

Tested by

no test coverage detected