Thanks for your potential help!
I'm using the CreateGeocodeSDDraft script to overwrite my Locator on Portal which is working... except -- when it overwrites/publishes - the permissions are set to Private and I want it to be Public/Everyone. I can change it to Everyone/Public in Portal, or on the Server Manager - run the script - is published but it private.
Any ideas? I've tried everything I can think of (there are some not called variables from all my attempts)
here is the script I'm using
import arcpy
import pprint
#sign into portal
arcpy.SignInToPortal(arcpy.GetActivePortalURL(), "####", "####")
# Overwrite any existing outputs
arcpy.env.overwriteOutput = True
locator_path = "C:\\Users\\gisadmin\\Desktop\\Geocoders\\simplicity"
sddraft_file = "C:\\locator_script\\simplicity.sddraft"
sd_file = "C:\\locator_script\\simplicity.sd"
service_name = "simplicity"
#shrOrg = True
#shrEveryone = True
#shrGroups = ""
folderName = "Geocoders"
summary = "Address ans Streets locator for the City of Asheville Simplicity Application!"
tags = "address, locator, geocode"
shared = True
everyone ='true'
orgs = 'true'
groups = None
shrOrg = True
shrEveryone = True
shrGroups = ""
# The URL of the federated server you are publishing to
in_server = "https://gisportal.asheville.gov/server/rest/services/Geocoders/"
# Create the sd draft file
analyze_messages = arcpy.CreateGeocodeSDDraft(locator_path, sddraft_file, service_name,
copy_data_to_server=True,
summary=summary, tags=tags, max_result_size=20,
max_batch_size=500, suggested_batch_size=150,
overwrite_existing_service=True)
# Stage and upload the service if the sddraft analysis did not contain errors
if analyze_messages['errors'] == {}:
try:
# Execute StageService to convert sddraft file to a service definition
# (sd) file
arcpy.server.StageService(sddraft_file, sd_file)
# Execute UploadServiceDefinition to publish the service definition
# file as a service
arcpy.server.UploadServiceDefinition(sd_file, in_server)
print("The geocode service was successfully published")
except arcpy.ExecuteError:
print("An error occurred")
print(arcpy.GetMessages(2))
else:
# If the sddraft analysis contained errors, display them
print("Error were returned when creating service definition draft")
pprint.pprint(analyze_messages['errors'], indent=2)