The Vultr Metadata API is a service available to all Vultr cloud servers and allows any instance to query information about itself. With additional scripting, this service enables developers to create self-configuring instances. The API functions described in this document will only return information about the calling instance.
HTTP Response Code | Description |
---|---|
200 | Function successfully executed. |
404 | Invalid location. Check the URL that you are using. |
405 | Invalid HTTP method. Check that the method (POST|GET) matches what the documentation indicates. |
500 | Internal server error. Try again at a later time. |
503 | Service is currently unavailable. Try your request again later. |
/v1.json
Retrieve the entire metadata tree as a JSON document.
curl http://169.254.169.254/v1.json
{
"bgp": {
"ipv4": {
"my-address": "192.0.2.2",
"my-asn": "64496",
"peer-address": "169.254.169.254",
"peer-asn": "64515"
},
"ipv6": {
"my-address": "2001:0db8:7400:7ccf:5428:d5ff:fe28:1910",
"my-asn": "64496",
"peer-address": "2001:19f0:ffff::1",
"peer-asn": "64515"
}
},
"hostname": "vultr-guest",
"instanceid": "a747bfz6385e",
"instance-v2-id": "36e9cf60-5d93-4e31-8ebf-613b3d2874fb",
"interfaces": [{
"ipv4": {
"additional": [{
"address": "192.0.2.3",
"netmask": "255.255.255.0"
}],
"address": "192.0.2.2",
"gateway": "192.0.2.1",
"netmask": "255.255.255.0"
},
"ipv6": {
"additional": [{
"network": "2001:0db8:0:2::",
"prefix": "64"
}],
"address": "2001:0db8:0:1:5428:d5ff:fe28:1910",
"network": "2001:0db8:0:1::",
"prefix": "64"
},
"mac": "00:00:00:00:00:00",
"network-type": "public"
},
{
"ipv4": {
"additional": [],
"address": "10.99.0.10",
"gateway": "",
"netmask": "255.255.0.0"
},
"ipv6": {
"additional": [],
"network": "",
"prefix": ""
},
"mac": "00:00:00:00:00:01",
"network-type": "private",
"networkid": "net59a077ae437d8",
"network-v2-id": "742a1cc0-92da-4620-b875-2c8d5e040cba"
}],
"public-keys": ["ssh-rsa dGhpcyBpcyBhIHNhbXBsZSBzc2gga2V5IHRoaXMgaXMgYSBzYW1wbGUgc3NoIGtleSB0aGlzIGlzIGEgc2FtcGxlIHNzaCBrZXk= root@example1\nssh-rsa dGhpcyBpcyBhIHNhbXBsZSBzc2gga2V5IHRoaXMgaXMgYSBzYW1wbGUgc3NoIGtleSB0aGlzIGlzIGEgc2FtcGxlIHNzaCBrZXk= root@example2"],
"region": {
"regioncode": "EWR",
"countrycode": "US"
},
"nvidia-driver": 470.82
}
/v1/
Retrieve the metadata index.
curl http://169.254.169.254/v1/
hostname
instanceid
instance-v2-id
public-keys
/v1/hostname
Retrieve the default hostname of the calling VM.
curl http://169.254.169.254/v1/hostname
vultr-guest
/v1/instanceid
Retrieve the instance ID of the calling VM. This was formerly known as "SUBID".
curl http://169.254.169.254/v1/instanceid
a747bfz6385e
/v1/instance-v2-id
Retrieve the v2 instance id of the calling VM.
curl http://169.254.169.254/v1/instance-v2-id
36e9cf60-5d93-4e31-8ebf-613b3d2874fb
/v1/public-keys
Retrieve the default public SSH keys installed on the calling VM.
curl http://169.254.169.254/v1/public-keys
ssh-rsa dGhpcyBpcyBhIHNhbXBsZSBzc2gga2V5IHRoaXMgaXMgYSBzYW1wbGUgc3NoIGtleSB0aGlzIGlzIGEgc2FtcGxlIHNzaCBrZXk= root@example1
ssh-rsa dGhpcyBpcyBhIHNhbXBsZSBzc2gga2V5IHRoaXMgaXMgYSBzYW1wbGUgc3NoIGtleSB0aGlzIGlzIGEgc2FtcGxlIHNzaCBrZXk= root@example2
/v1/nvidia-driver
Retrieve the NVidia Driver version running on the host.
curl http://169.254.169.254/v1/nvidia-driver
470.82
/v1/bgp/
Retrieve the BGP index.
curl http://169.254.169.254/v1/bgp/
ipv4/
ipv6/
/v1/bgp/ipv4/
Retrieve the BGP IPv4 index.
curl http://169.254.169.254/v1/bgp/ipv4/
peer-address
peer-asn
my-address
my-asn
/v1/bgp/ipv4/peer-address
Retrieve the BGP IPv4 address of the peer (Vultr).
curl http://169.254.169.254/v1/bgp/ipv4/peer-address
169.254.169.254
/v1/bgp/ipv4/peer-asn
Retrieve the BGP ASN of the peer (Vultr).
curl http://169.254.169.254/v1/bgp/ipv4/peer-asn
64515
/v1/bgp/ipv4/my-address
Retrieve the BGP IPv4 address of the calling VM.
curl http://169.254.169.254/v1/bgp/ipv4/my-address
192.0.2.2
/v1/bgp/ipv4/my-asn
Retrieve the BGP ASN of the calling VM.
curl http://169.254.169.254/v1/bgp/ipv4/my-asn
64496
/v1/bgp/ipv6/
Retrieve the BGP IPv6 index.
curl http://169.254.169.254/v1/bgp/ipv6/
peer-address
peer-asn
my-address
my-asn
/v1/bgp/ipv6/peer-address
Retrieve the BGP IPv6 address of the peer (Vultr).
curl http://169.254.169.254/v1/bgp/ipv6/peer-address
2001:19f0:ffff::1
/v1/bgp/ipv6/peer-asn
Retrieve the BGP ASN of the peer (Vultr).
curl http://169.254.169.254/v1/bgp/ipv6/peer-asn
64515
/v1/bgp/ipv6/my-address
Retrieve the BGP IPv6 address of the calling VM.
curl http://169.254.169.254/v1/bgp/ipv6/my-address
2001:0db8:7400:7ccf:5428:d5ff:fe28:1910
/v1/bgp/ipv6/my-asn
Retrieve the BGP ASN of the calling VM.
curl http://169.254.169.254/v1/bgp/ipv6/my-asn
64496
/v1/interfaces/
Retrieve the interface index.
curl http://169.254.169.254/v1/interfaces/
0/
1/
/v1/interfaces/0/
Retrieve the index of the specified network interface. The first interface is labeled with "0", counting onward for subsequent interfaces.
curl http://169.254.169.254/v1/interfaces/0/
network-type
mac
ipv4/
ipv6/
/v1/interfaces/0/network-type
Retrieve the network type of the specified interface. The value can be one of: "public", "private".
curl http://169.254.169.254/v1/interfaces/0/network-type
public
/v1/interfaces/0/mac
Retrieve the mac address of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/mac
00:00:00:00:00:00
/v1/interfaces/0/networkid
For private networks, retrieve the NETWORKID of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/networkid
net59a077ae437d8
/v1/interfaces/0/network-v2-id
For private networks, retrieve the network's v2 ID of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/network-v2-id
742a1cc0-92da-4620-b875-2c8d5e040cba
/v1/interfaces/0/ipv4/
Retrieve the IPv4 index of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/ipv4/
address
gateway
netmask
additional/
/v1/interfaces/0/ipv4/address
Retrieve the IPv4 address of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/ipv4/address
192.0.2.2
/v1/interfaces/0/ipv4/gateway
Retrieve the IPv4 gateway of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/ipv4/gateway
192.0.2.1
/v1/interfaces/0/ipv4/netmask
Retrieve the IPv4 netmask of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/ipv4/netmask
255.255.255.0
/v1/interfaces/0/ipv4/additional/
Retrieve a list of additional IPv4 addresses available to the specified network interface. The first address is labeled with "0", counting onward for subsequent addresses.
curl http://169.254.169.254/v1/interfaces/0/ipv4/additional/
0/
/v1/interfaces/0/ipv4/additional/0/
Retrieve the index of the specified IPv4 address for a given network interface. This index does not include the main IPv4 address.
curl http://169.254.169.254/v1/interfaces/0/ipv4/additional/0/
address
netmask
/v1/interfaces/0/ipv4/additional/0/address
Retrieve the address of an additional IPv4.
curl http://169.254.169.254/v1/interfaces/0/ipv4/additional/0/address
192.0.2.3
/v1/interfaces/0/ipv4/additional/0/netmask
Retrieve the netmask of an additional IPv4.
curl http://169.254.169.254/v1/interfaces/0/ipv4/additional/0/netmask
255.255.255.0
/v1/interfaces/0/ipv6/
Retrieve the IPv6 index of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/ipv6/
network
prefix
additional/
/v1/interfaces/0/ipv6/address
Retrieve the default IPv6 address of the specified network interface. You can use any address within the block, this address is only a suggestion.
curl http://169.254.169.254/v1/interfaces/0/ipv6/address
2001:0db8:0:1:5428:d5ff:fe28:1910
/v1/interfaces/0/ipv6/network
Retrieve the IPv6 network of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/ipv6/network
2001:0db8:0:1::
/v1/interfaces/0/ipv6/prefix
Retrieve the IPv6 prefix of the specified network interface.
curl http://169.254.169.254/v1/interfaces/0/ipv6/prefix
64
/v1/interfaces/0/ipv6/additional/
Retrieve a list of additional IPv6 networks available to the specified network interface. The first network is labeled with "0", counting onward for subsequent networks.
curl http://169.254.169.254/v1/interfaces/0/ipv6/additional/
0/
/v1/interfaces/0/ipv6/additional/0/
Retrieve the index of the specified IPv6 network for a given network interface. This index does not include the main IPv6 network.
curl http://169.254.169.254/v1/interfaces/0/ipv6/additional/0/
network
prefix
/v1/interfaces/0/ipv6/additional/0/network
Retrieve the network of an additional IPv6.
curl http://169.254.169.254/v1/interfaces/0/ipv6/additional/0/network
2001:0db8:0:2::
/v1/interfaces/0/ipv6/additional/0/prefix
Retrieve the prefix of an additional IPv6.
curl http://169.254.169.254/v1/interfaces/0/ipv6/additional/0/prefix
64
/v1/region/
Retrieve the region index.
curl http://169.254.169.254/v1/region/
regioncode
countrycode
/v1/region/regioncode
Retrieve the region code of the calling VM.
curl http://169.254.169.254/v1/region/regioncode
EWR
/v1/region/countrycode
Retrieve the country code of the calling VM.
curl http://169.254.169.254/v1/region/countrycode
US