Are you asking for an API endpoint to fetch the IP address of a machine, or to somehow "fetch" it from inside a VM?
The former is possible with a DDI solution, anything beyond that will require the installation of some form of agent on the VM itself to discover that address.