该方法允许根据给定的参数检索动作。

    参数

    (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.

    ParameterTypeDescription
    actionidsstring/arrayReturn only actions with the given IDs.
    groupidsstring/arrayReturn only actions that use the given host groups in action conditions.
    hostidsstring/arrayReturn only actions that use the given hosts in action conditions.
    triggeridsstring/arrayReturn only actions that use the given triggers in action conditions.
    mediatypeidsstring/arrayReturn only actions that use the given media types to send messages.
    usrgrpidsstring/arrayReturn only actions that are configured to send messages to the given user groups.
    useridsstring/arrayReturn only actions that are configured to send messages to the given users.
    scriptidsstring/arrayReturn only actions that are configured to run the given scripts.
    selectFilterqueryReturns the action filter in the filter property.
    selectOperationsqueryReturn action operations in the property.
    selectRecoveryOperationsqueryReturn action recovery operations in the recoveryOperations property.
    selectAcknowledgeOperationsqueryReturn action acknowledge operations in the acknowledgeOperations property.
    sortfieldstring/arraySort the result by the given properties.

    Possible values are: actionid, name and status.
    countOutputbooleanThese parameters being common for all get methods are described in the .
    editableboolean
    excludeSearchboolean
    filterobject
    limitinteger
    outputquery
    preservekeysboolean
    searchobject
    searchByAnyboolean
    searchWildcardsEnabledboolean
    sortorderstring/array
    startSearchboolean

    (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.