Scaleway logo
Instance API

User data is a key/value store you can use to provide your instance with introspective data.

As an example of use, Scaleway images contain the scw-generate-ssh-keys script, which generates the SSH server’s host keys, then stores their fingerprints as user data under the ssh-host-fingerprints key. This way, before connecting to the instance using SSH, one can query the fingerprints to ensure that the remote host is the expected one, thus avoiding any man-in-the-middle attack.

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-ecosystem package, installed by default on all OS images provided by Scaleway, ships with the scw-userdata helper 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-port option (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

GET
https://api.scaleway.com
/instance/v1/zones/{zone}/servers/{server_id}/user_data

List all user data keys registered on a specified Instance.

List user data › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
server_id
​string · required

UUID of the Instance.

List user data › Responses


Get user data

GET
https://api.scaleway.com
/instance/v1/zones/{zone}/servers/{server_id}/user_data/{key}

Get the content of a user data with the specified key on an Instance.

Get user data › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
server_id
​string · required

UUID of the Instance.

key
​string · required

Key of the user data to get.

Get user data › Responses

200
name
​string
content_type
​string
content
​string

Delete user data

DELETE
https://api.scaleway.com
/instance/v1/zones/{zone}/servers/{server_id}/user_data/{key}

Delete the specified key from an Instance's user data.

Delete user data › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
server_id
​string · required

UUID of the Instance.

key
​string · required

Key of the user data to delete.

Delete user data › Responses

No data returned

Add/set user data

PATCH
https://api.scaleway.com
/instance/v1/zones/{zone}/servers/{server_id}/user_data/{key}

Add or update a user data with the specified key on an Instance.

Add/set user data › path Parameters

zone
​string · enum · required

The zone you want to target

Enum values:
fr-par-1
fr-par-2
fr-par-3
nl-ams-1
nl-ams-2
nl-ams-3
pl-waw-1
pl-waw-2
server_id
​string · required

UUID of the Instance.

key
​string · required

Key of the user data to set.

Add/set user data › Request Body

string · binary

Add/set user data › Responses

No data returned