1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2026-06-21 00:07:16 +03:00
tiny-cloud/docs/imds.1.scd
2026-06-15 14:48:45 +00:00

142 lines
3.0 KiB
Markdown

IMDS(1)
# NAME
imds - query instance metadata
# SYNOPSIS
*imds* [*-h*|*--help*] { *-e* | *+e* | *-E* | *+E* | *+n* | *+s* | *+t* | *@alias* | _imds-path_ } ...
# DESCRIPTION
*imds* queries the instance metadata service used by the current cloud
provider. It loads cloud-specific metadata conventions from tiny-cloud's
provider library and prints the requested metadata values to standard output.
Arguments are processed from left to right. Output control tokens may be mixed
with metadata queries in a single invocation.
# OPTIONS
*-h*, *--help*
Show a short usage summary and exit.
*-e*
Ignore errors from subsequent metadata queries.
*+e*
Return to the default behavior of stopping on query errors.
*-E*
Hide standard error from subsequent metadata queries.
*+E*
Return to the default behavior of showing standard error.
*+n*
Write a newline to standard output.
*+s*
Write a space to standard output.
*+t*
Write a tab to standard output.
# ALIASES
*@hostname*
Print the instance hostname.
*@local-hostname*
Print the local hostname.
*@ssh-keys*
Print SSH public keys associated with the instance.
*@userdata*
Print instance user data.
*@nics*
Print the provider-specific list of network interfaces.
*@nic:*<iface>[,<nic-key> ...]
Query metadata for a specific network interface. The interface is looked up by
its local link-layer address, then one or more NIC-specific keys are resolved.
# NIC KEYS
The following aliases are accepted after *@nic:*<iface>:
*@mac*
Print the interface MAC address as exposed by the metadata service.
*@ipv4*
Print IPv4 address data for the interface.
*@ipv6*
Print IPv6 address data for the interface.
*@ipv4-net*
Print IPv4 subnet information for the interface.
*@ipv6-net*
Print IPv6 subnet information for the interface.
*@ipv4-prefix*
Print delegated IPv4 prefix information for the interface.
*@ipv6-prefix*
Print delegated IPv6 prefix information for the interface.
In addition to these aliases, raw provider-specific metadata paths may be used.
The output control tokens *-e*, *+e*, *+n*, *+s*, and *+t* are also accepted
inside *@nic:* queries.
# ENVIRONMENT
*CLOUD*
Cloud provider name. When set to *auto*, the autodetected provider is used.
*IMDS_ENDPOINT*
Single provider metadata endpoint. Used as the default value for
*IMDS_ENDPOINTS*.
*IMDS_ENDPOINTS*
Whitespace-separated provider metadata endpoint list. IPv6 endpoints must use
brackets, for example *[fd00:ec2::254]*.
*IMDS_ENDPOINT_WAIT_ATTEMPTS*
Number of times to check for routes to any IMDS endpoint before trying
metadata requests anyway. The default is *10*.
# EXIT STATUS
*0*
All requested operations succeeded.
*1*
A query failed and error handling was enabled.
# EXAMPLES
Print the instance hostname:
$ imds @hostname
Print user data and terminate with a newline:
$ imds @userdata +n
Print IPv4 and IPv6 metadata for interface _eth1_:
$ imds @nic:eth1,@ipv4,@ipv6
Query a raw metadata path:
$ imds meta-data/hostname
# SEE ALSO
*tiny-cloud*(8)