<?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 gis.admin submodule only returns root level services in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-admin-submodule-only-returns-root-level/m-p/1192292#M7564</link>
    <description>&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000019994" target="_self"&gt;Referencing this Esri How-To article&lt;/A&gt;, I am unable to return results from any server folder and I cannot seem to find documentation to access specific server folders.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Python API v2.01 Enterprise 10.9.1, federated.&lt;/LI&gt;&lt;LI&gt;The services in and folders are a mix of shared with everyone as well as content restricted to certain groups.&lt;/LI&gt;&lt;LI&gt;User logging in has full Admin privileges; also tried with primary site admin&lt;/LI&gt;&lt;LI&gt;tried accessing via portal URL and directly to Server Url; logins successful but only root level resources are returned.&lt;/LI&gt;&lt;LI&gt;Searching for content via something like gis.content.search(query="query stuff") returns Portal content no problem&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/start-stop-services-in-different-folder/m-p/1160318" target="_self"&gt;Referencing this post here regarding specific folders&lt;/A&gt;, when I try the following (also marked as the solution):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;serverFolder = 'My test folder'
serviceList = gis_servers.services.list(folder=serverFolder)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;'list' object has no attribute 'services'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The original Esri article also suggests that:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;:
If the desired server folder array location is known in the list, the script can be modified to:

servers = gis.admin.servers.list()[0]

"[0]" can be modified to specify the exact location of the service in the array. In the example, the script grabs the first service in the list.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Attempting that, the error is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;AttributeError: 'tuple' object has no attribute 'services'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 19:20:41 GMT</pubDate>
    <dc:creator>ZacharyHart</dc:creator>
    <dc:date>2022-07-14T19:20:41Z</dc:date>
    <item>
      <title>gis.admin submodule only returns root level services</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-admin-submodule-only-returns-root-level/m-p/1192292#M7564</link>
      <description>&lt;P&gt;&lt;A href="https://support.esri.com/en/technical-article/000019994" target="_self"&gt;Referencing this Esri How-To article&lt;/A&gt;, I am unable to return results from any server folder and I cannot seem to find documentation to access specific server folders.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Python API v2.01 Enterprise 10.9.1, federated.&lt;/LI&gt;&lt;LI&gt;The services in and folders are a mix of shared with everyone as well as content restricted to certain groups.&lt;/LI&gt;&lt;LI&gt;User logging in has full Admin privileges; also tried with primary site admin&lt;/LI&gt;&lt;LI&gt;tried accessing via portal URL and directly to Server Url; logins successful but only root level resources are returned.&lt;/LI&gt;&lt;LI&gt;Searching for content via something like gis.content.search(query="query stuff") returns Portal content no problem&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/start-stop-services-in-different-folder/m-p/1160318" target="_self"&gt;Referencing this post here regarding specific folders&lt;/A&gt;, when I try the following (also marked as the solution):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;serverFolder = 'My test folder'
serviceList = gis_servers.services.list(folder=serverFolder)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I receive a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;'list' object has no attribute 'services'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The original Esri article also suggests that:&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;:
If the desired server folder array location is known in the list, the script can be modified to:

servers = gis.admin.servers.list()[0]

"[0]" can be modified to specify the exact location of the service in the array. In the example, the script grabs the first service in the list.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Attempting that, the error is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;AttributeError: 'tuple' object has no attribute 'services'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 19:20:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-admin-submodule-only-returns-root-level/m-p/1192292#M7564</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2022-07-14T19:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: gis.admin submodule only returns root level services</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-admin-submodule-only-returns-root-level/m-p/1192372#M7565</link>
      <description>&lt;P&gt;I have run into this issue as well, so I would be interested in learning how to solve this problem.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 23:19:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-admin-submodule-only-returns-root-level/m-p/1192372#M7565</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2022-07-14T23:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: gis.admin submodule only returns root level services</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-admin-submodule-only-returns-root-level/m-p/1193316#M7574</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/194227"&gt;@ZacharyHart&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;gis.admin.services.list() from the example in the link you provided returns a list of server objects. This is why you get the error&amp;nbsp;'list' object has no attribute 'services' because a Python list object does not have a 'services' property.&lt;/P&gt;&lt;P&gt;You need to reference a single server object within the server list returned and list the services in a folder for that particular server using the contents.list() to return a list of item objects.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## access portal
portal = GIS("home")

## get list of servers as Server objects
## this line here takes a bit to run on my machine, a few minutes each time
gis_servers = portal.admin.servers.list()

## server of interest
## federated server is a Server object
federated_server = gis_servers[1]

## get list of folder contents
folder_contents = federated_server.content.list(folder="My_Folder"))

print(folder_contents)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 11:34:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/gis-admin-submodule-only-returns-root-level/m-p/1193316#M7574</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2022-07-19T11:34:40Z</dc:date>
    </item>
  </channel>
</rss>

