CLI Apply Device Types

Device types appear in a dropdown when creating or editing device records via the web ui. For new deployments with known equipment, the CLI makes it possible to seed this data from files.

Curate your assets

Using a directory managed by version control such as git, lay out a directory structure containing YAML or JSON assets. Any depth of folder hierarchy is supported.

my-device-types/
  RaspberryPi/
    3B+.yaml
    4B.yaml
  Seeed/
    JetsonMateClusterAdvanced.yaml

The JSON layout of a device type can be scraped via the web browser's JavaScript console, or this example can be used:

# my-device-types/RaspberryPi/4B.yaml
id: ce5agg932ckm7ftm6dqg
kind: DeviceType
manufacturer: Raspberry Pi
model: 4B

Importing

Leave off the --dry-run flag to perform an actual import.

$ onprem apply --dry-run ./my-device-types/