Werk #4023: WATO Web-API: Now able to add/edit/delete htpasswd users
Komponente | Setup | ||
Titel | WATO Web-API: Now able to add/edit/delete htpasswd users | ||
Datum | 07.02.2017 | ||
Level | Bedeutende Änderung | ||
Klasse | Neues Feature | ||
Kompatibilität | Kompatibel - benötigt kein manuelles Eingreifen | ||
Checkmk versions & editions |
|
New functions for the WATO Web-API have been introduced. You can now manage htpasswd users with automation calls.
The following (not very fleshed out) examples provide a quick overview. A more elaborate version will be written later on in our official manual.
Common url prefix:
http://localhost/heute/check_mk/webapi.py?_username=automation&_secret=1122...
To get a list of all supported attributes, you'll need to have a look in the actual config files
~/etc/check_mk/conf.d/wato/contacts.mk
~/etc/check_mk/multisite.d/wato/users.mk
Add users:
curl {common_prefix}&action=add_users -d 'request={"users": {"klaus": {"alias": "mr. klaus", "password": "1234", "contactgroups": ["all"]}}}'
Edit users:
curl {common_prefix}&action=edit_users -d 'request={"users": {"klaus": {"set_attributes": {"alias": "mr. santa"}, "unset_attributes": ["contactgroups"]}}}'
Delete users:
curl {common_prefix}&action=delete_users -d 'request={"users": ["klaus", "guest12", "guest2332"]}'