Select to view content in your preferred language

Overwrite REST Service to protected Folder

208
0
08-29-2022 08:55 AM
Rice_GIS
Occasional Contributor

Trying to write a python script to overwrite a REST service under a specific folder. Does anyone know where or what I need to add if I want to overwrite my service to a specific, password protected folder on my ArcServer? I've tried to have my target_server_connection with the folder I want to add to it as "https://myorganization/rest/services/protectedfolder" but it just keeps adding to the overall rest inventory.

(Code Snippet)

# Create MapServiceDraft and set overwrite property

target_server_connection = r"https://myorganization/rest/services/"

sddraft = arcpy.sharing.CreateSharingDraft("STANDALONE_SERVER", "MapService", service_name, m)

sddraft.targetServer = target_server_connection

sddraft.overwriteExistingService = True

Like I mentioned, the code runs smooth, but I'm just trying to password protect this data behind a folder. Any suggestions are greatly appreciated!

I have been referencing this documentation to construct my code from. It can be found at the bottom under "Overwrite a map service"
https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/mapservicedraft-class.htm 

0 Kudos
0 Replies