GCP/Metadata service
< GCP
Jump to navigation
Jump to search
Revision as of 21:52, 30 January 2023 by Pio2pio (talk | contribs) (→Programmatically query metadata)
Programmatically query metadata
# Query the boot image for the VM curl "http://metadata.google.internal/computeMetadata/v1/instance/image" -H "Metadata-Flavor: Google" # Query metadata directory listings. Any metadata entry ending in a trailing slash is a directory. curl "http://metadata.google.internal/computeMetadata/v1/instance/" -H "Metadata-Flavor: Google" attributes/ cpu-platform description disks/ guest-attributes/ hostname id image licenses/ machine-type maintenance-event name network-interfaces/ preempted remaining-cpu-time scheduling/ service-accounts/ tags virtual-clock/ zone