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. Every network device Thola wants to communicate with is assigned to a device class. This class defines which request are sent to a device and under which conditions a device is assigned to this class. When adding a new device type to Thola, a new device class for this type has to be created.

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

...

It is best practise to create a device class for each operating system, as most devices using the same operating system behave in a similar way. When it is necessary to divide devices further than that, it is possible to create sub device classes which specify the device class of an operating system for special devices with different behaviour. Information on the device class hierarchy and inheritance can be found here.