<?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: Create an arcgis server folder with the python API? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575183#M11053</link>
    <description>&lt;P&gt;I think you'll need admin access for this, then the &lt;A href="https://developers.arcgis.com/rest/enterprise-administration/server/createfolder/" target="_self"&gt;Create Folder&lt;/A&gt; resource can take it from there. Can't think of a way to do this with the Python API though so you'll have to pick your preferred HTTP library and send those requests yourself.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2025 23:58:45 GMT</pubDate>
    <dc:creator>DavidSolari</dc:creator>
    <dc:date>2025-01-13T23:58:45Z</dc:date>
    <item>
      <title>Create an arcgis server folder with the python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575163#M11052</link>
      <description>&lt;P&gt;Is it possible to create an arcgis server folder with the python API within ArcGIS 10.8.1? I have tried:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis_target = GIS(portal_url_target, portal_admin_user, portal_admin_password_target)

folder_name = "MyNewFolder"

server = gis_target.admin.servers.list()[0]
server.create_folder(folder_name) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The server object does retrieve my federated AGS. But then the call to create the folder fails.&lt;/P&gt;&lt;P&gt;AttributeError: 'Server' object has no attribute 'create_folder'&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 22:49:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575163#M11052</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2025-01-13T22:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create an arcgis server folder with the python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575183#M11053</link>
      <description>&lt;P&gt;I think you'll need admin access for this, then the &lt;A href="https://developers.arcgis.com/rest/enterprise-administration/server/createfolder/" target="_self"&gt;Create Folder&lt;/A&gt; resource can take it from there. Can't think of a way to do this with the Python API though so you'll have to pick your preferred HTTP library and send those requests yourself.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 23:58:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575183#M11053</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-01-13T23:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create an arcgis server folder with the python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575187#M11054</link>
      <description>&lt;P&gt;The user does have admin access. And I will look into the rest api side.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 00:15:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575187#M11054</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2025-01-14T00:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create an arcgis server folder with the python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575237#M11055</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/200586"&gt;@forestknutsen1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You're almost there with your code, from the server object you need to access the ServiceManager via the services property and then you can use the &lt;A href="https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.server.html#arcgis.gis.server.ServiceManager.create_folder" target="_blank" rel="noopener"&gt;create_folder()&lt;/A&gt; method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## access Portal
portal = GIS("home") # can also use url, username, password

## get the server of interest
server = portal.admin.servers.list()[0]

## access the server ServiceManager and create folder
status = server.services.create_folder("MY_NEW_FOLDER")

print(status) # True if successful, False if a failure.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that helps.&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 10:37:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575237#M11055</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-01-14T10:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create an arcgis server folder with the python API?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575451#M11058</link>
      <description>&lt;P&gt;Ah, that did it! Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 16:38:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-an-arcgis-server-folder-with-the-python-api/m-p/1575451#M11058</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2025-01-14T16:38:33Z</dc:date>
    </item>
  </channel>
</rss>

