In ArcGIS Enterprise 10.8.1 is it possible to perform a /queryDomains call via the REST API for a hosted feature service? I am currently not seeing it as a supported operation in the web interface. I am able to browse to the /queryDomains endpoint however off of the hosted feature service however I receive an error message when executing a GET\POST of "Error performing query domains operation". I haven't found any credible information so far as to whether it works or not. I am able to do this on a non-hosted feature service within the same environment without issue.
Solved! Go to Solution.
I haven't been able to do so, either. I'd guess this is because QueryDomains hits the service itself, as an SDE-based service would share its domains across layers.
In hosted layers, however, domains apply at the layer level, and the layers within the service lack the supportsQueryDomains property. The best I have been able to do for hosted layers is to iterate over items in the {'fields': [...]} object and pull out items where {'domain':...} isn't null.
I haven't been able to do so, either. I'd guess this is because QueryDomains hits the service itself, as an SDE-based service would share its domains across layers.
In hosted layers, however, domains apply at the layer level, and the layers within the service lack the supportsQueryDomains property. The best I have been able to do for hosted layers is to iterate over items in the {'fields': [...]} object and pull out items where {'domain':...} isn't null.
Thank you @jcarlson for confirming your experience here as well and providing some more information.
I am interested in the work around you did by iterating over items in the fields object. I am seeing this information available in the layer query in ArcGIS Online but not unfortunately in ArcGIS Enterprise 10.8.1 on premises. Below is an example I see in ArcGIS Online today and on premises in 10.8.1 today. Is there some configuration missing maybe or is this just a newer feature in ArcGIS Online?
Example JSON for OBJECTID in ArcGIS Online:
"fields": [
{
"name": "OBJECTID",
"type": "esriFieldTypeOID",
"alias": "OBJECTID",
"sqlType": "sqlTypeOther",
"domain": null,
"defaultValue": null
},
Example JSON for OBJECTID in ArcGIS Enterprise 10.8.1 on premises (missing sqlType and domain it looks like):
"fields": [
{
"name": "objectid",
"type": "esriFieldTypeOID",
"alias": "ObjectID",
"defaultValue": null
},
We're on 10.8.1, and some layers have the domain given, some don't. Not exactly sure why, but I suspect it may have to do with how the layers were originally published.
I'd say just include a line that looks to see if there even is a "domain" key in the object, then move on to see if it's null or not.
I didn't realize the layer data contained it for some reason. Looks like I can call the hosted feature layer and just do a simple ?f=json on the layer itself. For example: ../rest/services/Hosted/hostedFeatureServiceNameHere/FeatureServer/0?f=json
Thanks again @jcarlson