How do I update Capabilities through ArcGIS API for Python?

1534
5
Jump to solution
02-26-2019 08:17 AM
SanjayAdvani
New Contributor

When publishing a feature service from a geodatabase, and using the ArcGIS arcis api for python, I can update my capabilities from (default) "Query" to "Query, Sync" with

update_dict2 = {"syncEnabled": True}
flc.manager.update_definition(update_dict2)

where flc is my feature layer collection.

However, I have not been able to update to "Create,Delete,Query,Update,Editing,Sync" except through the web application.

Much like I did not change the "Capabilities" values directly to allow for Sync, is there another place I add Create, Delete, and Editing?  In the front end I just click the check box "Enable Editing"

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
LauraRoghair
New Contributor

I was able to set the hosted view capabilities on create but not with update:

capabilities = "Create,Delete,Query,Update,Editing,Extract,Sync,ChangeTracking"

view_flc = hosted_flc.manager.create_view(name=view_name, allow_schema_changes=True, updateable=True, capabilities=capabilities)

View solution in original post

5 Replies
LauraRoghair
New Contributor

I was able to set the hosted view capabilities on create but not with update:

capabilities = "Create,Delete,Query,Update,Editing,Extract,Sync,ChangeTracking"

view_flc = hosted_flc.manager.create_view(name=view_name, allow_schema_changes=True, updateable=True, capabilities=capabilities)

SanjayAdvani
New Contributor

Laura - that seemed to work... I didn't separate out which of those in the update dictionary made it work, but thanks.

0 Kudos
RebeccaRichman
Esri Contributor

If you grab the update definition request from the web application, the json parameter is: 

{"hasStaticData":false,"capabilities":"Query,Editing,Create,Update,Delete","editorTrackingInfo":{"enableEditorTracking":false,"enableOwnershipAccessControl":false,"allowOthersToUpdate":true,"allowOthersToDelete":true,"allowOthersToQuery":true,"allowAnonymousToUpdate":true,"allowAnonymousToDelete":true}}

Since you are not changing the editor tracking you can ignore that, but you do need to change the hasStaticData value to false. 

SanjayAdvani
New Contributor

Thanks Rebecca - I will try that

0 Kudos
simoxu
by MVP Regular Contributor
MVP Regular Contributor

I feel the different API version may behave slightly differently on different GIS platform version.

My case is quite opposite.

flc.manager.update_definition({"capabilities":"Create,Delete,Query,Update,Editing,Sync"})

works, but

flc.manager.update_definition({"syncEnabled":True})

doesn't.

My version is portal 10.6.1, API 1.5.3

0 Kudos