<?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 Defining sharing options in the service definition draft in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1105135#M62583</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to publish a Map Image Service on ArcGIS Enterprise 10.8.1 with arcpy in ArcGIS Pro using &lt;A title="MapImageSharingDraft" href="https://pro.arcgis.com/de/pro-app/2.7/arcpy/sharing/mapimagesharingdraft-class.htm" target="_self"&gt;arcpy.MapImageSharingDraft&lt;/A&gt;. By adapting the&amp;nbsp;&lt;A href="https://desktop.arcgis.com/de/arcmap/latest/analyze/arcpy-mapping/createmapsddraft.htm" target="_self"&gt;Modify SDDraft example 3&lt;/A&gt; I parsed the Map Image Service sddraft to enable the WMS option.&lt;/P&gt;&lt;P&gt;The next stept would be staging and publishing but an error appears when staging: &lt;A href="https://pro.arcgis.com/de/pro-app/2.7/help/sharing/analyzer-error-messages/00297-layers-must-be-shared-with-everyone.htm" target="_self"&gt;Error 00297&lt;/A&gt; because WMS layer has to be shared with everyone.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to define the sharing option before staging the sddraft like setting an option in the sddraft itself? I wasn't able to find a line which adresses this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 13:04:55 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-10-06T13:04:55Z</dc:date>
    <item>
      <title>Defining sharing options in the service definition draft</title>
      <link>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1105135#M62583</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to publish a Map Image Service on ArcGIS Enterprise 10.8.1 with arcpy in ArcGIS Pro using &lt;A title="MapImageSharingDraft" href="https://pro.arcgis.com/de/pro-app/2.7/arcpy/sharing/mapimagesharingdraft-class.htm" target="_self"&gt;arcpy.MapImageSharingDraft&lt;/A&gt;. By adapting the&amp;nbsp;&lt;A href="https://desktop.arcgis.com/de/arcmap/latest/analyze/arcpy-mapping/createmapsddraft.htm" target="_self"&gt;Modify SDDraft example 3&lt;/A&gt; I parsed the Map Image Service sddraft to enable the WMS option.&lt;/P&gt;&lt;P&gt;The next stept would be staging and publishing but an error appears when staging: &lt;A href="https://pro.arcgis.com/de/pro-app/2.7/help/sharing/analyzer-error-messages/00297-layers-must-be-shared-with-everyone.htm" target="_self"&gt;Error 00297&lt;/A&gt; because WMS layer has to be shared with everyone.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to define the sharing option before staging the sddraft like setting an option in the sddraft itself? I wasn't able to find a line which adresses this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 13:04:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1105135#M62583</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-10-06T13:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Defining sharing options in the service definition draft</title>
      <link>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1105184#M62584</link>
      <description>&lt;P&gt;I wrote some python code a while back to publish REST services to our ArcGIS server and as far as I could tell I could only secure the service after the publish (UploadServiceDefinition) was complete. This was fairly simple to do by sending&amp;nbsp; a series of requests via the &lt;A href="https://developers.arcgis.com/rest/enterprise-administration/server/addpermission.htm" target="_self"&gt;Add Permissions REST API&lt;/A&gt;. First I&amp;nbsp; looped on the roles that I wanted to give access to&amp;nbsp; ({'principal': &amp;lt;role_name&amp;gt;, 'isAllowed': True}), then I sent a request to disable the public access ({'principal': 'esriEveryone', 'isAllowed': False})&lt;/P&gt;&lt;P&gt;I didn't enable WMS so maybe there is an issue there that I didn't have to deal with. I'm curious is somebody has a better way so that my "secure" endpoint doesn't have to be exposed publicly - even if it is only for a couple of seconds&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 14:42:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1105184#M62584</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2021-10-06T14:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Defining sharing options in the service definition draft</title>
      <link>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1199410#M65205</link>
      <description>&lt;P&gt;Hi, you can&amp;nbsp;&lt;SPAN&gt;define the sharing option before staging the sddraft like setting an option in the sddraft itself.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the XML :&amp;nbsp;SVCManifest &amp;gt; StagingSettings &amp;gt; PropertyArray and go to the PropertySetProperty node defined by the key Node name "PackageIsPublic": set true to the Value node&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Best reg.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 14:58:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1199410#M65205</guid>
      <dc:creator>jotaefe_1980</dc:creator>
      <dc:date>2022-08-04T14:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Defining sharing options in the service definition draft</title>
      <link>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1217674#M65717</link>
      <description>&lt;P&gt;To expand on&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/607977"&gt;@jotaefe_1980&lt;/a&gt; 's instruction, here's an example of how to set the sharing settings in the .sddraft file:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Read the .sddraft file
docs = DOM.parse(sddraft_output_filename)
key_list = docs.getElementsByTagName('Key')
value_list = docs.getElementsByTagName('Value')

# Change following to "true" to share
SharetoOrganization = "false"
SharetoEveryone = "true"
SharetoGroup = "false"
# If SharetoGroup is set to "true", uncomment line below and provide group IDs
GroupID = ""    # GroupID = "f07fab920d71339cb7b1291e3059b7a8, e0fb8fff410b1d7bae1992700567f54a"

# Each key has a corresponding value. In all the cases, value of key_list[i] is value_list[i].
for i in range(key_list.length):
    if key_list[i].firstChild.nodeValue == "PackageUnderMyOrg":
        value_list[i].firstChild.nodeValue = SharetoOrganization
    if key_list[i].firstChild.nodeValue == "PackageIsPublic":
        value_list[i].firstChild.nodeValue = SharetoEveryone
    if key_list[i].firstChild.nodeValue == "PackageShareGroups":
        value_list[i].firstChild.nodeValue = SharetoGroup
    if SharetoGroup == "true" and key_list[i].firstChild.nodeValue == "PackageGroupIDs":
        value_list[i].firstChild.nodeValue = GroupID

# Write to the .sddraft file
f = open(sddraft_output_filename, 'w')
docs.writexml(f)
f.close()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2022 22:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1217674#M65717</guid>
      <dc:creator>JonahLay</dc:creator>
      <dc:date>2022-09-29T22:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Defining sharing options in the service definition draft</title>
      <link>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1525672#M71299</link>
      <description>&lt;P&gt;A slight change to group sharing in above code solved the issue for me&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if SharetoGroup == "true" and key_list[i].firstChild.nodeValue == "PackageGroupIDs":
    if value_list[i].firstChild == None:
        text_node = docs.createTextNode(GroupID)
        value_list[i].appendChild(text_node)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Without the above code it was giving the "'NoneType' object has no attribute " error&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 12:06:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/defining-sharing-options-in-the-service-definition/m-p/1525672#M71299</guid>
      <dc:creator>arahman_mdmajid</dc:creator>
      <dc:date>2024-08-22T12:06:25Z</dc:date>
    </item>
  </channel>
</rss>

