How do I delete/break relationships between entities

609
1
03-29-2019 10:52 AM
SanjayAdvani
New Contributor

I created relationships between layers in a feature service in AGOL using the ArcGIS API for Python using the add_to_definition method:

minesite_layer.manager.add_to_definition({"relationships":mining_sites_rel})

However, I can not see to delete the relationship.  I have tried using the update relationship and passing in an empty list, which give a {'success': True}

but the relationships persist.   I have tried using delete_from_definition where I pass in the entire relationship list of dictionaries which gave me: 

Unable to delete feature service layer definition. 'REL_FK_MINING_AND_HAZARDS_20190225_GDB_POINT_MINING_FEATURE_0' is not a constraint. Could not drop constraint. See previous errors.

I can't find anywhere to drop constraints by name.  Anyone else know how to do this?  Has to be a scripted solution.

0 Kudos
1 Reply
GurminderBharani1
New Contributor III

Use the python's requests module to send an HTTPS Post request as suggested in the documentation below:

Delete From Definition (Feature Layer)—ArcGIS REST API: Services Directory | ArcGIS for Developers 

Refer the: Example 1: Delete fields from the feature service layer

-Gurminder

0 Kudos