I am trying to overwrite a hosted feature layer in AGOL that has editing enabled on it. When I update the service, the editing capability of the service is removed. I'd like to retain it.
Seemed like this could be fixed by adding JSON params to the arcgis.gis publish method. Are my publishing_parameters correct below? Or am I going about this wrong?
arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name,'MY_HOSTED_SERVICES', 'FEATURE_ACCESS',None, True, True, True)
arcpy.StageService_server(sddraft, sd)
sdItem = gis.content.search("{} AND owner:{} ".format(sd_fs_name, agolUsername), item_type="Service Definition")[0]
sdItem.update(data=sd)
pub_params = {"layerInfo" : {"capabilities": "Editing"}}
fs = sdItem.publish(publish_parameters=pub_params, overwrite=True)
Solved! Go to Solution.
I think I have what I'm looking for in this post..
How do I make a hosted feature layer editable with... - GeoNet, The Esri Community
I think I have what I'm looking for in this post..
How do I make a hosted feature layer editable with... - GeoNet, The Esri Community