search

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.

zenpack.yaml
name: ZenPacks.zenoss.BasicZenPack

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

  XenServer:
    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.

Device Link Provider Fields

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

NameDescriptionRequiredTypeDefault Value
link_titleTitle which will appear on the overview page of the type of device or component.yesstring(implied from key in link_providers map)
global_searchSearch the global catalog?nobooleanfalse
link_classPython class on which this provider will apply. Requires full python class name. nostringProducts.ZenModel.Device.Device
device_classDevice class containing the catalog to search.nostringNone
catalogCatalog name to search for linked devices or components.nostringdevice
queriesQueries 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”.
yeslist<string>

[] (empty list)