Create a Userdata Script
- Name
post- Type
- /v1/userdata
- Description
Send a
POSTrequest to creata a userdata script.
Request
Required Attributes
- Name
name- Type
- string
- Description
Userdate script new name given by the user at its creation.
- Name
userdata- Type
- string
- Description
The
user datais the script used by the user to configure the Stacklet on first boot, often acloud-configfile or Bash script. It must be plain text and may not exceed 64 kilobytes in size.
Example
curl -X POST "https://api.simplystack.com/v1/userdata" \
-H "Content-Type: application/json" \
-H "Authorization: Token d359ad9cc9422b5ff07aede0cd2707da4ff82be0" \
-d '{"name": "script01", "userdata": "#!/bin/sh\necho "Hello World. The time is now $(date -R)!" | tee /root/output.txt"}" }'Response
JSON object with a key named userdata which is an array of the following attributes:
Attributes
Example
json
{
"userdata": {
"uuid": "69604814-f02f-4978-8c90-4a0957889218",
"name": "script01",
"userdata": "#!/bin/sh\necho "Hello World. The time is now $(date -R)!" | tee /root/output.txt",
"created_at": "2021-02-01T12:14:47.134880Z"
}
}