Getting the IP Address of each Server Connected to a VMS?
AnsweredHi there,
For non-cloud users we were wanting to get the IP address of each individual server associated with a VMS, and we tried using the getMediaServersEx "networkAddresses" field in order to find it. However, we have a VMS with only one subserver but this field is giving us 3 different IPs in the following format: <IPv4>;<IPv6>;<IPv4>;<IPv6>;<IP address of the VMS server>. We weren't sure how to interpret the first two sets of IPs since this is a single-server case? Also wanted to make sure this is the right way to find this information?
Thanks for your help!
-
Hello,
If you're using v 4.2 we encourage you to upgrade to the latest v5.1
The latest API you need is /rest/v2/servers, the "endpoints" array in the response.
-
Andrey Terentyev Thanks for the quick reply! We tested with this API on a VMS that has 3 servers, and this field provided us with 4 IP addresses: <private IPv4><IPv6><IPv6><public IPv4>. How should I interpret this response? I also am getting different orders of IPv4/IPv6 for different VMS's as well.
-
Andrey Terentyev These are all automated processes on our end using code, so we are wondering if there is a way to parse these responses in a more programmatic/structured way?
-
Dylan,
As you can see, a response is a JSON object. You can use any language you prefer for parsing responses.
Here are some examples in python
https://github.com/networkoptix/nx_open_integrations/tree/master/python/examples
-
Andrey Terentyev Using python to parse a JSON isn't the issue (already have experience with that), but I'm wondering how to interpret this response because it seems to coming in random orders of IPv4s and IPv6s and is unclear what each address corresponds to? And we cannot use the GUI client for this because we are writing code
-
The "endpoints" section contains the address (IPv4 and IPv6) the Server listens at, including the external address if the Server is behind NAT. In other words, each ip address in the list corrsponds to the IP address in the OS the Server runs. You can run
In Linux
ip address show
In Windows
ipconfig /all
and compare the addreses with the address in the list returned by API/
Please sign in to leave a comment.
Comments
7 comments