Documentation of Thola / Adding a new device / Writing a device class

Writing a device class

A device class is a simple YAML file containing information that is needed to communicate with a network device from this class. Thola uses these device classes internally to change the requests from generic ones to device-specific requests.

Example of a device class file:

name: "edgeos"

match:
logical_operator: "OR"
conditions:
    - type: SysObjectID
      match_mode: startsWith
      values:
        - .1.3.6.1.4.1.259.

identify:
  properties:
    vendor:
      - detection: constant
        value: "EdgeCore"
    model:
      - detection: SysDescription
    serial_number:
      - detection: snmpget
        oid: .1.3.6.1.4.1.259.10.1.45.1.1.3.1.10.1
    os_version:
      - detection: snmpget
        oid: .1.3.6.1.2.1.16.19.2.0

YAML files are used as they are much more human-readable than other alternative formats (like JSON or XML) and so it will be easier for users to integrate new network devices.