Created
February 5, 2020 06:47
-
-
Save Matrix7867/3ed85cc91d0ebf2fed65946894d43755 to your computer and use it in GitHub Desktop.
Getting hostname from GCP instance via curl into metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Getting hostname of the instance via Metadata | |
curl http://metadata.google.internal/computeMetadata/v1/instance/hostname -H "Metadata-Flavor: Google" | |
#Getting ID of the instance | |
curl http://metadata.google.internal/computeMetadata/v1/instance/id -H "Metadata-Flavor: Google" | |
#Getting Instance-name via Metadata | |
curl http://metadata.google.internal/computeMetadata/v1/instance/name -H "Metadata-Flavor: Google" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment