import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.user_data.post_user_data(data={
"type": latitudesh_python_sdk.PostUserDataUserDataType.USER_DATA,
"attributes": {
"description": "User Data description",
"project": "proj_QraYDPW3qpjwW",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
})
# Handle response
print(res){
"data": {
"id": "ud_w49QDB55qagKb",
"type": "user_data",
"attributes": {
"description": "User Data description",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
"created_at": "2026-01-14T15:57:11+00:00",
"updated_at": "2026-01-14T15:57:11+00:00",
"decoded_content": "#cloud-config\nruncmd:\n - [ touch, /home/ubuntu/test ]",
"project": {
"id": "proj_QraYDPW3qpjwW",
"name": "Rustic Granite Gloves",
"slug": "rustic-granite-gloves",
"description": "Heavy Duty Leather Wallet",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
}
}
},
"meta": {}
}Allows you to create User Data in a team, which can be used to perform custom setup on your servers after deploy and reinstall.
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.user_data.post_user_data(data={
"type": latitudesh_python_sdk.PostUserDataUserDataType.USER_DATA,
"attributes": {
"description": "User Data description",
"project": "proj_QraYDPW3qpjwW",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
})
# Handle response
print(res){
"data": {
"id": "ud_w49QDB55qagKb",
"type": "user_data",
"attributes": {
"description": "User Data description",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
"created_at": "2026-01-14T15:57:11+00:00",
"updated_at": "2026-01-14T15:57:11+00:00",
"decoded_content": "#cloud-config\nruncmd:\n - [ touch, /home/ubuntu/test ]",
"project": {
"id": "proj_QraYDPW3qpjwW",
"name": "Rustic Granite Gloves",
"slug": "rustic-granite-gloves",
"description": "Heavy Duty Leather Wallet",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
}
}
},
"meta": {}
}Was this page helpful?