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.
Base URL
All requests use the following base URL:
This is a link-local address that is only reachable from within the server itself. It is not accessible from the public internet.
Authentication
The metadata service uses token-based authentication (IMDSv2-style). Before making any metadata requests, you must obtain a session token.
Requesting a token
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.
Use the returned token in the X-Metadata-Token header for all subsequent metadata requests.
To retrieve all metadata as a single JSON object, send a GET request to /metadata/v1/metadata.json:
Example response:
You can query individual metadata fields by appending the field path to the base URL. Each path returns a plain-text value or a JSON fragment.
Available paths
Examples
Get the server hostname:
Get the public IPv4 address:
Get the network configuration:
Response schema
Top-level fields
network object
The network object contains the server’s network interfaces and DNS configuration.
network.interfaces[]
network.interfaces[].addresses[]
network.dns
storage object
storage.disks[]
vendor object
vendor.latitude
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.