TECHZEN Zenoss User Community ARCHIVE  

Update Notification

Subject: Update Notification
Author: Sachin Tewari
Posted: 2017-07-03 11:56

How to update a notification of command type via the JSON api?

There are no examples and I have reached a dead end

zenoss_api triggers_router TriggersRouter updateNotification '{"data": {"globalManage": false, "uid": "/zport/dmd/NotificationSubscriptions/test3", "send_initial_occurrence": true, "newId": "test3", "id": "test3", "globalWrite": false, "content": {"items": [{"items": [{"vtype": null, "fieldLabel": "Command Timeout (seconds)", "xtype": "numberfield", "labelStyle": null, "value": 60, "disabled": false, "decimalPrecision": 2, "allowBlank": true, "anchor": "85%", "name": "action_timeout"}, {"vtype": null, "fieldLabel": "Command", "xtype": "textarea", "labelStyle": null, "value": "test", "name": "body_format", "disabled": false, "anchor": "85%", "allowBlank": true}, {"vtype": null, "fieldLabel": "Clear Command", "xtype": "textarea", "labelStyle": null, "value": "test", "name": "clear_body_format", "disabled": false, "anchor": "85%", "allowBlank": true}, {"vtype": null, "fieldLabel": "Environment variables", "xtype": "textarea", "labelStyle": null, "value": null, "name": "user_env_format", "disabled": false, "inputAttrTpl": "", "anchor": "85%", "allowBlank": true}], "xtype": "fieldset"}]}}}'


If I were to use importNotification instead, how do I do it?


Subject: RE: Update Notification
Author: Tim Caiazza
Posted: 2017-07-05 15:47

iamseth/python-zenoss
GitHub remove preview
iamseth/python-zenoss
python-zenoss - Python module to work the Zenoss API
View this on GitHub >

There is a function in there that updates notification subscriptions.  Take a look at that, if you are still stuck next week I can send a more concrete example.

------------------------------
Tim Caiazza
------------------------------


Subject: RE: Update Notification
Author: Sachin Tewari
Posted: 2017-07-06 09:20

I figured it out.

Thanks for extending help.

zenoss_api triggers_router TriggersRouter updateNotification "{\"uid\":\"/zport/dmd/NotificationSubscriptions/$1\",\"enabled\":false,\"send_clear\":false,\"send_initial_occurrence\":true,\"delay_seconds\":\"0\",\"repeat_seconds\":\"0\",\"action_timeout\":\"60\",\"body_format\":\"$COMMAND2\",\"clear_body_format\":\"$CLEAR_COMMAND\",\"user_env_format\":null,\"notification_globalRead\":false,\"notification_globalWrite\":false,\"notification_globalManage\":false,\"recipients\":[],\"subscriptions\":[$TRIGGER_UUID]}"

------------------------------
Sachin Tewari
------------------------------


< Previous
Zenoss Startup issue
  Next
Warning: don't mess with rolling restart
>