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_selectorquery 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
labelsreplaces all of its labels.
Selectors
| Selector | Matches resources that |
|---|---|
env=prod | have the label env with the value prod |
env!=prod | don't have env=prod |
env | have a label env, with any value |
!env | have 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"