@@ -187,7 +187,17 @@ async def list_drives(self):
187187 results = []
188188 for drive in self ._drives :
189189 try :
190- results += drive .list_containers ()
190+ if hasattr (drive , 'is_public' ):
191+ results .append ({
192+ "name" : drive .url ,
193+ "region" : self ._config .region_name ,
194+ "creationDate" : datetime .datetime .now (),
195+ "mounted" : False if result .name not in self ._content_managers else True ,
196+ "provider" : self ._config .provider
197+ })
198+ else :
199+ results += drive .list_containers ()
200+
191201 except Exception as e :
192202 raise tornado .web .HTTPError (
193203 status_code = httpx .codes .BAD_REQUEST ,
@@ -624,6 +634,28 @@ async def new_drive(self, new_drive_name, location='us-east-1'):
624634
625635 return
626636
637+ async def add_public_drive (self , drive_url ):
638+ """Mount a drive.
639+
640+ Args:
641+ drive_url: public URL of bucket to mount
642+ """
643+ try :
644+ drive = {
645+ "is_public" : True ,
646+ "url" : drive_url
647+ };
648+ print ('ADDED PUBLIC DRIVE: ' , drive )
649+ self ._drives .append (drive );
650+ print (self ._drives )
651+ except Exception as e :
652+ raise tornado .web .HTTPError (
653+ status_code = httpx .codes .BAD_REQUEST ,
654+ reason = f"The following error occured when adding the public drive: { e } "
655+ )
656+
657+ return
658+
627659 async def _get_drive_location (self , drive_name ):
628660 """Helping function for getting drive region.
629661
0 commit comments