@@ -638,22 +638,67 @@ async def asset_wait(ctx, item_type, item_id, asset_type, delay, max_attempts):
638
638
click .echo (status )
639
639
640
640
641
- # @data.command()
642
- # @click.pass_context
643
- # @translate_exceptions
644
- # @coro
645
- # @click.argument("item_type")
646
- # @click.argument("item_id")
647
- # @click.argument("asset_type_id")
648
- # @pretty
649
- # async def asset_get(ctx, item_type, item_id, asset_type_id, pretty):
650
- # """Get an item asset."""
651
- # async with data_client(ctx) as cl:
652
- # asset = await cl.get_asset(item_type, item_id, asset_type_id)
653
- # echo_json(asset, pretty)
654
-
655
- # TODO: search_run()".
656
- # TODO: item_get()".
641
+ @data .command () # type: ignore
642
+ @click .pass_context
643
+ @translate_exceptions
644
+ @coro
645
+ @click .argument ("item_type" )
646
+ @click .argument ("item_id" )
647
+ @click .argument ("asset_type_id" )
648
+ async def asset_get (ctx , item_type , item_id , asset_type_id ):
649
+ """Get an item asset."""
650
+ async with data_client (ctx ) as cl :
651
+ asset = await cl .get_asset (item_type , item_id , asset_type_id )
652
+ echo_json (asset , pretty )
653
+
654
+
655
+ @data .command () # type: ignore
656
+ @click .pass_context
657
+ @translate_exceptions
658
+ @coro
659
+ @click .argument ("item_type" , type = str , callback = check_item_type )
660
+ @click .argument ("item_id" )
661
+ async def asset_list (ctx , item_type , item_id ):
662
+ """List item assets."""
663
+ async with data_client (ctx ) as cl :
664
+ item_assets = await cl .list_item_assets (item_type , item_id )
665
+ echo_json (item_assets , pretty )
666
+
667
+
668
+ @data .command () # type: ignore
669
+ @click .pass_context
670
+ @translate_exceptions
671
+ @coro
672
+ @click .argument ("item_type" , type = str , callback = check_item_type )
673
+ @click .argument ("item_id" )
674
+ async def item_get (ctx , item_type , item_id ):
675
+ """Get an item."""
676
+ async with data_client (ctx ) as cl :
677
+ item = await cl .get_item (item_type , item_id )
678
+ echo_json (item , pretty )
679
+
680
+
681
+ @data .command () # type: ignore
682
+ @click .pass_context
683
+ @translate_exceptions
684
+ @coro
685
+ @click .argument ("item_type" , type = str , callback = check_item_type )
686
+ @click .argument ("item_id" )
687
+ @click .option ("--geom" ,
688
+ type = types .Geometry (),
689
+ callback = check_geom ,
690
+ required = True )
691
+ @click .option ('--mode' , type = str , required = False )
692
+ @click .option ('--band' , type = str , required = False )
693
+ async def item_coverage (ctx , item_type , item_id , geom , mode , band ):
694
+ """Get item clear coverage."""
695
+ async with data_client (ctx ) as cl :
696
+ item_assets = await cl .get_item_coverage (item_type ,
697
+ item_id ,
698
+ geom ,
699
+ mode ,
700
+ band )
701
+ echo_json (item_assets , pretty )
657
702
658
703
659
704
@data .command () # type: ignore
0 commit comments