Skip to content

Install a realm

POST
/api/v1/realms
curl --request POST \
--url http://localhost:11044/api/v1/realms \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "confirmed": true, "path": "example", "ref": "example", "repo": "example" }'

Installs a realm by cloning a git repository into the world. Use owner/repo shorthand for GitHub repos, or a full URL. Optionally specify a branch or commit SHA via the ref field. With realm admission on, installing also approves the realm’s handlers and browser apps; admission in the response says whether it did: admitted, unchanged, not-admitted, declarative (no WASM program, so it loads from its directory) or off.

Where the realm comes from: either repo, an owner/repo GitHub shorthand or a git URL (https://, git@, file://), cloned into the world under the repository’s name, with an optional ref branch or commit to check out; or path, a realm directory already mounted into the appliance, loaded in place under its directory name with nothing cloned or copied. path wins when both are given, and ref and confirmed are ignored with it. On a repo install, confirmed: true is the user’s explicit go-ahead for an experimental realm, which is otherwise refused with 409 needs-confirmation

Media typeapplication/json

Where to install a realm from, the body of POST /realms: a git repository to clone, or a realm directory already mounted into the appliance

object
confirmed
required

Set true only once the user has confirmed installing an experimental realm, after a 409 with status needs-confirmation. Ignored for a path install

boolean
path

Absolute path, inside the appliance container, of a mounted realm directory with a realm.yml, such as /realms/realm-esg. Loaded in place, never cloned or copied; the directory’s name becomes the realm’s. Takes precedence over repo

string
ref

Branch, tag or commit SHA to check out. Null for the repository’s default branch. Ignored for a path install

string
repo

The repository to clone: owner/repo for GitHub, or a full clone URL. Required unless path is given, and ignored when it is

string

Example generated

{
"confirmed": true,
"path": "example",
"ref": "example",
"repo": "example"
}

Realm installed

Media type*/*
object
key
additional properties
string

Neither repo nor path was given, or the path is not a mounted realm directory

Media type*/*

A refusal from the realms surface: the word error and the reason

object
message
required

Why the request was refused, written to be shown. A failed install or update carries the underlying failure’s message

string
status
required

Always error

string
Allowed values: error

Realm already exists, or the realm is experimental and needs confirmed: true; status says which

Media type*/*
One of:

A refusal from the realms surface: the word error and the reason

object
message
required

Why the request was refused, written to be shown. A failed install or update carries the underlying failure’s message

string
status
required

Always error

string
Allowed values: error

Install failed

Media type*/*

A refusal from the realms surface: the word error and the reason

object
message
required

Why the request was refused, written to be shown. A failed install or update carries the underlying failure’s message

string
status
required

Always error

string
Allowed values: error