Skip to content

Device link providers

A device link provider is a subscriber interface that gives a hook for adding context-specific html links (for example, the device links on the Device Details page). Zenpacklib provides a simple class to search the global catalog, device class catalog, or a device local catalog that match a specific query.

name: ZenPacks.zenoss.BasicZenPack

  Virtual Machine:
    link_class: ZenPacks.example.XenServer
    catalog: device
    device_class: /Server/XenServer
    queries: [vm_id:manageIp]

    global_search: True
    queries: [manageIp:vm_id]

To search the global catalog, set global_search to true. If the catalog you wish to search is in a specific device class, set global_search to false and specify the class name with device_class. To search a catalog on the local device, simply set global_search to false and do not set device_class. You can use one or more queries to match up devices/components. In the above example, the XenServer provider will search the global device catalog and match any device’s manageIp attribute with the current device’s vm_id attribute.

The following fields are valid for a device link provider entry.

link_title (required, string, default = implied from key in link_providers map)
Title that appears on the overview page of the type of device or component.
global_search (optional, boolean, default = true)
Search the global catalog?
link_class (optional, string, default = Products.ZenModel.Device.Device)
Python class on which this provider will apply. Requires full python class name.
device_class (optional, string, default = None)
Device class containing the catalog to search.
catalog (optional, string, default = device)
Catalog name to search for linked devices or components.
queries (required, list, default = [] (empty list))

Queries to use to match a linked device/component.

Each query must be in remote:local format, meaning that the catalog search will match a remote attribute with a local attribute. The local search term could also be actual text. Examples: id:manageIp will match the remote id attribute with the local device’s manageIp attribute, and meta_type:ClusterDevice will match the meta_type on a remote device to ClusterDevice.