Article

Table of Contents
Theme:
Was this article helpful?

1  out of  2 found this helpful

Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $300 by adding new articles!

Manage Instance User Data with the Vultr Metadata API

Last Updated: Thu, Oct 22, 2020
FAQ

Introduction

You can create user data for startup scripts with the Vultr Metadata API when deploying a new instance. You can also update running instances. User data values are Base64 encoded.

Set User Data

To set user data with the Metadata API, use the /v1/server/set_user_data endpoint.

$ curl https://api.vultr.com/v1/server/set_user_data \
    -H 'API-Key: YOUR_API_KEY' \
    --data 'SUBID=YOUR_SUB_ID' \
    --data 'userdata=QmUgU3VyZSBUbyBEcmluayBZb3VyIE92YWx0aW5lLgo='

Retrieve User Data

To retrieve the user data, use the /latest/user-data endpoint. The Base64 encoded value is decoded and returned as text.

# curl http://169.254.169.254/latest/user-data
Be Sure To Drink Your Ovaltine.

If you update a running instance, /latest/user-data will return old values until the instance is rebooted or reinstalled.

Want to contribute?

You could earn up to $300 by adding new articles