Gateway
Gateways resource for LoRaWAN gateway management.
SyncGateways
SyncGateways(client: SyncClient)
Bases: BaseResource['SyncClient']
Gateways resource for LoRaWAN gateway management.
Methods:
-
create–Create a new gateway.
-
delete–Delete a gateway.
-
get–Retrieve a gateway by ID or Node ID.
-
get_all–List all gateways.
-
get_connection_status–Retrieve gateways grouped by connection status.
-
get_devices–Retrieve devices seen by a gateway.
-
get_events–Retrieve gateway events.
-
get_health–Retrieve gateways grouped by health status.
-
get_statistics–Retrieve gateway statistics.
-
patch–Partially update a gateway.
-
update–Update a gateway (full replacement).
create
create(data: GatewayCreate) -> str
Create a new gateway.
Parameters:
-
(dataGatewayCreate) –The gateway creation data.
Returns:
-
str(str) –The ID of the newly created gateway.
delete
delete(gateway_id: str) -> None
Delete a gateway.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway to delete.
Returns:
-
None–None
get
get(gateway_id: str) -> GatewayInstance
Retrieve a gateway by ID or Node ID.
Parameters:
-
(gateway_idstr) –The unique identifier or Node ID of the gateway.
Returns:
-
GatewayInstance(GatewayInstance) –The gateway instance matching the given ID.
get_all
get_all() -> list[GatewayInstance]
List all gateways.
Returns:
-
list[GatewayInstance]–list[GatewayInstance]: List of all gateway instances.
get_connection_status
get_connection_status() -> GatewaysConnectionResponse
Retrieve gateways grouped by connection status.
Returns:
-
GatewaysConnectionResponse(GatewaysConnectionResponse) –Gateways grouped by their connection status.
get_devices
get_devices(
gateway_id: str, days: int | None = None
) -> list[GatewayDevice]
Retrieve devices seen by a gateway.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
-
(daysint | None, default:None) –Optional number of days to look back.
Returns:
-
list[GatewayDevice]–list[GatewayDevice]: Devices seen by the gateway.
get_events
get_events(
node_id: str,
start_time: str | None = None,
end_time: str | None = None,
) -> GatewayEventsResponse
Retrieve gateway events.
Parameters:
-
(node_idstr) –The node ID of the gateway.
-
(start_timestr | None, default:None) –Optional ISO 8601 formatted start time.
-
(end_timestr | None, default:None) –Optional ISO 8601 formatted end time.
Returns:
-
GatewayEventsResponse(GatewayEventsResponse) –Gateway events within the specified time range.
get_health
get_health() -> GatewaysHealthResponse
Retrieve gateways grouped by health status.
Returns:
-
GatewaysHealthResponse(GatewaysHealthResponse) –Gateways grouped by their health status.
get_statistics
get_statistics(gateway_id: str) -> GatewayStatistics
Retrieve gateway statistics.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
Returns:
-
GatewayStatistics(GatewayStatistics) –Statistics for the gateway.
patch
patch(gateway_id: str, data: GatewayPatch) -> bool
Partially update a gateway.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
-
(dataGatewayPatch) –The partial gateway data to update.
Returns:
-
GatewayInstance(bool) –The updated gateway instance.
update
update(gateway_id: str, data: GatewayUpdate) -> bool
Update a gateway (full replacement).
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
-
(dataGatewayUpdate) –The complete gateway data for replacement.
Returns:
-
GatewayInstance(bool) –The updated gateway instance.
AsyncGateways
AsyncGateways(client: AsyncClient)
Bases: BaseResource['AsyncClient']
Async gateways resource for LoRaWAN gateway management.
Methods:
-
create–Create a new gateway.
-
delete–Delete a gateway.
-
get–Retrieve a gateway by ID or Node ID.
-
get_all–List all gateways.
-
get_connection_status–Retrieve gateways grouped by connection status.
-
get_devices–Retrieve devices seen by a gateway.
-
get_events–Retrieve gateway events.
-
get_health–Retrieve gateways grouped by health status.
-
get_statistics–Retrieve gateway statistics.
-
patch–Partially update a gateway.
-
update–Update a gateway (full replacement).
create
async
create(data: GatewayCreate) -> str
Create a new gateway.
Parameters:
-
(dataGatewayCreate) –The gateway creation data.
Returns:
-
str(str) –The ID of the newly created gateway.
delete
async
delete(gateway_id: str) -> None
Delete a gateway.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway to delete.
Returns:
-
None–None
get
async
get(gateway_id: str) -> GatewayInstance
Retrieve a gateway by ID or Node ID.
Parameters:
-
(gateway_idstr) –The unique identifier or Node ID of the gateway.
Returns:
-
GatewayInstance(GatewayInstance) –The gateway instance matching the given ID.
get_all
async
get_all() -> list[GatewayInstance]
List all gateways.
Returns:
-
list[GatewayInstance]–list[GatewayInstance]: List of all gateway instances.
get_connection_status
async
get_connection_status() -> GatewaysConnectionResponse
Retrieve gateways grouped by connection status.
Returns:
-
GatewaysConnectionResponse(GatewaysConnectionResponse) –Gateways grouped by their connection status.
get_devices
async
get_devices(
gateway_id: str, days: int | None = None
) -> list[GatewayDevice]
Retrieve devices seen by a gateway.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
-
(daysint | None, default:None) –Optional number of days to look back.
Returns:
-
list[GatewayDevice]–list[GatewayDevice]: Devices seen by the gateway.
get_events
async
get_events(
node_id: str,
start_time: str | None = None,
end_time: str | None = None,
) -> GatewayEventsResponse
Retrieve gateway events.
Parameters:
-
(node_idstr) –The node ID of the gateway.
-
(start_timestr | None, default:None) –Optional ISO 8601 formatted start time.
-
(end_timestr | None, default:None) –Optional ISO 8601 formatted end time.
Returns:
-
GatewayEventsResponse(GatewayEventsResponse) –Gateway events within the specified time range.
get_health
async
get_health() -> GatewaysHealthResponse
Retrieve gateways grouped by health status.
Returns:
-
GatewaysHealthResponse(GatewaysHealthResponse) –Gateways grouped by their health status.
get_statistics
async
get_statistics(gateway_id: str) -> GatewayStatistics
Retrieve gateway statistics.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
Returns:
-
GatewayStatistics(GatewayStatistics) –Statistics for the gateway.
patch
async
patch(gateway_id: str, data: GatewayPatch) -> bool
Partially update a gateway.
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
-
(dataGatewayPatch) –The partial gateway data to update.
Returns:
-
bool(bool) –True if the update was successful, False otherwise.
update
async
update(gateway_id: str, data: GatewayUpdate) -> bool
Update a gateway (full replacement).
Parameters:
-
(gateway_idstr) –The unique identifier of the gateway.
-
(dataGatewayUpdate) –The complete gateway data for replacement.
Returns:
-
bool(bool) –True if the update was successful, False otherwise.
Request and response types: Gateway models.