该方法允许根据给定的参数检索动作。
参数
(object)
定义期望输出的参数。
该方法支持以下参数。
返回值
也返回:
对象数组;
如果使用了
curtOutlook
参数,则检索对象的计数。
范例
检索发现动作
Retrieve all configured discovery actions together with action conditions and operations. The filter uses the “and” evaluation type, so the formula
property is empty and eval_formula
is generated automatically. 检索所有配置的发现动作以及操作条件和操作。筛选器使用 and
评估类型,因此 formula
属性为空,自动生成 eval_formula
。
响应:
来源
CAction::get() in frontends/php/include/classes/api/services/CAction.php.
Description
integer/array action.get(object **parameters**)
The method allows to retrieve actions according to the given parameters.
Parameters
(object)
Parameters defining the desired output.
Parameter | Type | Description |
---|---|---|
actionids | string/array | Return only actions with the given IDs. |
groupids | string/array | Return only actions that use the given host groups in action conditions. |
hostids | string/array | Return only actions that use the given hosts in action conditions. |
triggerids | string/array | Return only actions that use the given triggers in action conditions. |
mediatypeids | string/array | Return only actions that use the given media types to send messages. |
usrgrpids | string/array | Return only actions that are configured to send messages to the given user groups. |
userids | string/array | Return only actions that are configured to send messages to the given users. |
scriptids | string/array | Return only actions that are configured to run the given scripts. |
selectFilter | query | Returns the action filter in the filter property. |
selectOperations | query | Return action operations in the property. |
selectRecoveryOperations | query | Return action recovery operations in the recoveryOperations property. |
selectAcknowledgeOperations | query | Return action acknowledge operations in the acknowledgeOperations property. |
sortfield | string/array | Sort the result by the given properties. Possible values are: actionid , name and status . |
countOutput | boolean | These parameters being common for all get methods are described in the . |
editable | boolean | |
excludeSearch | boolean | |
filter | object | |
limit | integer | |
output | query | |
preservekeys | boolean | |
search | object | |
searchByAny | boolean | |
searchWildcardsEnabled | boolean | |
sortorder | string/array | |
startSearch | boolean |
(integer/array)
Returns either:
an array of objects;
the count of retrieved objects, if the
countOutput
parameter has been used.
Examples
Retrieve discovery actions
Retrieve all configured discovery actions together with action conditions and operations. The filter uses the “and” evaluation type, so the formula
property is empty and is generated automatically.
Request:
Response:
See also
Source
CAction::get() in frontends/php/include/classes/api/services/CAction.php.