curl --request POST \
--url https://api.sfcompute.com/v2/node_templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace": "<string>",
"image": "<string>",
"name": "my-resource-name",
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
}
'{
"id": "<string>",
"resource_path": "<string>",
"owner": "<string>",
"workspace": "<string>",
"name": "<string>",
"object": "node_template",
"image": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
"cloud_init_user_data_used": true,
"created_at": 1738972800,
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
}Create a reusable node configuration.
curl --request POST \
--url https://api.sfcompute.com/v2/node_templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace": "<string>",
"image": "<string>",
"name": "my-resource-name",
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
}
'{
"id": "<string>",
"resource_path": "<string>",
"owner": "<string>",
"workspace": "<string>",
"name": "<string>",
"object": "node_template",
"image": "image_k3R-nX9vLm7Qp2Yw5Jd8F",
"cloud_init_user_data_used": true,
"created_at": 1738972800,
"cloud_init_user_data": "IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
}Create an API token using sf tokens create or at https://sfcompute.com/account/api-keys.
Workspace to create this template in.
(wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})"wksp_k3R-nX9vLm7Qp2Yw5Jd8F"
Machine image to use when starting nodes with this template. Accepts name or ID.
(image_[0-9a-zA-Z_-]{1,21})|(sfc:image:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,3})"image_k3R-nX9vLm7Qp2Yw5Jd8F"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
Base64-encoded cloud-init user data. Maximum 64KB.
"IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="
Node template created.
ntmpl_[0-9a-zA-Z_-]{1,21}"ntmpl_k3R-nX9vLm7Qp2Yw5Jd8F"
A resource path for a node_template resource. Format: sfc:node_template:
sfc:node_template:([a-zA-Z0-9._-]+:){2}[a-zA-Z0-9._-]+"sfc:node_template:<account_id>:<workspace>:<name>"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
1 - 255[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}"my-resource-name"
"node_template"Machine image to use when starting nodes with this template.
image_[0-9a-zA-Z_-]{1,21}"image_k3R-nX9vLm7Qp2Yw5Jd8F"
Whether cloud-init user data is configured for this template.
Unix timestamp.
1738972800
Base64-encoded cloud-init user data.
"IyEvYmluL2Jhc2gKZWNobyBoZWxsbyB3b3JsZAo="