Scaleway logo
Instance API

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-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 keys

GET
https://api.scaleway.com
/instance/v2alpha1/zones/{zone}/servers/{server_id}/user-data

List all user data keys registered on a specified Instance.

List user data keys › 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

The ID of the server.

List user data keys › query Parameters

page_token
​string

Page token for pagination.

page_size
​integer · uint32

Number of items to return per page.

List user data keys › Responses

200
keys
​string[]

List of user data keys.

next_page_token
​string | null

Token for the next page.

total_count
​integer · uint64

Total number of items.


Get user data

GET
https://api.scaleway.com
/instance/v2alpha1/zones/{zone}/servers/{server_id}/user-data/{key}

Get the content of a user data with a 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

The ID of the server.

key
​string · required

The key of the user data to retrieve.

Get user data › Responses

200
key
​string

The key of the user data.

content
​string

The content of the user data.


Add/set user data

PUT
https://api.scaleway.com
/instance/v2alpha1/zones/{zone}/servers/{server_id}/user-data/{key}

Add or update a user data with a 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

The ID of the server.

key
​string · required

The key of the user data to set.

Add/set user data › Request Body

content
​string

The content to set for the user data.

Add/set user data › Responses

No data returned

Delete user data

DELETE
https://api.scaleway.com
/instance/v2alpha1/zones/{zone}/servers/{server_id}/user-data/{key}

Delete a 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

The ID of the server.

key
​string · required

The key of the user data to delete.

Delete user data › Responses

No data returned

Get cloud-init user data

GET
https://api.scaleway.com
/instance/v2alpha1/zones/{zone}/servers/{server_id}/user-data/cloud-init

Get the cloud-init configuration of a specified Instance.

Get cloud-init 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

The ID of the server.

Get cloud-init user data › Responses

200
key
​string

The key of the user data.

content
​string

The content of the user data.


Set cloud-init user data

PUT
https://api.scaleway.com
/instance/v2alpha1/zones/{zone}/servers/{server_id}/user-data/cloud-init

Set the cloud-init configuration for a specified Instance.

Set cloud-init 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

The ID of the server.

Set cloud-init user data › Request Body

content
​string

The cloud-init configuration content.

Set cloud-init user data › Responses

No data returned