File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ def register(parent: cli.Subparsers) -> None:
4141 action = "store_true" ,
4242 help = "Expand device communication information" ,
4343 )
44+ parser .add_argument ("-s" , "--site-id" , help = "Filter devices by site ID" )
4445
4546 @staticmethod
4647 async def run (args : argparse .Namespace ) -> None :
@@ -52,6 +53,7 @@ async def run(args: argparse.Namespace) -> None:
5253 expand_properties = args .properties ,
5354 expand_connectivity = args .connectivity ,
5455 expand_communication = args .communication ,
56+ site_id = args .site_id ,
5557 ) as stream :
5658 count = 0
5759 async for device in stream :
Original file line number Diff line number Diff line change @@ -101,8 +101,9 @@ async def list(
101101 expand_properties : bool = False ,
102102 expand_connectivity : bool = False ,
103103 expand_communication : bool = False ,
104+ site_id : str | None = None ,
104105 ) -> AsyncGenerator [Device , None ]:
105- url = "v3/devices"
106+ url = "v3/devices" if site_id is None else f"v3/sites/ { site_id } /devices"
106107 expand = {
107108 "manifest" : expand_manifest ,
108109 "properties" : expand_properties ,
You can’t perform that action at this time.
0 commit comments