manual:api:reference:action:create

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:api:reference:action:create [2021/04/19 18:04]
martins-v fixing inconsistent entity names in the example
manual:api:reference:action:create [2021/08/09 13:51] (current)
Andrejs.Griscenko [ZBXNEXT-6755] renamed parameter "acknowledge_operations" to "update_operations"
Line 19: Line 19:
 | operations | array | Action [[:​manual/​api/​reference/​action/​object#​action_operation|operations]] to create for the action. | | operations | array | Action [[:​manual/​api/​reference/​action/​object#​action_operation|operations]] to create for the action. |
 | recovery_operations | array |Action ​ [[:​manual/​api/​reference/​action/​object#​action_recovery_operation|recovery operations]] to create for the action. | | recovery_operations | array |Action ​ [[:​manual/​api/​reference/​action/​object#​action_recovery_operation|recovery operations]] to create for the action. |
-acknowledge_operations ​| array | Action [[:​manual/​api/​reference/​action/​object#​action_update_operation|update operations]] to create for the action. |+update_operations ​| array | Action [[:​manual/​api/​reference/​action/​object#​action_update_operation|update operations]] to create for the action. |
  
 ==== Return values ==== ==== Return values ====
Line 29: Line 29:
 === Create a trigger action === === Create a trigger action ===
  
-Create an action that will be run when a trigger from host "30045" that has the word "​memory"​ in its name goes into problem state. The action must first send a message to all users in user group "​7"​. If the event is not resolved in 4 minutes, it will run script "​3"​ on all hosts in group "​2"​. On trigger recovery it will notify all users who received any messages regarding the problem before. On trigger update, message with custom subject and body will be sent to all who left acknowledgments and comments via all media types.+Create an action that will be run when a trigger from host "10084" that has the word "​memory"​ in its name goes into problem state. The action must first send a message to all users in user group "​7"​. If the event is not resolved in 4 minutes, it will run script "​3"​ on all hosts in group "​2"​. On trigger recovery it will notify all users who received any messages regarding the problem before. On trigger update, message with custom subject and body will be sent to all who left acknowledgments and comments via all media types.
  
 Request: Request:
Line 47: Line 47:
                     "​conditiontype":​ 1,                     "​conditiontype":​ 1,
                     "​operator":​ 0,                     "​operator":​ 0,
-                    "​value":​ "30045"+                    "​value":​ "10084"
                 },                 },
                 {                 {
Line 103: Line 103:
             }    ​             }    ​
         ],         ],
-        "acknowledge_operations": [+        "update_operations": [
             {             {
                 "​operationtype":​ "​12",​                 "​operationtype":​ "​12",​
Line 134: Line 134:
 === Create a discovery action === === Create a discovery action ===
  
-Create an action that will link discovered hosts to template "30085".+Create an action that will link discovered hosts to template "10091".
  
 Request: Request:
Line 165: Line 165:
                 "​optemplate":​ [                 "​optemplate":​ [
                     {                     {
-                        "​templateid":​ "30085"+                        "​templateid":​ "10091"
                     }                     }
                 ],                 ],