<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get the status of an export job? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-status-of-an-export-job/m-p/874628#M4856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/3398"&gt;Drew Dowling&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;Have you seen this support article for downloading &lt;A href="https://support.esri.com/en/Technical-Article/000022524"&gt;services as a FDGB&lt;/A&gt;? It was initially written to loop through items located services through gis.content.search(). However, if you have a list of specific items you could use gis.content.get() to loop through the item IDs instead.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm not certain about the checking on the status of an export job and will have to look into it, but I know the following should work without any corruption issues:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;PRE class="" style="color: #4c4c4c; background-color: whitesmoke; font-size: 0.9rem; margin-bottom: 1.55rem; padding: 10px;"&gt;&lt;SPAN style="color: #3d3d3d; background-color: #f6f6f6;"&gt;itemDes&lt;/SPAN&gt; = service.export(service.title + "_" + version, "File Geodatabase")&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE class="" style="color: #4c4c4c; background-color: whitesmoke; font-size: 0.9rem; margin-bottom: 1.55rem; padding: 10px;"&gt;&lt;SPAN style="color: #3d3d3d; background-color: #f6f6f6;"&gt;itemDes&lt;/SPAN&gt;.download(file path for backup_location)&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I believe the problem is that the code above will run once itemDes has finished being created, while&amp;nbsp;&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;fgdb = mygis.content.get(itemDes['exportItemId'])&lt;/SPAN&gt;&amp;nbsp;instead creates a new variable and exports it regardless of whether the FGDB for itemDes&amp;nbsp;has been fully created.&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2020 02:45:05 GMT</pubDate>
    <dc:creator>NicolasMarecos</dc:creator>
    <dc:date>2020-07-31T02:45:05Z</dc:date>
    <item>
      <title>How to get the status of an export job?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-status-of-an-export-job/m-p/874627#M4855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing a script to export some feature services in AGOL to FGDB and then download them.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;A href="https://services1.arcgis.com/myorg/ArcGIS/rest/services/myFS/jobs/&amp;lt;jobid&amp;gt;"&gt;https://services1.arcgis.com/myorg/ArcGIS/rest/services/myFS/jobs/&amp;lt;jobid&amp;gt;&lt;/A&gt; but I don't see any status messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of right now I am putting in an arbitrary 3 minute wait timer but I would like something a little less hacky.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mygis = GIS(username="myuser",password="*****")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; service = mygis.content.get(itemID)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; itemDes = service.export(title="DamageReports", export_format= 'File Geodatabase', parameters=None, wait='True')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fgdb = mygis.content.get(itemDes['exportItemId'])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;wait time goes here&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fgdb.download(r"D:\temp")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 21:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-status-of-an-export-job/m-p/874627#M4855</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2020-07-17T21:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the status of an export job?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-status-of-an-export-job/m-p/874628#M4856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A href="https://community.esri.com/migrated-users/3398"&gt;Drew Dowling&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;Have you seen this support article for downloading &lt;A href="https://support.esri.com/en/Technical-Article/000022524"&gt;services as a FDGB&lt;/A&gt;? It was initially written to loop through items located services through gis.content.search(). However, if you have a list of specific items you could use gis.content.get() to loop through the item IDs instead.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm not certain about the checking on the status of an export job and will have to look into it, but I know the following should work without any corruption issues:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;PRE class="" style="color: #4c4c4c; background-color: whitesmoke; font-size: 0.9rem; margin-bottom: 1.55rem; padding: 10px;"&gt;&lt;SPAN style="color: #3d3d3d; background-color: #f6f6f6;"&gt;itemDes&lt;/SPAN&gt; = service.export(service.title + "_" + version, "File Geodatabase")&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE class="" style="color: #4c4c4c; background-color: whitesmoke; font-size: 0.9rem; margin-bottom: 1.55rem; padding: 10px;"&gt;&lt;SPAN style="color: #3d3d3d; background-color: #f6f6f6;"&gt;itemDes&lt;/SPAN&gt;.download(file path for backup_location)&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I believe the problem is that the code above will run once itemDes has finished being created, while&amp;nbsp;&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;fgdb = mygis.content.get(itemDes['exportItemId'])&lt;/SPAN&gt;&amp;nbsp;instead creates a new variable and exports it regardless of whether the FGDB for itemDes&amp;nbsp;has been fully created.&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Nico&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 02:45:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-status-of-an-export-job/m-p/874628#M4856</guid>
      <dc:creator>NicolasMarecos</dc:creator>
      <dc:date>2020-07-31T02:45:05Z</dc:date>
    </item>
  </channel>
</rss>

