I'm trying to overwrite a hosted feature layer using a FGDB Feature Class. I've tried a couple things. First, I've tried merging the two.
1
import arcgis
from arcgis.gis import GIS
gis = GIS('Home')
fl = gis.content.get('item id goes here')
layer_to_merge = r'C:\Users\jpilbeam\Default.gdb\firstdose_test'
arcgis.features.analysis.merge_layers(fl, layer_to_merge)
Result:
Exception: Job failed.
2 Using this post as an example, I tried overwriting the hosted feature layer.
import os, sys, arcpy
from arcgis.gis import GIS
source = GIS('Home', verify_cert=False)
layer = source.content.get('itemID goes here')
layer.update({}, r'C:\Users\jpilbeam\Default.gdb\firstdose_test')
layer.publish(overwrite=True, file_type='fileGeodatabase')
Result:
Exception: Invalid JSON in 'text' parameter.
(Error Code: 400)