networking#

Provides a module to get networking functionality.

Functions:

check_url_exists(url)

Check if a URL exists.

find_remoting_ip()

Find an ip address at which a gRPC connection can be established by looping over getaddrinfo output.

get_free_port()

Identifies a free port to which a new socket connection can be established.

get_uds_path(address)

Get the UDS path from a UDS address.

get_url_content(url)

Get the content of a URL.

is_localhost(ip)

Check if the given ip address corresponds to localhost.

ansys.fluent.core.utils.networking.check_url_exists(url)#

Check if a URL exists.

Parameters:
urlstr

URL to check

Returns:
bool

True if the URL exists, False otherwise

Raises:
ssl.SSLError

If there is an SSL error while checking the URL

ValueError

If the URL scheme is not http or https

ansys.fluent.core.utils.networking.find_remoting_ip()#

Find an ip address at which a gRPC connection can be established by looping over getaddrinfo output.

Returns:
str

remoting ip address

ansys.fluent.core.utils.networking.get_free_port()#

Identifies a free port to which a new socket connection can be established.

Returns:
int

port number

ansys.fluent.core.utils.networking.get_uds_path(address)#

Get the UDS path from a UDS address.

Parameters:
addressstr

The address to extract the UDS path from.

Returns:
str | None

The UDS path extracted from the address.

ansys.fluent.core.utils.networking.get_url_content(url)#

Get the content of a URL.

Parameters:
urlstr

URL to get content from

Returns:
str

content of the URL

Raises:
ValueError

If the URL scheme is not http or https

ansys.fluent.core.utils.networking.is_localhost(ip)#

Check if the given ip address corresponds to localhost.

Parameters:
ipstr

The ip address to check.

Returns:
bool

True if the address corresponds to localhost, False otherwise.