Module: check_mk
Branch: master
Commit: 34c66a2905d0ef86bf1dde5694d80bded7da8999
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=34c66a2905d0ef…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Aug 18 10:13:51 2016 +0200
3786 WATO webapi: now able to bake agents with the new action bake_agents
---
.werks/3786 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/webapi/webapi.py | 14 ++++++++++++++
3 files changed, 25 insertions(+)
diff --git a/.werks/3786 b/.werks/3786
new file mode 100644
index 0000000..78a914d
--- /dev/null
+++ b/.werks/3786
@@ -0,0 +1,10 @@
+Title: WATO webapi: now able to bake agents with the new action bake_agents
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i1
+Date: 1471507994
+Class: feature
+
+
+
diff --git a/ChangeLog b/ChangeLog
index 59cd5bc..ab182df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -465,6 +465,7 @@
* 3728 Automatically creating automation user for Check_MK internal use with WATO
default config...
* 3559 WATO API: now able to bake agents with the new action "bake_agents"
* 3785 WATO rulesets: now able to set a negate option for services and items...
+ * 3786 WATO webapi: now able to bake agents with the new action bake_agents
* 3060 FIX: Folder properties: Fixed exception when a user has no alias set...
* 3062 FIX: Git integration: Fixed not adding files in WATO folders to git control
* 3203 FIX: Distributed WATO: Fixed exception in remote host service discovery...
diff --git a/web/plugins/webapi/webapi.py b/web/plugins/webapi/webapi.py
index 1684438..34387a7 100644
--- a/web/plugins/webapi/webapi.py
+++ b/web/plugins/webapi/webapi.py
@@ -325,3 +325,17 @@ api_actions["activate_changes"] = {
"locking" : True,
}
+def action_bake_agents(request):
+ try:
+ check_mk_local_automation('bake-agents')
+ last_bake_file = var_dir + "last_bake.mk"
+ file(last_bake_file, 'w').write('%s\n' %
defaults.check_mk_version)
+ return _("Successfully baked agents")
+ except Exception, e:
+ raise e
+
+api_actions["bake_agents"] = {
+ "handler" : action_bake_agents,
+ "locking" : True,
+}
+