manual:appendix:api:drule

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:appendix:api:drule [2011/01/11 11:16]
vlad
manual:appendix:api:drule [2014/09/26 11:29] (current)
sasha Links adapted because of a move operation
Line 1: Line 1:
-===== DRule ===== +===== Discovery rule =====
-==== Methods ​====+
  
-Class containing methods for operations ​with Discovery Rules. +This class is designed to work with network ​discovery rules. ​
-^Methods^Description^ +
-|[[2.0/​manual/​appendix/​api/​drule/​get|get()]] |Get discovery rule details | +
-|[[2.0/​manual/​appendix/​api/​drule/​exists|exists()]] |Check if discovery rule exists | +
-|[[2.0/​manual/​appendix/​api/​drule/​create|create()]] |Create ​discovery rules +
-|[[2.0/​manual/​appendix/​api/​drule/​update|update()]] |Update discovery rule details | +
-|[[2.0/​manual/​appendix/​api/​drule/​delete|delete()]] |Delete discovery rules |+
  
 +<note tip>This API is meant to work with network discovery rules. For the low-level discovery rules see the [[discoveryrule|LLD rule API]].</​note>​
  
-==== Object ​details ====+Object ​references: \\ 
 +  * [[manual:​appendix:​api:​drule:​definitions#​discovery_rule|Discovery rule]]
  
-The table contains complete list of Discovery Rule attributes.+Available methods: \\
  
-^Parameter^Type^Description^Details^ +  * ''​[[manual:​appendix:​api:​drule:​create|drule.create]]''​ - create new discovery rules 
-|druleid|//​integer//​|Discovery Rule ID | +  ​* ''​[[manual:​appendix:​api:​drule:​delete|drule.delete]]''​ - delete discovery rules 
-|proxy_hostid|//​integer//​|Proxy Host ID.  ​| ​+  * ''​[[manual:​appendix:​api:​drule:​exists|drule.exists]]''​ - check if a discovery rule exists 
-|name|//​string//​|Discovery Rule name| | +  ​* ''​[[manual:​appendix:​api:​drule:​get|drule.get]]'' ​retrieve ​discovery rules 
-|iprange|//​string//​|Ip range| | +  ''​[[manual:​appendix:​api:​drule:isreadable|drule.isreadable]]''​ - check if discovery rules are readable 
-|delay|//​integer//​|Delay between checks ​ | | +  ​''​[[manual:​appendix:api:​drule:​iswritable|drule.iswritable]]''​ - check if discovery rules are writable 
-|nextcheck|//​integer//​|Next ​check date  | Zabbix internal field| +  ''​[[manual:​appendix:​api:​drule:​update|drule.update]]''​ - update ​discovery ​rules
-|status|//​integer//​|Status ​ ​| ​+
-|unique_dcheckid|//​string//​|Unique discovery check ID  | | +
- +
- +
-==== Common tasks ==== +
-The table contains list of common discovery rule-related tasks and possible implementation using Zabbix API +
-^Task^HOWTO^ +
-|Add a bunch of new discovery rules | Use method **discovery rule.create** with array of Discovery Rule objects | +
-|Enable a discovery rule | Use method **drule.update**, set **"​status"​:0** | +
-|Disable a discovery rule | Use method **drule.update**, set **"​status"​:1** | +
-|Retrieve discovery rule details by Discovery Rule IDs | Use method **drule.get** with parameter **druleids** | +
-|Retrieve discovery rule details by Discovery Rule name | Use method **drule.get** with parameter **filter**, specify **"​name":"<​your ​discovery ​rule>"​** |+