Licenses: Updated the list of licenses and added a PDF containing all license texts
[check_mk.git] / .werks / 4018
blobe4cd037e808e2f289465120f4f77f798c2ae1699
1 Title: WATO Web-API: new functions to manage host, service and contactgroups
2 Level: 1
3 Component: wato
4 Compatible: compat
5 Version: 1.4.0b1
6 Date: 1486032438
7 Class: feature
10 A few new functions to manage host, service and contact groups have been introduced.
11 <br>
14 <tt>
15 Example calls:
18 You can get all groups of a specific type with the action get_all_{groupname}<br>
19 curl http://localhost/heute/check_mk/webapi.py?action=get_all_hostgroups&_username=automation&_secret=1122<br>
21 curl http://localhost/heute/check_mk/webapi.py?action=get_all_servicegroups&_username=automation&_secret=1122<br>
23 curl http://localhost/heute/check_mk/webapi.py?action=get_all_contactgroups&_username=automation&_secret=1122<br>
24 <br>
25 <br>
26 Furthermore you can add, edit and delete these groups
29 <tt>
30     # All group types can be managed with similar requests
32     # Add group<br>
33     curl "http://localhost/heute/check_mk/webapi.py?action=add_hostgroup&_username=automation&_secret=1122" -d 'request={"groupname": "hostgroup1", "alias": "the hg alias"}'<br>
35     curl "http://localhost/heute/check_mk/webapi.py?action=add_servicegroup&_username=automation&_secret=1122" -d 'request={"groupname": "servicegroup1", "alias": "the sg alias"}'<br>
37     curl "http://localhost/heute/check_mk/webapi.py?action=add_contactgroup&_username=automation&_secret=1122" -d 'request={"groupname": "contactgroup1", "alias": "the cg alias"}'<br>
39     # Edit group<br>
40     curl "http://localhost/heute/check_mk/webapi.py?action=edit_hostgroup&_username=automation&_secret=1122" -d 'request={"groupname": "hostgroup1", "alias": "the hg alias"}'<br>
42     curl "http://localhost/heute/check_mk/webapi.py?action=edit_servicegroup&_username=automation&_secret=1122" -d 'request={"groupname": "servicegroup1", "alias": "the sg alias"}'<br>
44     curl "http://localhost/heute/check_mk/webapi.py?action=edit_contactgroup&_username=automation&_secret=1122" -d 'request={"groupname": "contactgroup1", "alias": "the cg alias"}'<br>
46     # Delete group<br>
47     curl "http://localhost/heute/check_mk/webapi.py?action=delete_hostgroup&_username=automation&_secret=1122" -d 'request={"groupname": "hostgroup1"}'<br>
49     curl "http://localhost/heute/check_mk/webapi.py?action=delete_servicegroup&_username=automation&_secret=1122" -d 'request={"groupname": "servicegroup1"}'<br>
51     curl "http://localhost/heute/check_mk/webapi.py?action=delete_contactgroup&_username=automation&_secret=1122" -d 'request={"groupname": "contactgroup1"}'<br>
54     # For contact groups you may also specify a list of nagvis maps in the extra attribute nagivs_maps<br>
55     curl "http://localhost/heute/check_mk/webapi.py?action=add_contactgroup&_username=automation&_secret=1122" -d 'request={"groupname": "newgroup2", "alias": "the alias", "nagvis_maps": ["dfdf"]}'
56 </tt>
59 Please note: A more elaborate version of these new web api calls will be added to our manual soon. :)