Overwriting hosted AGOL web service and retaining editing capabilities

314
1
Jump to solution
12-01-2020 02:03 PM
JoelPerkins
New Contributor III

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)

 

0 Kudos
1 Solution

Accepted Solutions
JoelPerkins
New Contributor III
0 Kudos
1 Reply
JoelPerkins
New Contributor III
0 Kudos