POST
|
I decided my task. I do not know how the arcrest works, it is unuseful here. import requests
session = requests.session()
t1 = session.post("https://domain/web-adaptor/portaladmin/login",
[('username', 'username'), ('password', 'password')])
t2 = session.post("https://domain/web-adaptor/portaladmin/exportSite",
data=[('location', r"D:\backups"), ('f', 'HTML')])
... View more
02-15-2017
04:54 AM
|
0
|
1
|
887
|
POST
|
import arcrest
from arcresthelper import securityhandlerhelper
token = securityhandlerhelper.securityhandlerhelper({"username": "username", "password": "password",
"org_url": "https://domen/gisportal"})
org = arcrest.manageportal.PortalAdministration("https://domen/gisportal/portaladmin",
securityHandler=token.securityhandler)
org.exportSite(r"D:\backups\ags_portal")
When I create a token, getting an exception "Admistrative access denied, unable to check if hosting servers". Export does not work still.
... View more
02-14-2017
12:26 AM
|
0
|
1
|
887
|
POST
|
Thank you. Details of the error in variable "org": PortalAdministration.federation:
Unfortunately I did not get the portal token by using standard libraries. Please, give an example of how you do it.
... View more
02-12-2017
10:58 PM
|
0
|
3
|
887
|
POST
|
Can someone help me with a python script to export a portal site. # -*- coding: utf-8 -*-
import arcrest
tokenUrl = "https://{domain}/{web-adaptor}/sharing/rest/generateToken"
org_url = "https://{domain}/{web_adaptor}/sharing/rest"
sh = arcrest.PortalTokenSecurityHandler(username="{user}", password="{pass}", org_url=org_url,
token_url=tokenUrl)
org = arcrest.manageportal.PortalAdministration("https://{domain}/{web-adaptor}/portaladmin", sh)
org.exportSite(r"D:\backups\ags_portal") Result: I changed the script, and now there are no errors: sh = arcrest.PortalTokenSecurityHandler(username="user", password="pass", org_url=org_url,
token_url=tokenUrl)
psh = sh.portalServerHandler("https://servername:6443/arcgis")
arcrest.manageportal.PortalAdministration("https://domain/web-adaptor/portaladmin",
psh).exportSite(r"D:\backups\ags_portal")
The script is executed, the result is not. Links, name of portal admin and password are correct.
... View more
02-08-2017
12:00 AM
|
0
|
8
|
2535
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|