DataScript: avi.pool.get_server_info


Function avi.pool.get_server_info()
Description Returns the IPv4 address and port of the server for this request or response.
Note: With content switching or multiplexing, a single client connection may have multiple requests, each distributed to a different server.
Events HTTP_RESP
Parameter None
Returns The server's IP address (string) and its port number
Caveats The pool name, server name or IP, and the server port may be called explicitly, or dynamically determined based on a Lua expression. If the pool name, server, or server port do not exist or are not able to be referenced by the virtual service, an error is generated.

  • Explicit reference: A configuration error will be generated while saving the DataScript.
  • Dynamically generated reference: A runtime error is generated, which results in a 500 error return to the client.
Related avi.pool.get_server_status(), determines the status of the server listening at a specified port.
Example
ip, port = avi.pool.get_server_info()