AnsweredAssumed Answered

How to get the status of an export job?

Question asked by drewdowling on Jul 17, 2020
Latest reply on Jul 30, 2020 by nmarecos-esristaff

I'm writing a script to export some feature services in AGOL to FGDB and then download them.

The export process takes a while but my code doesn't pause execution despite using wait='True'. This results in a corrupted zip file as my code downloads it before the export has finished.


Since gis.item.export returns a jobid I would think I could poll the job status until it is success however I don't see a rest endpoint to do this. I've tried things like<jobid> but I don't see any status messages.


As of right now I am putting in an arbitrary 3 minute wait timer but I would like something a little less hacky.

    mygis = GIS(username="myuser",password="*****")

    service = mygis.content.get(itemID)
    itemDes = service.export(title="DamageReports", export_format= 'File Geodatabase', parameters=None, wait='True')
    fgdb = mygis.content.get(itemDes['exportItemId'])

    <wait time goes here>"D:\temp")