Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-6433

"template" method for filter object should accept "templateid" instead "hostid"

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 2.0.6, 2.1.0
    • API (A)

      We use the same DB tables for things which are related but actually are different.
      They are for example: hosts -> host/template, items -> item/lld rule/item prototype. In 2.2 we suppose to additionally have host prototype for hosts table.

      Disregarding that for "lld rule/item prototype" objects we execute methods called differently ("discoveryrule/itemprototype") but in returned results we identify entities by single field - "itemid".
      It looks a bit specific but it is not so critical and not so hard to understand by users.
      Also - we can use the "itemid" field in "filter" object for all tree methods "item/discoveryrule/itemprototype" which is ok. I have no complains here, everything is consistent.

      But let's consider "template" method.
      In first commend bellow I've added some examples.
      As you see "template" method returns objects identified by "templateid" field.
      But if we want to use "filter" object for this method then we have to use "hostid" as a field for filtering.
      And this is NOT consistent, it looks differently - > illogically (remember about end users) and do not match documentation which says, quote: "Accepts an array, where the keys are property names, and the values are either a single value or an array of values to match against."

      This is a difference (if we compare it with item-related methods above) I wanted to take your attention.
      I suggest to implement specific behavior for "filter" object in "template" method to accept "templateid" field instead "hostid".

            Unassigned Unassigned
            zalex_ua Oleksii Zagorskyi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: