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

inconsistency in returned resource types regarding LLD (rule, prototype, created object). no checks for allowed types for some methods.

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3
    • Fix Version/s: 2.0.4rc1, 2.1.0
    • Component/s: API (A)
    • Labels:
    • Environment:
      trunk rev 30757 (~2.0.3 release)

      Description

      (1)
      Current state:

      • item.get returns all - 0, 1, 2, 4 (normal item, discovery rule, prototype, auto-created item)
      • trigger.get returns only "flags" in 0, 4 (normal trigger, auto-created trigger)
      • graph.get returns only "flags" in 0, 4 (normal graph, auto-created graph)

      We have also DiscoveryRule, ItemPrototype, TriggerPrototype and GraphPrototype API classes, they all work correctly and return only appropriate types (I've just tested).

      So to be consistent we have to limit the "item.get" method to return only "real" items, i.e. 0 and 4 types only.

      Then in documentation:
      http://www.zabbix.com/documentation/2.0/manual/appendix/api/item/definitions
      need to leave description only for available types.

      (2)
      Maybe we also need to check how other methods (update ... delete) from Item, Trigger and Graph classes work with rules and prototypes, maybe we have also to limit there the types ?
      Yes, we must - I found a bug there (at least one), nasty bug:
      try to update "status":0 using "item.update" method for a discovery rule or a prototype or a auto-created item - its "flags" will be silently changed to "0" - i.e. to normal item

      "trigger.update" and "graph.update" are ok in this regard and don't allow such incorrect action - "No permissions to referred object or it does not exist!"

      Please consider which particular tests I could forget and skip.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              zalex_ua Oleksiy Zagorskyi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: