curl -H Metadata:true \ "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/publicIpAddress?api-version=2017-08-01&format=text"
BTW. The same method allows to get a private IP address.
curl -H Metadata:true \ "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-08-01&format=text"
No comments:
Post a Comment