arcgis-python-api
arcgis-python-api copied to clipboard
Output Service Definition to .SD File
Is your feature request related to a problem? Please describe. I am trying to update an AGO service with data nightly from my Enterprise Geodatabase. What I would like to do to ensure the service is the same is to grab the service definition file from AGO. Is see how to do that manually; from the API docs it looks like the only way to generate the service definition is as a dictionary from the FeatureLayerCollectionManager. https://developers.arcgis.com/python/api-reference/arcgis.features.managers.html#:~:text=property%20generate_service_definition%C2%B6
arcpy.server.UploadServiceDefinition(in_sd_file, in_server, {in_service_name}, {in_cluster}, {in_folder_type}, {in_folder}, {in_startupType}, {in_override}, {in_my_contents}, {in_public}, {in_organization}, {in_groups})
Describe the solution you'd like I think for me, the immediate workaround would be, is there a way to generate the .sd file from this dictionary? And the longer-term feature would be either:
- Can ArcPy can accept a Dictionary as the ServiceDefinition (optionally instead of the .SD file) since that is the output of the ArcGIS API for Python?
- Can we get a function in the API for Python to output the .SD file?
Describe alternatives you've considered
Additional context