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:
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
g <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN>profile<SPAN class="operator token">=</SPAN><SPAN class="string token">'xyz'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Connected to: {}\nConnected as: {}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN> g<SPAN class="punctuation token">.</SPAN>url <SPAN class="punctuation token">,</SPAN>g<SPAN class="punctuation token">.</SPAN>users<SPAN class="punctuation token">.</SPAN>me<SPAN class="punctuation token">.</SPAN>username<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
id_of_interest <SPAN class="operator token">=</SPAN> <SPAN class="string token">'bd9902d1c85c4bfab5636af782a89219'</SPAN>
item_of_Interest <SPAN class="operator token">=</SPAN> g<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>id_of_interest<SPAN class="punctuation token">)</SPAN>
dep_to <SPAN class="operator token">=</SPAN> item_of_Interest<SPAN class="punctuation token">.</SPAN>dependent_to<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>len<SPAN class="punctuation token">(</SPAN>dep_to<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'list'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">### Returns 10 ###</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Returns 10 items.
My workaround function is relatively slow but proves that there are 44 dependencies:
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">Find_WMs_using_layer</SPAN><SPAN class="punctuation token">(</SPAN>layer_item<SPAN class="punctuation token">,</SPAN> webmaps_list<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="operator token">not</SPAN> webmaps_list<SPAN class="punctuation token">:</SPAN>
webmaps_list <SPAN class="operator token">=</SPAN> g<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>search<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"*"</SPAN><SPAN class="punctuation token">,</SPAN> item_type<SPAN class="operator token">=</SPAN><SPAN class="string token">"Web Map"</SPAN><SPAN class="punctuation token">,</SPAN> max_items <SPAN class="operator token">=</SPAN> <SPAN class="number token">300</SPAN><SPAN class="punctuation token">,</SPAN> outside_org<SPAN class="operator token">=</SPAN><SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'%s webmaps found in portal'</SPAN> <SPAN class="operator token">%</SPAN> len<SPAN class="punctuation token">(</SPAN>webmaps_list<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
id_of_interest <SPAN class="operator token">=</SPAN> layer_item<SPAN class="punctuation token">.</SPAN>id
out_webmaps <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"{:-<50}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN><SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
lyr <SPAN class="operator token">=</SPAN> None
<SPAN class="keyword token">for</SPAN> wm <SPAN class="keyword token">in</SPAN> webmaps_list<SPAN class="punctuation token">:</SPAN>
raw_data <SPAN class="operator token">=</SPAN> wm<SPAN class="punctuation token">.</SPAN>get_data<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
lyrs <SPAN class="operator token">=</SPAN> raw_data<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'operationalLayers'</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">for</SPAN> lyr <SPAN class="keyword token">in</SPAN> lyrs<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="string token">'itemId'</SPAN> <SPAN class="keyword token">in</SPAN> lyr<SPAN class="punctuation token">.</SPAN>keys<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">and</SPAN> lyr<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'itemId'</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="operator token">==</SPAN> id_of_interest<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"\t %s contains layer of interest as %s"</SPAN> <SPAN class="operator token">%</SPAN> <SPAN class="punctuation token">(</SPAN> wm<SPAN class="punctuation token">.</SPAN>title<SPAN class="punctuation token">,</SPAN> lyr<SPAN class="punctuation token">[</SPAN><SPAN class="string token">'title'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
out_webmaps<SPAN class="punctuation token">.</SPAN>append<SPAN class="punctuation token">(</SPAN>wm<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">return</SPAN> out_webmaps
id_of_interest <SPAN class="operator token">=</SPAN> <SPAN class="string token">'bd9902d1c85c4bfab5636af782a89219'</SPAN>
item_of_Interest <SPAN class="operator token">=</SPAN> g<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>get<SPAN class="punctuation token">(</SPAN>id_of_interest<SPAN class="punctuation token">)</SPAN>
webmaps <SPAN class="operator token">=</SPAN> Find_WMs_using_layer<SPAN class="punctuation token">(</SPAN>item_of_Interest<SPAN class="punctuation token">,</SPAN> webmaps_list<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
len<SPAN class="punctuation token">(</SPAN>webmaps<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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!