I have a script to publish data from an SDE to ArcGIS Enterprise. The script will enable feature access in the SD draft before publishing. I'm looking for some guidance or examples on how to also change the Instance Type to Dedicated and set the min/max # of instances. The script I have defaults the services to Shared Instance.
'''Modify the .sddraft file to enable overwriting services'''
# Read the file
doc = DOM.parse(sddraft_output_filename)
# Enable overwrite existing service
tagsType = doc.getElementsByTagName('Type')
for tagType in tagsType:
if tagType.parentNode.tagName == 'SVCManifest':
if tagType.hasChildNodes():
tagType.firstChild.data = 'esriServiceDefinitionType_Replacement'
'''Modify the .sddraft file to enable feature access'''
# Find all elements named TypeName
# This is where the addition layers and capabilities are defined
typeNames = doc.getElementsByTagName('TypeName')
for typeName in typeNames:
# Get the TypeName to enable
if typeName.firstChild.data == 'FeatureServer':
extension = typeName.parentNode
for extElement in extension.childNodes:
# Enable feature access
if extElement.tagName == 'Enabled':
extElement.firstChild.data = 'true'
# Get all the value tags.
values = doc.getElementsByTagName('Value')
for value in values:
if value.hasChildNodes():
# Change the default WebCapabilities from 'Query,Create,Update,Delete,Uploads,Editing' to just 'Query'.
if value.firstChild.data == 'Query,Create,Update,Delete,Uploads,Editing':
value.firstChild.data = 'Query,Create,Update,Delete'