Skip to main content
Version: v5.7.0

opschain nodes create

Included from Basic tierassets

opschain nodes create <path> [-f <file.yaml>] [--name <name>] [--template <code>:<version>] ...

Creates the node the path names — the path carries both where and what:

  • nodes create demo creates project demo,
  • nodes create demo/environments/dev the dev environment under it,
  • nodes create demo/environments/dev/assets/web --template web-template:1.0.0 the web asset pinned to that template version,
  • nodes create demo/assets/shared --template t:1.0.0 an asset directly under the project,
  • nodes create demo/environments/dev/entities/rack_1 an entity under the environment (an entity may live under any node, and under another entity; it takes a name and description only — see also opschain docs cli/entity-create).

The final path segment becomes the node's code (immutable thereafter); the parent must already exist. Assets always need --template (or the -f equivalents). Every project holds environments, assets and entities — the only gate on asset creation is the licence's assets feature and limit (opschain docs entitlements).

Flags​

FlagMeaning
-f, --file <file.yaml>YAML node definition. Accepted keys: code, name, description, template_code, template_version (and the retired project_type, accepted and ignored) — an unknown key is refused by name. A code in the file must match the path's code.
--name <name>Display name. Defaults to the node's code when neither the flag nor the file supplies one.
--description <text>Description.
--template <code>:<version>Template to pin an asset to (assets only). Shorthand for the file's template_code + template_version.
--project-type <type>Deprecated and ignored. The former Standard/Enterprise project type is retired — every project holds assets. Supplying it (by flag or the project_type file key, any value) prints a note on stderr and has no effect, so older scripts and definition files keep working.

Flags win over -f file values.

Exit codes​

CodeMeaning
0Created.
1The server refused the create (duplicate code, missing parent, validation, authorisation).
2Usage error — malformed path or --template, unknown file keys, no server target.

Named errors​

  • <file.yaml> defines code "…" but the command addresses /projects/…
  • --template wants <template-code>:<version>, got "…"
  • <file.yaml>: unknown node attribute(s) … (accepted: code, name, description, project_type, template_code, template_version)
  • expected a node path like demo, demo/environments/dev, /projects/demo/environments/dev/assets/web or demo/entities/rack_1, got "…"
  • nodes operate on a server's estate — pass --server <url> or 'opschain context use <name>'

All exit 2.

Server refusals are named too (exit 1) — an asset create under a licence without the assets feature answers, for example:

assets require an enterprise licence with the "assets" feature — the basic
licence does not include it (opschain admin licence apply)

A supplied --project-type prints, and is otherwise ignored:

note: --project-type (and the project_type file key) is deprecated and ignored — every project holds assets

Examples​

opschain nodes create demo --name "Demo" --description "Demo estate"
created project /projects/demo (01999a7e-…)
opschain nodes create acme
opschain nodes create acme/assets/shared --template base:2.1.0
opschain nodes create demo/environments/dev -f dev.yaml

-q prints only the created node's id; -o json / -o yaml print the created node object.

See also​

  • opschain docs cli/nodes-update — change the attributes later (code is immutable).
  • opschain docs cli/admin-nodes-import — recreate a whole exported subtree instead of one node.
  • opschain learn 1.1 — the estate, guided.