I'm trying to get at the administrative endpoint of my server in order to do things like update the definition, truncate, etc.
According to pages like this, there is a simple URL to get at these things, something like:
https://services.myserver.com/arcgis/rest/admin/services
Regardless of what I've tried to adjust in the settings, I continue to see code 403, with the message:
Access to this resource is not allowed
Confusingly, the documentation seems to indicate that */rest/admin/services is completely different from */admin/services. The former is to perform administrative actions against services, and is inaccessible, the latter is to perform system-wide, potentially damaging edits to the server configuration, and can be accessed easily with a token.
I don't understand why it should be harder to truncate a layer than it is to completely break my server, but that seems to be the case. I haven't seen any explanations for why access to this would be locked down, nor how to open it up. Have I missed a setting? Did I skip a line in the docs that say "oh by the way you can only access this locally"?
I know that these kinds of functions are available through the arcgis.features.managers.FeatureLayerManager class in the Python API, but I need to be able to perform this task with a POST request.
Both those access points require authentication.
How are you accessing the rest/admin/services URL?
I use Postman for certain service admin tasks and as long as I pass a token it works great.
I'm using HTTP POST requests directly to the URL, complete with a valid administrator token. What kinds of tasks are you performing?
I'll update the definition to tweak domains or default values, etc.
It could be an issue with the token. Maybe the client parameter? It always takes me a couple tries to get the right parameters when generating tokens. 🙂
Yeah, that's exactly the sort of stuff I'm looking to do.
I'll take a closer look at the token, but it seems to work fine for everything else I do, whether that's editing the server / site configuration, make edits to feature services, do administrative tasks on the Portal.
Happy to hear it's possible, though! Gives me motivation to keep figuring it out.
Check out Postman, it may help with the troubleshooting. Esri even provides examples: https://www.postman.com/esridevs
Yarg. Nothing seems to work. Server settings even show "isAdminEnabled": true, so I'm not sure what else is going on. Thanks for you help, though!
Maybe this was already discussed but I believe you have to use an admin account to access those end points through the Python API.
I'm specifically not using the Python API, and I am my org's admin. Or do you mean like a system login, not a built-in user?