Select to view content in your preferred language

Accessing to Federated Server Web Adaptor From ArcGIS API for Python

394
1
Jump to solution
12-06-2023 05:32 AM
BHK
by
Occasional Contributor

Can someone please let me know , how I can get a federated ArcGIS Server Web Adaptor by using the ArcGIS API for Python?

I used this code but as you can see this is listing only Portal web adaptor and not the Server one

 

from arcgis.gis import GIS
gis = GIS("https://yourportal.com/portal", "portaladmin", "password")

# Return a List of Web Adaptor objects
webadaptors = gis.admin.system.web_adaptors.list()

# Get the first Web Adaptor object and print out each of its values
for key, value in dict(webadaptors[0]).items():
    print("{} : {}".format(key, value))

 

 

I also tried.

 

from arcgis.gis import GIS
from arcgis.gis.server import ServerManager
from arcgis.gis.admin import PortalAdminManager

gis = GIS(profile="Portal_Admin")
servermanager = ServerManager(gis=gis)

 

 

but the ServerManager not have any object for Server Portal.

 

 

 

0 Kudos
1 Solution

Accepted Solutions
EarlMedina
Esri Regular Contributor

You can do something like this:

from arcgis.gis import GIS
gis = GIS("https://yourportal.com/portal", "portaladmin", "password")
hosting_server = gis.admin.servers.get(role="HOSTING_SERVER")[0]

 

And then use hosting_server.system, which is a System Manager.

 

The web_adaptors property, for example, returns:

{'webAdaptors': [{'machineName': 'machine',
   'machineIP': '10.29.77.176',
   'webAdaptorURL': 'https://machine.domain.com/server',
   'id': '4y0f8a80-01as-4e0e-bc6d-3d1234873c5',
   'description': '',
   'httpPort': -1,
   'httpsPort': 443,
   'refreshServerListInterval': 1,
   'reconnectServerOnFailureInterval': 1,
   'isAdminEnabled': True}]}

 

Some other things you may find useful are "unregister_webadaptor" and "update_web_adaptors_configuration"

 

View solution in original post

0 Kudos
1 Reply
EarlMedina
Esri Regular Contributor

You can do something like this:

from arcgis.gis import GIS
gis = GIS("https://yourportal.com/portal", "portaladmin", "password")
hosting_server = gis.admin.servers.get(role="HOSTING_SERVER")[0]

 

And then use hosting_server.system, which is a System Manager.

 

The web_adaptors property, for example, returns:

{'webAdaptors': [{'machineName': 'machine',
   'machineIP': '10.29.77.176',
   'webAdaptorURL': 'https://machine.domain.com/server',
   'id': '4y0f8a80-01as-4e0e-bc6d-3d1234873c5',
   'description': '',
   'httpPort': -1,
   'httpsPort': 443,
   'refreshServerListInterval': 1,
   'reconnectServerOnFailureInterval': 1,
   'isAdminEnabled': True}]}

 

Some other things you may find useful are "unregister_webadaptor" and "update_web_adaptors_configuration"

 

0 Kudos