<?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 job status of gis.item.export or make it execute synchronously? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853186#M3915</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DOH&lt;IMG __jive_id="501276" alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/501276_doh.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are exactly right. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2020 17:52:59 GMT</pubDate>
    <dc:creator>DrewDowling</dc:creator>
    <dc:date>2020-07-24T17:52:59Z</dc:date>
    <item>
      <title>How to get the job status of gis.item.export or make it execute synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853184#M3913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the ArcGIS API for Python to export a feature service to a FGDB and then download it. My problem is that the export function appears to be asynchronous even though I set &lt;CODE&gt;wait=True&lt;/CODE&gt;.&lt;/P&gt;&lt;P&gt;The returned item from &lt;CODE&gt;gis.item.export()&lt;/CODE&gt; has a jobid so this shouldn't be a problem if I could poll the service for job status but I don't see a URL to do this.&lt;/P&gt;&lt;P&gt;Without a synchronous export or a job status I am user &lt;CODE&gt;time.sleep(60)&lt;/CODE&gt; to slow things down but that not exactly ideal&lt;/P&gt;&lt;P&gt;So how do I get my export to execute synchronously, or how do I query the job status?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;def Get_AGOL_Data_All2(itemID):
    """     PARAMETERS:       itemID (str) = Ther Portal itemID of the feature service to download.
      RETURNS:       None    
  
&amp;nbsp;&amp;nbsp;&amp;nbsp;FUNCTION:       Uses the arcgis api for python library to connect to Portal and copy a feature service to a         
&amp;nbsp;&amp;nbsp;&amp;nbsp;FGDB. Portal returns a zipped file which then has to be unzipped and the contents moved to the staging location      
&amp;nbsp;&amp;nbsp;&amp;nbsp;NOTE:      """
&amp;nbsp;&amp;nbsp;


 &amp;nbsp; print ('Starting Get_AGOL_Data_All()')     
&amp;nbsp;&amp;nbsp; # #anon_gis = GIS()     
&amp;nbsp;&amp;nbsp;&amp;nbsp;mygis = GIS(username="userid",password="****")      
&amp;nbsp;&amp;nbsp;&amp;nbsp;service = mygis.content.get(itemID)     
&amp;nbsp;&amp;nbsp;&amp;nbsp;itemDesc = service.export(title="DamageReports", export_format= 'File Geodatabase', parameters=None, wait='True')     
&amp;nbsp;&amp;nbsp;&amp;nbsp;time.sleep(60)     fgdb = mygis.content.get(itemDesc['exportItemId'])       
&amp;nbsp;&amp;nbsp;&amp;nbsp;fgdb.download(r"D:\temp")          with zipfile.ZipFile(os.path.join( r"D:\temp" , fgdb.name),'r') as zip_tar:         
&amp;nbsp;&amp;nbsp;&amp;nbsp;zip_tar.extractall(r"D:\temp")     print ('Finished Get_AGOL_Data_All()')     
&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.Rename_management(os.path.join(r"D:\temp", zip_tar.filelist[0].filename.split("/")[0]),"DamageReports.gdb")      
&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;/CODE&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:31:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853184#M3913</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2021-12-12T10:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the job status of gis.item.export or make it execute synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853185#M3914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks to me like the default for "wait' is &lt;STRONG&gt;True, &lt;/STRONG&gt;so you really shouldn't need it. &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.export"&gt;Documentation &lt;/A&gt;says it's a Boolean, so I'd drop the quotes around &lt;STRONG&gt;True&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;export &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; wait &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 22:40:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853185#M3914</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-07-23T22:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the job status of gis.item.export or make it execute synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853186#M3915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DOH&lt;IMG __jive_id="501276" alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/501276_doh.gif" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are exactly right. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 17:52:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853186#M3915</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2020-07-24T17:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the job status of gis.item.export or make it execute synchronously?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853187#M3916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it worked - happy Friday, Drew !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 18:06:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-get-the-job-status-of-gis-item-export-or/m-p/853187#M3916</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-07-24T18:06:01Z</dc:date>
    </item>
  </channel>
</rss>

