Is it possible to create a new service definition file from an existing ArcGIS service?
I have a python script that updates data on a daily basis. I have figured out how to restart/overwrite my existing service so that it will represent the change in the data. However doing so uses the default settings for the new service.
If possible, I would like to create a new service definition file from an existing service so that I do not have to go back manually and change the following parameters and capabilities:
Max # of Records Returned by Server, Lock Database, Max # of instances per machine,
Any advice would be great. Thanks
Here is the solution:
# Deserialize response into Python object dataObj = json.loads(data) httpConn.close() # Edit desired properties of the service dataObj["minInstancesPerNode"] = 1 dataObj["maxInstancesPerNode"] = 10 newdict = dataObj["properties"] newdict["maxRecordCount"] = 5000 # Serialize back into JSON updatedSvcJson = json.dumps(dataObj)