Closed SergStol closed 8 years ago
@SergStol you need to update the portal properties through the Portal class.
I believe the issue is Portal.update() is the function.
Thanks a lot for the pointer! I have managed to construct a workflow to do this. As currently there is a bug in Portal where you cant set up your default basemap in the settings. Works fine in AGOL.
Here is the code that worked for me to inject a basemap json into Portal to use as default basemap:
import arcrest import json
securityinfo = {}
securityinfo['security_type'] = 'Portal'
securityinfo['username'] = "username"
securityinfo['password'] = "password"
securityinfo['org_url'] = "https://yourportal.com/webadaptor"
securityinfo['proxy_url'] = None
securityinfo['proxy_port'] = None
securityinfo['referer_url'] = None
securityinfo['token_url'] = None
securityinfo['certificatefile'] = None
securityinfo['keyfile'] = None
securityinfo['client_id'] = None
securityinfo['secret_id'] = None
token = securityhandlerhelper.securityhandlerhelper(securityinfo=securityinfo)
admin = arcrest.manageorg.Administration(securityHandler=token.securityhandler)
portal = admin.portals.portalSelf
with open('path\to\basemapjson\basemap.json') as f: newbmap = json.load(f)
newbmap2 = json.dumps(newbmap)
pp = arcrest.manageorg.PortalParameters()
pp = arcrest.manageorg.PortalParameters()
pp.defaultBasemap = newbmap2
portal.update(pp)
print(portal.defaultBasemap)
I want to configure a default basemap through ArcREST, is this possible? I can see in administration._portals there is ways to get defaults basemaps. No methods to change this though.