Update services but keep current configuration

817
2
04-04-2017 11:26 AM
Drew
by
Regular Contributor

Hello,

I am building a python script that will update some of our mapping services in the middle of the night to prevent any down time.

I have successfully written all the code to create the SD Draft file and SD file along with using the ‘UploadServiceDefinition_server’ tool to upload the service..

I also define the service to be an ‘UPDATE’ by modifying the .sddraft XML file with 'esriServiceDefinitionType_Replacement'

My issue is when I update the service all my other services settings are replaced with the defaults. I want to keep the existing configuration of that service in tact and just update the service with a new MXD.

Is there any way to do this using python tools?

Thanks,

Drew

Tags (2)
0 Kudos
2 Replies
JonathanQuinn
Esri Frequent Contributor

This isn't addressing your specific problem, but possibly another way to achieve what you're looking to do is to query the JSON of the service from the Admin API, store it in a variable, publish the new service, and then overwrite the JSON with what you've stored.  If the only thing you're changing is some layers or other properties in the MXD, that may work for you.

Drew
by
Regular Contributor

Thanks Jonathan,

That's was the solution I had as plan B but I was hoping there was a more elegant way strictly using some arypy tools.

I appreciate the reply.

Drew

0 Kudos