Scroll to navigation

gcemetadata.1() gcemetadata.1()

NAME

gcemetadata - Query the Google Compute Engine metadata server

SYNOPSIS

gcemetadata [option]

DESCRIPTION

gcemetadata is used to query the Google Compute Engine metadata server. The available data is documented at https://cloud.google.com/compute/docs/storing-retrieving-metadata . The command line options the tool accepts are for the most part dynamically generated and therefore will change as more endpoints are added. The static command line options are documented in this man page while the dynamic options are not documented here. The tool will display all information available if no command line options other than --output or --xml are specified. If any specific option is given the --query option must be used as well. If a specific query does not produce any value or the query results in an error the data for the requested option will be set to unavailable.

OPTIONS

Specify the version of the metadata server API to use.
Print all available command line options to standard out.
Set the format for the identity token. Supported values are full or standard. This changes the amount of information encoded in the identity token. The default value is standard , providing the smallest possible amount of information.
List the available api versions.
Write the requested information to the given file.
Specify whether to query the project or the instance, possible values are project or instance. If any option, other than --output or --xml is specified the --query option is required.
Print the version of the tool.
Specify that the tool should produce XML snippets. Using this option produces information that is wrapped in tags that match the API endpoint option. For example when querying the name of an instance with the --xml flag 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.

gcemetadata --query instance --netid 0 --external-ip

Will print the external IPv4 address of the instance.

CAVEAT

When requesting all possible information, i.e no argument or only --output and/or --xml are given the identity information in the resulting output will be shown as unavailable. The reason is that a valid identifier for the identity token generation is not know and thus no valid token can be generated.

AUTHOR

Robert Schweikert (rjschwei@suse.com)