arcgis-python-api icon indicating copy to clipboard operation
arcgis-python-api copied to clipboard

Output Service Definition to .SD File

Open FeralCatColonist opened this issue 3 years ago • 0 comments
trafficstars

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:

  1. 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?
  2. Can we get a function in the API for Python to output the .SD file?

Describe alternatives you've considered

Additional context

FeralCatColonist avatar Jul 27 '22 19:07 FeralCatColonist