Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy
- import arcgis
- import json
- from urllib.parse import urlparse
- from arcgis.gis import GIS
- def parse_url(url):
- parsed_uri = urlparse( url)
- hostname=parsed_uri.hostname
- return hostname
- def output_portal(portalUrl, portalAdminUser, portalAdminUserPassword):
- #gis = GIS(portalUrl, portalAdminUser, portalAdminUserPassword)
- gis=GIS()
- url = arcpy.GetActivePortalURL()
- print("Current Portal: "+url)
- domain=parse_url(url)
- portalDesc =arcpy.GetPortalDescription()
- outfile=open(domain+".json","w")
- outfile.write(json.dumps(portalDesc, indent=4, sort_keys=True))
- outfile.close()
- # get all maps posted to the portal
- # for each map print all the layers in the portal
Add Comment
Please, Sign In to add comment