Skip to content
Odinex Cloud
Concepts

Labels

Key/value tags on resources, and the selectors that match them.

Labels are key/value pairs you attach to resources: servers, volumes, networks, firewalls, floating IPs, load balancers, placement groups, SSH keys and images. They are yours to use; Odinex only uses them where you ask it to, in label selectors:

  • Firewalls can be applied to all servers matching a selector.
  • Load balancers can target all servers matching a selector.
  • List endpoints filter with the label_selector query parameter, and the CLI with -l / --selector.

Rules

  • Up to 64 labels per resource.
  • Keys: up to 63 characters of letters, digits, -, _ and ., starting and ending with a letter or digit, optionally prefixed with a DNS-style name and a slash (example.com/role).
  • Values: up to 63 characters of the same characters, or empty.
  • Updating a resource's labels replaces all of its labels.

Selectors

SelectorMatches resources that
env=prodhave the label env with the value prod
env!=proddon't have env=prod
envhave a label env, with any value
!envhave no label env

Combine conditions with commas; all of them must match: env=prod,role=web,!legacy.

odx server list -l env=prod,role=web
curl -H "Authorization: Bearer $ODX_TOKEN" "https://api.odinex.cloud/v1/servers?label_selector=env%3Dprod,role%3Dweb"

On this page