Zabbix usermacro objects
use Zabbix::API::Macro; # TODO write the rest
Handles \s-1CRUD\s0 for Zabbix usermacro objects.
Both global and host macro types are represented by this class. If the \*(C`hosts\*(C' arrayref attribute is undef or empty, then we assume it's a global macro.
This class' methods work transparently around the weird Zabbix macro \s-1API\s0, which uses different methods on the same object depending on whether it's a global or host macro... except sometimes, for instance the \*(C`usermacro.get\*(C' method which can be called on both and will return different keys... And macros don't seem to have an \*(C`exists\*(C' method. It's kind of a mess.
The various massFoo methods have not been implemented at all because I did not have a use for their \*(L"mass\*(R" functionality, despite their being the only way to \s-1CRUD\s0 host macros.
This class' \*(C`prefix\*(C' method is not a class method. The prefix returned depends on the type of macro (global or host) which is a characteristic of an instance.
Mutator for the macro's host. \*(C`HOST\*(C' should be a \*(C`Host\*(C' instance or a hashref with a \*(C`hostid\*(C' key.
Return a true value when the macro is global, a false value otherwise.
\s-1TODO\s0 links to other pods and documentation
Fabrice Gabolde <[email protected]>
Copyright (C) 2011 \s-1SFR\s0
This library is free software; you can redistribute it and/or modify it under the terms of the GPLv3.