HOW TO
An ArcGIS Server feature service can be configured to include different capabilities for various operations. These capabilities can be selected by accessing the ArcGIS REST Service Directory of the hosted service. Individual layers are accessed through the REST directory and the capabilities of the hosted service are identified through the details listed in the directory.
The image below shows the ArcGIS REST Service Directory page of a feature with full capabilities.
This article describes the workflow to change the capabilities using ArcGIS API for Python. The script can be run using a stand-alone .py file or Jupyter Notebook.
from arcgis.gis import GIS from arcgis.features import FeatureLayerCollection
gis = GIS('portal url', 'user name', 'password', verify_cert=False)
search_result= gis.content.search(query="title: Layer Name", item_type="Feature Layer") test_item= search_result[0] test_flc = FeatureLayerCollection.fromitem(test_item)
update_dict = {"capabilities": "Create,Editing,Uploads,Delete,Query"} test_flc.manager.update_definition(update_dict)The code block below demonstrates the full script.
from arcgis.gis import GIS from arcgis.features import FeatureLayerCollection gis = GIS('https://domain.esri.com/portal', 'username123', 'password123', verify_cert=False) search_result= gis.content.search(query="title: Mosaic", item_type="Feature Layer") test_item= search_result[0] test_flc = FeatureLayerCollection.fromitem(test_item) update_dict = {"capabilities": "Create,Delete,Query,Update,Editing,Extract"} test_flc.manager.update_definition(update_dict)
The image below shows the changed capabilities after running the script.
Get help from ArcGIS experts
Download the Esri Support App