How can this be done? I want to be able to search all contents (layers, collection, service, maps, apps .,ect) found in my Portal.
Solved! Go to Solution.
#import modules
from arcgis.gis import *
from IPython.display import display
#declare a connection to your portal
gis = GIS("portal URL", "user", "pass")
print("Successfully logged in as: " + gis.properties.user.username)
#search for items without passing in string values to the query or type parameters
items = gis.content.search('', '',)
for item in items:
display(item)
#import modules
from arcgis.gis import *
from IPython.display import display
#declare a connection to your portal
gis = GIS("portal URL", "user", "pass")
print("Successfully logged in as: " + gis.properties.user.username)
#search for items without passing in string values to the query or type parameters
items = gis.content.search('', '',)
for item in items:
display(item)
Perfect! Thank You!!
Seth's answer is correct, but the gis.content.search() method only returns the first 10 items found. You need to add the parameter "max_items=" and set the value greater than the number of items you have in your Portal.