User Data
User data is a key/value store you can use to provide your Instance with introspective data.
There are two ways of accessing user data:
- From within a running Instance, by requesting the Metadata API at http://169.254.42.42/user_dataOpen in new context (or http://[fd00:42::42]/user_data using IPv6).
The
scaleway-ecosystempackage, installed by default on all OS images provided by Scaleway, ships with thescw-userdatahelper command that allows you to easily query the user data from the Instance. For security reasons, viewing and editing user data is only allowed to queries originating from a port below 1024 (by default, only the super-user can bind to ports below 1024). To specify the source port with cURL, use the--local-portoption (e.g.curl --local-port 1-1023 http://169.254.42.42/user_data). - From the Instance API by using the methods described below.
List user data keys
List all user data keys registered on a specified Instance.
path Parameters
zoneThe zone you want to target
server_idThe ID of the server.
query Parameters
page_tokenPage token for pagination.
page_sizeNumber of items to return per page.
List user data keys › Responses
keysList of user data keys.
next_page_tokenToken for the next page.
total_countTotal number of items.
Get user data
Get the content of a user data with a specified key on an Instance.
path Parameters
zoneThe zone you want to target
server_idThe ID of the server.
keyThe key of the user data to retrieve.
Get user data › Responses
keyThe key of the user data.
contentThe content of the user data.
Add/set user data
Add or update a user data with a specified key on an Instance.
path Parameters
zoneThe zone you want to target
server_idThe ID of the server.
keyThe key of the user data to set.
Add/set user data › Responses
Delete user data
Delete a specified key from an Instance's user data.
path Parameters
zoneThe zone you want to target
server_idThe ID of the server.
keyThe key of the user data to delete.
Delete user data › Responses
Get cloud-init user data
Get the cloud-init configuration of a specified Instance.
path Parameters
zoneThe zone you want to target
server_idThe ID of the server.
Get cloud-init user data › Responses
keyThe key of the user data.
contentThe content of the user data.
Set cloud-init user data
Set the cloud-init configuration for a specified Instance.
path Parameters
zoneThe zone you want to target
server_idThe ID of the server.