The Zabbix API supports the following data types:
Zabbix API支持以下数据类型:
| Type | Description | 
|---|---|
| boolean | A boolean value, accepts either trueorfalse. | 
| flag | The value is considered to be trueif it is passed and not equal tonullandfalseotherwise. | 
| integer | A whole number. | 
| float | A floating point number. | 
| string | A text string. | 
| text | A longer text string. | 
| timestamp | A Unix timestamp. | 
| array | An ordered sequence of values, that is, a plain array. | 
| object | An associative array. | 
| query | A value which defines, what data should be returned. Can be defined as an array of property names to return only specific properties, or as one of the predefined values: extend- returns all object properties;count- returns the number of retrieved records, supported only by certain subselects. | 
| 数据类型 描述 | |
|---|---|
| boolean | 布尔值, 只接受 true或false这两种参数。 | 
| flag | 如果传递的值不等于 null和false,则认为该值为true。 | 
| integer | 整数。 | 
| float | 浮点数。 | 
| string | 文本字符串。 | 
| text | 长文本字符串。 | 
| timestamp | Unix时间戳。 | 
| array | 有序的值序列, 即普通数组。 | 
| object | 关联数组。 | 
| query | 用于定义应该返回哪些数据。 可定义为仅返回特定属性的属性名称数组,或者定义为以下预定值之一: extend- 返回所有对象属性;count- 返回检索到的记录的数量,仅支持某些子查询。 | 
Some of the objects properties are marked with short labels to describe their behavior. The following labels are used:
一些对象属性用短标签来描述它们的行为。使用了以下标签:
Reserved ID value "0" can be used to filter elements and to remove referenced objects. For example, to remove a referenced proxy from a host, proxy_hostid should be set to 0 ("proxy_hostid": "0") or to filter hosts monitored by server option proxyids should be set to 0 ("proxyids": "0").
预留ID值 "0" 可以用来过滤元素和删除引用的对象。例如,要从主机上删除一个引用的代理,proxy_hostid应该设置为0("proxy_hostid": "0");或者,要过滤被zabbix server监控的主机,proxyids选项则应该设置为0 ("proxyids": "0")。
The following parameters are supported by all get methods:
所有get 方法都支持以下参数:
| Parameter | Type | Description | 
|---|---|---|
| countOutput | boolean | Return the number of records in the result instead of the actual data. | 
| editable | boolean | If set to truereturn only objects that the user has write permissions to.Default: false. | 
| excludeSearch | boolean | Return results that do not match the criteria given in the searchparameter. | 
| filter | object | Return only those results that exactly match the given filter. 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. Doesn't work for textfields. | 
| limit | integer | Limit the number of records returned. | 
| output | query | Object properties to be returned. Default: extend. | 
| preservekeys | boolean | Use IDs as keys in the resulting array. | 
| search | object | Return results that match the given wildcard search (case-insensitive). Accepts an array, where the keys are property names, and the values are strings to search for. If no additional options are given, this will perform a LIKE "%…%"search.Works only for stringandtextfields. | 
| searchByAny | boolean | If set to truereturn results that match any of the criteria given in thefilterorsearchparameter instead of all of them.Default: false. | 
| searchWildcardsEnabled | boolean | If set to trueenables the use of "*" as a wildcard character in thesearchparameter.Default: false. | 
| sortfield | string/array | Sort the result by the given properties. Refer to a specific API get method description for a list of properties that can be used for sorting. Macros are not expanded before sorting. | 
| sortorder | string/array | Order of sorting. If an array is passed, each value will be matched to the corresponding property given in the sortfieldparameter.Possible values are: ASC- ascending;DESC- descending. | 
| startSearch | boolean | The searchparameter will compare the beginning of fields, that is, perform aLIKE "…%"search instead.Ignored if searchWildcardsEnabledis set totrue. | 
| 参数 数 | 类型 描述 | |
|---|---|---|
| countOutput | boolean | 返回结果中的记录数量,而不是实际数据。 | 
| editable | boolean | 如果设置为“true”,则只返回用户具有写入权限的对象。 默认值: false。 | 
| excludeSearch | boolean | 返回与在 search参数中给定的条件不匹配的结果。 | 
| filter | object | 仅返回与给定过滤器完全匹配的结果。 接受一个数组,键是属性名;要么是单个值,要么是要匹配的一组值。 不适用于 text字段。 | 
| limit | integer | 限制返回记录的数量。 | 
| output | query | 要返回的对象属性。 默认值: extend。 | 
| preservekeys | boolean | 在结果数组中,使用ID作为键。 | 
| search | object | 返回与给定通配符搜索匹配的结果 (不区分大小写)。 接受一个数组,键是属性名,其值是要搜索的字符串。 如果没有提供额外的选项,将执行 LIKE "%…%"搜索。仅适用于 string和text字段。 | 
| searchByAny | boolean | 如果设置为 true,则返回与filter或search参数中给出的任何条件匹配的结果,而不是匹配所有条件。默认值: false。 | 
| searchWildcardsEnabled | boolean | 如果设置为 true,则可以在search参数中使用 "*" 作为通配符。默认值: false。 | 
| sortfield | string/array | Sort the result by the given properties. Refer to a specific API get method description for a list of properties that can be used for sorting. Macros are not expanded before sorting. | 
| sortorder | string/array | Order of sorting. If an array is passed, each value will be matched to the corresponding property given in the sortfieldparameter.Possible values are: ASC- ascending;DESC- descending. | 
| startSearch | boolean | The searchparameter will compare the beginning of fields, that is, perform aLIKE "…%"search instead.Ignored if searchWildcardsEnabledis set totrue. |