I understand that the GIS.content.search() has a max_items parameter, but what about all of the other tools? Is there a property that can be set in the GIS object or anywhere else? Take the item.dependent_to() method for example. The documentation does not list any parameters or make any mention that a limit exists in the first place: dependent_to ()https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.dependent_to Returns items, urls, etc that are dependent to this item. This capability (item dependencies) is not yet available on ArcGIS Online. Currently it is available only with an ArcGIS Enterprise. A python example: from arcgis.gis import GIS
g = GIS(profile='xxx')
print("Connected to: {}\nConnected as: {}".format( g.url ,g.users.me.username))
id_of_interest = 'bd9902d1c85c4bfab5636af782a89219'
item_of_Interest = g.content.get(id_of_interest)
dep_to = item_of_Interest.dependent_to()
print(len(dep_to['list']))
### Returns 10 ### Returns 10 items. My workaround function is relatively slow but proves that there are 44 dependencies: def Find_WMs_using_layer(layer_item, webmaps_list=[]):
if not webmaps_list:
webmaps_list = g.content.search("*", item_type="Web Map", max_items = 300, outside_org=False)
print('%s webmaps found in portal' % len(webmaps_list))
id_of_interest = layer_item.id
out_webmaps = []
print("{:-<50}".format(""))
lyr = None
for wm in webmaps_list:
raw_data = wm.get_data()
lyrs = raw_data['operationalLayers']
for lyr in lyrs:
if 'itemId' in lyr.keys() and lyr['itemId'] == id_of_interest:
print("\t %s contains layer of interest as %s" % ( wm.title, lyr['title']))
out_webmaps.append(wm)
return out_webmaps
id_of_interest = 'bd9902d1c85c4bfab5636af782a89219'
item_of_Interest = g.content.get(id_of_interest)
webmaps = Find_WMs_using_layer(item_of_Interest, webmaps_list=[])
len(webmaps) Returns 44 webmaps that contain a layer using the item ID provided. The same behavior is displayed for the dependent_upon() method. Does anyone know a way to alter the 10 item max? Are there any other methods that display this behavior we can compile a list of tools? Thank you!
... View more