Appearance
Assign labels to objects
An Assignment binds a Label Definition's key to a value on a concrete object. plexctl label object wraps /v1/objects/{kind}/{id}/labels; plexctl label selector preview tests selector expressions.
Prerequisites
- An authenticated session — see Log in with plexctl.
- A Label Definition in scope — see Manage Label Definitions.
- The object reference as
<kind>:<uuid>(e.g.node:0190a8b8-…).
Steps
Set and list assignments
shell
plexctl label object set node:<node-uuid> --definition-id <definition-uuid> --value gold
# OBJECT_KIND OBJECT_ID QUALIFIED_KEY VALUE ASSIGNED_BY
# node … tier gold …
plexctl label object list node:<node-uuid>
# OBJECT_KIND OBJECT_ID QUALIFIED_KEY VALUE ASSIGNED_BY
# node … tier gold …--value is validated against the Definition's value schema.
Remove an assignment
shell
plexctl label object delete node:<node-uuid> --qualified-key <qualified-key> --yesdelete is destructive and requires the persistent --yes flag.
Preview a selector
shell
plexctl label selector preview --selector 'tier in (gold, silver) && env == prod'
# OP KEY VALUE VALUES
# in tier - gold, silver
# == env prod -preview never raises — it renders the parsed AST, or an ERROR row per parse error with the offending position.
Verification
shell
plexctl label object list node:<node-uuid> --output json | jq
# [
# {
# "object_kind": "node",
# "qualified_key": "tier",
# "value": "gold",
# …
# }
# ]See also
- Manage Label Definitions — define the key first.
../../reference/cli/plexctl/label.md— every flag and exit code.