Querying the network interface will only return the internal instance IP address info.
Is it possible to get external IP address info from somewhere inside the running instance?
As an example, AWS has a metadata REST endpoint for instance info:curl http://169.254.169.254/latest/meta-data/public-ipv4
(source: http://tech-queries.blogspot.co.uk/2011/06/how-to-get-public-ip-for-amazon-ec2.html)
curl -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip
– Cloud66curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip
see: cloud.google.com/compute/docs/… – Andy H.