Complete reference for the instance metadata service available from within Latitude.sh bare metal servers
The instance metadata service is a link-local HTTP API available from within any running Latitude.sh bare metal server. It allows your server to query its own metadata — hostname, IP addresses, network configuration, storage layout, tags, and more — without needing external API credentials.
The instance metadata service is not part of the main Latitude.sh REST API. It uses its own token-based authentication and is only accessible from within a bare metal server. Your regular API keys will not work with this service.
The metadata service is not yet available in the SAO and SAN3 regions. Support for these regions will be added in a future update.
Make a PUT request to the token endpoint with a TTL (time-to-live) header specifying how long the token should be valid, in seconds.Response body:The session token is returned as plain text in the response body.
Header
Description
X-Metadata-Token
The session token to use in subsequent requests.
TOKEN=$(curl -s -X PUT "http://169.254.169.254/metadata/v1/api/token" \ -H "X-Metadata-Token-TTL-Seconds: 3600")
Use the returned token in the X-Metadata-Token header for all subsequent metadata requests.
You can use the metadata service together with user data to automatically configure your servers at boot — for example, setting up network interfaces or registering the server in a service discovery system.