Templates

Get a template

One template, as the document it was written as — which is the half GET /templates drops: the lineage in spec.from, the build steps, and the digest.

Works for your own namespace and for system, so you can read what you are layering onto — though note that a document with spec.build steps or spec.env may only layer onto a system template, so reading your own is for inspecting it rather than for building on it. See POST /templates. Another account’s namespace is a 404, the same answer a name that does not exist gets.

Your account’s own namespace needs an account-wide key: an API key confined to a workspace is a 403 there, because the document is the account’s and may carry its build steps and scripts. It can still read system templates.

Without version this is the newest published version of that name — which is also what a create naming the unpinned namespace/name resolves to. versions lists the rest, newest first.

A ref you have RETIRED is still a 404 — there is no document to return — but the message names the date it went rather than telling you the template never existed. Same for a name whose every version has been retired.

Requires the member role or higher.

get/templates/{namespace}/{name}

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/templates/{namespace}/{name}
  • Auth: HTTP bearer

Path parameters

namespacestring required

Your account id, or system for the templates we publish.

namestring required

The template’s metadata.name — the part of the ref between the slash and the @.

Query parameters

versionstring

A specific MAJOR.MINOR.PATCH. Omit it for the newest. Sending it EMPTY or malformed is a 400 rather than a silent default — the same rule DELETE applies, where it matters much more.

Response

The template.

refstring

namespace/name@version. What you pass as template to create a computer.

doc_digeststring

Identifies the document, as sha256:…. Two publishes of the same digest are the same template, which is what makes republishing an unchanged document a no-op rather than a conflict.

documentobject

The document itself, in its canonical form — the bytes doc_digest is over. Key order and whitespace may differ from what you sent; nothing else does.

versionsstring[]

Every version of this template, newest first. Read one with ?version=.

published_atstring

RFC 3339 timestamp. Absent on a template we publish.

Changes

No recorded changes to this operation across all 1 revision of this API.