IP Address Functions
All functions support both IPv4 and IPv6. The results from some functions may however depend on the underlying system configuration.
The following functions for IP Address described here are:
getHostname
Returns the fully qualified domain name of the host on which the workflow is active. This is the best effort method, meaning we may not be able to return the FQDN depending on the underlying system configuration.
string getHostname()
Parameter | Description |
---|---|
Parameters: | None. |
Returns | The hostname as a string. |
getIPAddress
Returns the IP address of the local host.
string getIPAddress()
Parameter | Description |
---|---|
Parameters: | None |
Returns | The raw IP address as a string |
ipAddressString
Extracts the IP address part from a variable of type ipaddress.
string ipAddressString(ipaddress ipa )
Parameter | Description |
---|---|
| An IP address |
Returns | The IP address as a string, e g "10.0.3.22" |
ipFromAddress
Converts the bytearray representation into an ipaddress type. Refer to Data types for further information about ipaddress type.
ipaddress ipFromAddress ( bytearray address )
Parameter | Description |
---|---|
| The IP address as a bytearray. IPv4 address bytearray must be 4 bytes long and IPv6 bytearray must be 16 bytes long. |
Returns | The IP address as an ipaddress type. |
ipFromHostname
Given a string containing the IP address (numerical presentation), or hostname, a variable of type ipaddress is returned.
Note!
This function can be time consuming if DNS has to be accessed.
ipaddress ipFromHostname ( string host )
Parameter | Description |
---|---|
| The name of the host |
Returns | The IP address provided by the DNS server |
ipIsV6Address
Evaluate if the IP address represents an IPv6 address.
boolean ipIsV6Address()(ipaddress ipa )
Parameters:
Parameter | Description |
---|---|
| The IP address to evaluate |
Returns |
|
ipLocalHost
Returns the IP address of the local host.
ipaddress ipLocalHost()
Parameter | Description |
---|---|
Returns | The IP address of the local host |
ipToAddress
Returns the numerical representation of an IP address for example (10.0.3.22) as elements of a bytearray.
bytearray ipToAddress ( ipaddress ipa )
Parameter | Description |
---|---|
| An IP address |
Returns | A bytearray representation of the IP address; for example [ 10 0 3 22 ]. |
ipToHostname
Extracts the fully qualified domain name part from a variable of type ipaddress. The host running the EC must have DNS setup. Note that this method may be time consuming.
string ipToHostname( ipaddress ipa )
Parameter | Description |
---|---|
| An IP address. |
Returns | The hostname corresponding to the given IP address. |