def init(self):
"""
Method used to setup the AOS-server URL given the `server` and `port`
arguments.
Args:
server (str): server-name/ip-address (does not include the http:// prefix)
port (int): the AOS server port
"""
target = self.session._target
res = urlparse(target)
if res.scheme:
self.server = res.hostname
self.port = res.port or socket.getservbyname(res.scheme)
self.url = target + "/api"
else:
raise ValueError("AOS-server target(%s) not a proper URL" %
target)
评论列表
文章目录