Templates
Publish a template as an organization version, list versions and promote one for a repository pattern.
List template versions
The organisation's template versions, newest first, each with the repository patterns it is active for.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | Optional | |
limit | integer | Optional | |
template | string | Optional |
Response
datadata[].active_for- the patterns this version is active for: * or repositories
data[].id- devtv_<uuidv7> behind the cell that minted it
data[].images- the template's pinned images
data[].parameters- the template's parameters in its order; empty for a version published before dev-api kept them
data[].parameters[].defaultdata[].parameters[].descriptiondata[].parameters[].max- number only
data[].parameters[].min- number only
data[].parameters[].mutable- true: a person's dev up with another value recreates the session; false: only dev up --recreate takes another value
data[].parameters[].namedata[].parameters[].options- choice only
data[].parameters[].type- string: at most 256 characters, no control character; number: a whole number within min and max; bool: true or false; choice: one of optionsOne of
string,number,bool,choice data[].presetsdata[].presets[].descriptiondata[].presets[].namedata[].presets[].valuesdata[].published_atdata[].published_bydata[].templatedata[].template_digesthas_morenext_cursor
curl "$CIRESK_API/v1/dev/templates" \
-H "Authorization: Bearer $CIRESK_KEY"Publish a template version
Publish one template of a dev file as an organisation template version.
Stores the template's name, the dev file's digest and the template's pinned images as an immutable version of the organisation. The file is parsed and the named template validated first (422 template_invalid with the findings). Publishing a name and digest already published answers that version with 200.
Request body
templatetemplate_b64- the dev file's bytes
template_digest
Response
active_for- the patterns this version is active for: * or repositories
id- devtv_<uuidv7> behind the cell that minted it
images- the template's pinned images
parameters- the template's parameters in its order; empty for a version published before dev-api kept them
parameters[].defaultparameters[].descriptionparameters[].max- number only
parameters[].min- number only
parameters[].mutable- true: a person's dev up with another value recreates the session; false: only dev up --recreate takes another value
parameters[].nameparameters[].options- choice only
parameters[].type- string: at most 256 characters, no control character; number: a whole number within min and max; bool: true or false; choice: one of optionsOne of
string,number,bool,choice presetspresets[].descriptionpresets[].namepresets[].valuespublished_atpublished_bytemplatetemplate_digest
curl -X POST "$CIRESK_API/v1/dev/templates" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "platform",
"template_b64": "dmVyc2lvbjogMQp0ZW1wbGF0ZXM6CiAgcGxhdGZvcm06IHt9Cg==",
"template_digest": "sha256:594a7fce866c492eace239ff639d9cc6cec7df777c152af6729dbae01dba6e91"
}'Promote a template version
Make a version the active one of its template for a repository pattern.
One active version per (pattern, template name): a promotion replaces the earlier one and its record holds both. The pattern is * (every repository) or one repository, as a remote url or normalised (github.com/acme/app); the repository's own promotion wins over *. Under the policy's templates: published, dev up admits only the active version.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
version_id | string | Required | The version's ID. |
Request body
repository- * or one repository: a remote url or its normalised form (github.com/acme/app)
Response
promoted_atpromoted_byreplaced- the version that was active for this pattern before
repository- * or the normalised repository
templateversion_id
curl -X POST "$CIRESK_API/v1/dev/templates/6bef13d5-0ba2-41c4-9426-a06a581b7d2c/promote" \
-H "Authorization: Bearer $CIRESK_KEY" \
-H "Content-Type: application/json" \
-d '{
"repository": "acme/platform"
}'