Create a Server object from a token

238
0
01-20-2023 09:50 AM
Labels (1)
bburnett44
New Contributor II

Hi I'm trying to make a cli to automate some routine tasks in server (querying logs, stopping services etc). I love using the API for Python since it's already done a lot of the hard work for me but I'd like to not have to reauthenticate every run. My idea right now is to create the Server object w username/password and then store the token as an environmental variable so I could use it with multiple requests. However, I can't find any documentation on creating a server object from a token. Is there any recommendation here?

 

I'm retrieving the token using the solution found here: https://community.esri.com/t5/arcgis-api-for-python-questions/get-the-token-using-arcgis-python-api/...

server._con.token

Thanks

0 Kudos
0 Replies