GCEMETADATA(1)
π°οΈ gcemetadata.1() β Query the Google Compute Engine Metadata Server π
β¨ NAME β¨
gcemetadata β query the Google Compute Engine metadata server. Lowkey a tiny icon, no cap. π«Ά
πΈ SYNOPSIS πΈ
gcemetadata [option]
π¦ DESCRIPTION π¦
Okay bestie, so gcemetadata is the little command that queries the Google Compute Engine metadata server. The available data is documented at https://cloud.google.com/compute/docs/storing-retrieving-metadata β go peek, iykyk. β¨
The command-line options this tool accepts are for the most part dynamically generated, so they literally change as more endpoints get added. The static command-line options are documented in this man page; the dynamic options are not documented here.
If you donβt specify any command-line options other than --output or --xml, the tool will display all information available. If you give any specific option, you must use the --query option as well. And if a specific query doesnβt produce any value, or the query results in an error, the data for the requested option will be set to unavailable. π
π OPTIONS π
-a,--apiβ specify the version of the metadata server API to use. π--helpβ print all available command-line options to standard out. π--identity-formatβ set the format for the identity token. Supported values arefullorstandard. This changes how much information is encoded in the identity token. The default value isstandard, which provides the smallest possible amount of information. π§--listapisβ list the available api versions. πΈ--outputβ write the requested information to the given file. π--queryβ specify whether to query theprojector theinstance; possible values areprojectorinstance. If any option other than--outputor--xmlis specified, the--queryoption is required. π--versionβ print the version of the tool. β--xmlβ tell the tool to produce XML snippets. Using this option produces information wrapped in tags that match the API endpoint option. For example, when querying the name of an instance with the--xmlflag set, the resulting output would be<name>my_instance_name</name>. π₯
π EXAMPLES π
gcemetadata --query project --project-id
Will print the name of the project the instance is running in. Slay. π
gcemetadata --query instance --netid 0 --external-ip
Will print the external IPv4 address of the instance. β¨
π CAVEAT π
Okay so hereβs the caveat, bestie: when youβre requesting all possible information β i.e. no argument, or only--outputand/or--xmlare given β the identity information in the resulting output will be shown asunavailable. The reason is that a valid identifier for the identity token generation is not known, and thus no valid token can be generated. No cap, that part matters. π
π AUTHOR π
Robert Schweikert (rjschwei@suse.com) π«Ά
π bye bestie β this was gcemetadata.1(), and the footer has no extra source/version/date info beyond that manual-page name. Slay. π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: python-gcemetadata 1.1.2-160000.1.1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms