<?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 Listing Layers on a Server in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/listing-layers-on-a-server/m-p/87938#M6855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the script in the link below to export the folders and services from a server to an excel spreadsheet but wanted to find out if there is a way to alter the script to also export the layers in the services and possibly the layer's item ID. Or if anyone has done something similar to this a different way I'm all ears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/server/10.3/administer/windows/example-write-properties-of-all-services-to-a-csv-file.htm" title="https://enterprise.arcgis.com/en/server/10.3/administer/windows/example-write-properties-of-all-services-to-a-csv-file.htm"&gt;Example: Write properties of all services to a CSV file—Documentation (10.3 and 10.3.1) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2020 02:17:09 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-10-08T02:17:09Z</dc:date>
    <item>
      <title>Listing Layers on a Server</title>
      <link>https://community.esri.com/t5/python-questions/listing-layers-on-a-server/m-p/87938#M6855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the script in the link below to export the folders and services from a server to an excel spreadsheet but wanted to find out if there is a way to alter the script to also export the layers in the services and possibly the layer's item ID. Or if anyone has done something similar to this a different way I'm all ears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/server/10.3/administer/windows/example-write-properties-of-all-services-to-a-csv-file.htm" title="https://enterprise.arcgis.com/en/server/10.3/administer/windows/example-write-properties-of-all-services-to-a-csv-file.htm"&gt;Example: Write properties of all services to a CSV file—Documentation (10.3 and 10.3.1) | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:17:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listing-layers-on-a-server/m-p/87938#M6855</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-10-08T02:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Listing Layers on a Server</title>
      <link>https://community.esri.com/t5/python-questions/listing-layers-on-a-server/m-p/87939#M6856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That code you reference is a great example of Esri's right hand not knowing what its left hand is doing.&amp;nbsp; Esri introduced &lt;A class="link-titled" href="https://developers.arcgis.com/python/" title="https://developers.arcgis.com/python/"&gt;ArcGIS API for Python | ArcGIS for Developers&lt;/A&gt; in December, 2016 (right after ArcGIS Enterprise 10.5 was released) as a definitive Python wrapper for the REST API.&amp;nbsp; Here we are almost 4 years later, and Esri is just carrying the outdated code samples forward in their documentation with each new release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first suggestion, do not try to roll your own Python httplib code for interacting with the REST API with Python.&amp;nbsp; My second suggestion, check out the &lt;A class="link-titled" href="https://developers.arcgis.com/python/" title="https://developers.arcgis.com/python/"&gt;ArcGIS API for Python | ArcGIS for Developers&lt;/A&gt; API reference, guide, and sample notebooks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your question about "the layer's item ID," are you just referring to the layer's ID in the service?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:39:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listing-layers-on-a-server/m-p/87939#M6856</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-10-08T02:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Listing Layers on a Server</title>
      <link>https://community.esri.com/t5/python-questions/listing-layers-on-a-server/m-p/87940#M6857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Krista&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to get layer ID info, you could try rest point something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. List all services you have by&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://locator.snowyhydro.com.au/arcgis/rest/services/?f=pjson" title="https://locator.snowyhydro.com.au/arcgis/rest/services/?f=pjson"&gt;https://SERVER/WebAdapter/rest/services/?f=pjson&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Then pass the service name to below rest point format and interpret the response&lt;/P&gt;&lt;P&gt;&lt;A href="https://SERVER/WebAdapter/rest/services/SampleWorldCities/MapServer/layers?f=json"&gt;https://SERVER/WebAdapter/rest/services/SampleWorldCities/MapServer/layers?f=json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW:&amp;nbsp; you need to add token stuff in the request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2020 03:58:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listing-layers-on-a-server/m-p/87940#M6857</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-10-08T03:58:00Z</dc:date>
    </item>
  </channel>
</rss>

