Option not to hydrate the Portal Item
Is your feature request related to a problem? Please describe. I've registered some external public services in my Portal, my end users can access these services on their systems in the browser and in ArcGIS Pro. I also have a machine where I run some management scripts and this machine cannot communicate with internet resources and these external services, but it can communicate with my Portal. When I run my scripts with ArcGIS API for Python it loads these Portal Items and try do do things, such as setting the delete protection property, sharing the item etc, and it takes a lot of time, like multiple minutes for each operation. I think this is because everything I try to do is forcing ArcGIS API for Python to rehydrate the PortalItem and in this process, it tries to reload the layers from the external service, which cannot be accessed from the machine and this script.
<insert your code here>
Describe the solution you'd like Have the option to only rehydrate on demand, by setting some kind of boolean which prevents the current automatic rehydrates, or maybe have the option not to load the layers in some way?
Describe alternatives you've considered Do to the security policies, allowlisting on the firewall / proxy isn't possible on this machine, otherwise I would have done that.
Additional context
Thanks for considering :-)
@PeaceNlove Thanks for reaching out we are actively working on this but do not have a timeline yet for the changes. We will post updates when we have them!
What version of the API are you using? Please post some code on what exactly you are doing, that would help.
Hi @achapkowski
My code is nothing special
from arcgis import GIS gis = GIS() item = gis.content.get("itemwithexternalserviceinit") item.protect(True)
However, the url of this portalitem with the external mapservice is not accessible from the machine where the code is running, and I think the hydrate which happens when I apply the delete protection is trying to request this external url, and the hydrate therefore takes a lot of time because it will wait to timeout on the request, after which it will complete the rehydrate process I don't need any other info from the item after I applied delete protection, so in my case it would suffice to just apply the delete protection on the portal and to move on without rehydrating the item in the item variable. This way, my code would run within a few seconds instead of minutes and I can apply the delete projection to many portalitems and my script won't run for a long time
I'm using various versions of the api, the script I make is used with different versions of ArcGIS Enterprise and ArcGIS API for Python, because my end users have different versions.