I am migrating from my own Python 2.7 package for performing administrative tasks against the various ArcGIS REST API endpoints to the ArcGIS API for Python. The biggest question for day one is why do I get different results when I use the arcgis.gis.server.ServerManager.get method versus the arcgis.gis.server.ServerManager.list method. For example, list gives me a list of one server that references the web adaptor URL while get returns a similar list with the direct administrative URL on the server.
From here, I tested some code to find and start or stop a service. The problem is that the list method server works and the get method server doesn't. Now I can think hard about why one works and the other doesn't from an ArcGIS Server standpoint, but I don't see why the two different methods in the ArcGIS API for Python yield different results.
Second, the list method is very slow (about 1 minute), while the get method is very fast. That is why I tried the get approach in the first place, namely to speed up the process. If I were to make the REST requests directly, I wouldn't have to wait this minute for no apparent reason.
I guess this might regard to your setting in Portal, namely, when you federate the server, server name with port provided.
I can confirm the results are consistent from my end while federating without the port.
That's interesting. I went to the Portal settings page and found the following:
Here are the results when I make different method calls:
You can see how that is kind of strange behavior. It's almost as if list really means list the federated servers.
Also, I really don't understand why list takes one minute and get takes one second.