Post

Access Google's metadata

Access Google's metadata — practical walkthrough with examples.

Access Google's metadata

Access Google’s metadata

The following command queries the Google Cloud instance metadata server to retrieve the instance ID. This is useful when running on GCE VMs and you need to programmatically identify the current instance. The Metadata-Flavor: Google header is required by the metadata server.

1
curl http://metadata.google.internal/computeMetadata/v1/instance/id -H "Metadata-Flavor: Google"
This post is licensed under CC BY 4.0 by the author.