<?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: Setting Sharing Level &amp;quot;PUBLIC&amp;quot; Publishing Hosted Layer Using Python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1502801#M85343</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/190407"&gt;@JonahLay&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Is there a way to accomplish this if you are sharing this to your own Portal?&amp;nbsp; I noticed in the Upload Service Definition documentation that it says the Share with Everyone parameter will not be honored if you're sharing to ArcGIS Server.&amp;nbsp; &amp;nbsp;I'm guessing this is why even if I set these parameters my locator I'm overwriting isn't shared with everyone after the script completes.&amp;nbsp; Is there a way to make this work on ArcGIS server?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 21:31:51 GMT</pubDate>
    <dc:creator>MattCashen</dc:creator>
    <dc:date>2024-07-08T21:31:51Z</dc:date>
    <item>
      <title>Setting Sharing Level "PUBLIC" Publishing Hosted Layer Using Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1217057#M60412</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Guys,&amp;nbsp;&lt;BR /&gt;I have a python code to &lt;STRONG&gt;publish and overwrite&lt;/STRONG&gt; a hosted feature layer to &lt;STRONG&gt;AGOL&lt;/STRONG&gt; from my &lt;STRONG&gt;ArcGIS Pro project&lt;/STRONG&gt;. The &lt;STRONG&gt;Problem&lt;/STRONG&gt; is when i run the code to overwrite the Hosted Feature Layer with Updated Data, &lt;STRONG&gt;The Sharing Level&lt;/STRONG&gt; of that Feature layer in AGOL becomes "&lt;STRONG&gt;O&lt;/STRONG&gt;&lt;STRONG&gt;rganization only&lt;/STRONG&gt;". I need to go to the AGOL organization and &lt;STRONG&gt;manually &lt;/STRONG&gt;i need to set the sharing level to&lt;STRONG&gt; Public &lt;/STRONG&gt;every&amp;nbsp;time. Since i am using that layer for a public web map and Web App , the layer needs to be public. My codes are as following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Create FeatureSharingDraft and set overwrite property
server_type = "HOSTING_SERVER"
sddraft = m.getWebLayerSharingDraft(server_type, "FEATURE", service_name)
sddraft.overwriteExistingService = True
sddraft.credits = "These are credits"
sddraft.description = "This is description"
sddraft.summary = "This is summary"
sddraft.tags = "tag1, tag2"
sddraft.useLimitations = "These are use limitations"
sddraft.portalFolder = "01 My DevOps"
sddraft.allowExporting = False
sddraft.enable_sync = True
print("~~Metadata Updated Done~~ Overwrite Enabled")


# Create Service Definition Draft file
sddraft.exportToSDDraft(sddraft_output_filename)
print("SD draft File Creation Done")


# Stage Service
print("Staging Started ...")
sddraft.overwriteExistingService = True
arcpy.server.StageService(sddraft_output_filename, sd_output_filename)
print("~~Staging Done~~")

# Share to portal
print("Uploading Started...")
arcpy.server.UploadServiceDefinition(sd_output_filename, server_type)

print(" Done! ~~ Hosted Layer Re - Published ~~Congrats")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume if inthe &lt;STRONG&gt;sddraft&lt;/STRONG&gt;&amp;nbsp; there could be a function to solve this. I did not find any documentation on this searching the ArcGIS Python documentation or arcpy. &lt;STRONG&gt;Is there a Solution?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My &lt;STRONG&gt;Goal&lt;/STRONG&gt; is to &lt;STRONG&gt;overwrite&lt;/STRONG&gt; the hosted feature layer &lt;STRONG&gt;as a publicly shared feature layer.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;--best&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Ashad&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 18:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1217057#M60412</guid>
      <dc:creator>AshadAlif1</dc:creator>
      <dc:date>2022-09-28T18:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sharing Level "PUBLIC" Publishing Hosted Layer Using Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1217135#M60428</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/518520"&gt;@AshadAlif1&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/server/upload-service-definition.htm" target="_self"&gt;Upload Service Definition&lt;/A&gt; tool to set the sharing settings. There is also a way to set sharing in the sddraft by modifying the XML file. We are working on documenting how to do this in the help topics at an upcoming release.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Jonah&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 20:44:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1217135#M60428</guid>
      <dc:creator>JonahLay</dc:creator>
      <dc:date>2022-09-28T20:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sharing Level "PUBLIC" Publishing Hosted Layer Using Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1217491#M60508</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/190407"&gt;@JonahLay&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the help. I was able to sort it out with documentation you shared.&lt;BR /&gt;&lt;BR /&gt;best&lt;BR /&gt;Ashad&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 17:01:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1217491#M60508</guid>
      <dc:creator>AshadAlif1</dc:creator>
      <dc:date>2022-09-29T17:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sharing Level "PUBLIC" Publishing Hosted Layer Using Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1259855#M65725</link>
      <description>&lt;P&gt;The link that should be the solution for this thread...&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/td-p/1105135" target="_blank"&gt;https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/td-p/1105135&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 15:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1259855#M65725</guid>
      <dc:creator>MarkMankins</dc:creator>
      <dc:date>2023-02-20T15:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sharing Level "PUBLIC" Publishing Hosted Layer Using Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1267922#M66648</link>
      <description>&lt;P&gt;Unfortunetly the question that you are linking has no solution whereas this one does and is exactly what the user was asking for (and also me hehe).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 09:32:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1267922#M66648</guid>
      <dc:creator>NicolasRojas</dc:creator>
      <dc:date>2023-03-15T09:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sharing Level "PUBLIC" Publishing Hosted Layer Using Python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1502801#M85343</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/190407"&gt;@JonahLay&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Is there a way to accomplish this if you are sharing this to your own Portal?&amp;nbsp; I noticed in the Upload Service Definition documentation that it says the Share with Everyone parameter will not be honored if you're sharing to ArcGIS Server.&amp;nbsp; &amp;nbsp;I'm guessing this is why even if I set these parameters my locator I'm overwriting isn't shared with everyone after the script completes.&amp;nbsp; Is there a way to make this work on ArcGIS server?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 21:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/setting-sharing-level-quot-public-quot-publishing/m-p/1502801#M85343</guid>
      <dc:creator>MattCashen</dc:creator>
      <dc:date>2024-07-08T21:31:51Z</dc:date>
    </item>
  </channel>
</rss>

