CMK version: 2.0.0p6 (CRE)
OS version: Centos 7.9
I am following API Example as given in documentation
#!/bin/bash
HOST_NAME="localhost"
SITE_NAME="site"
API_URL="http://$HOST_NAME/$SITE_NAME/check_mk/api/1.0"
USERNAME="automation"
PASSWORD="test123"
http PUT "$API_URL/objects/user_config/user" \
--json
"Authorization: Bearer $USERNAME $PASSWORD" \
"Accept: application/json" \
'If-Match:a20ceacf346041dc' \
'Content-Type:application/json' \
fullname='Mathias Kettner' \
auth_option='{'auth_type': 'password', 'password': 'password'}' \
enforce_password_change='True' \
disable_login='False' \
contact_options='{'email': 'user@example.com'}' \
pager_address='' \
idle_timeout='{}' \
roles='['user']' \
authorized_sites='['heute']' \
contactgroups='['all']' \
disable_notifications='{'disabled': False}' \
language='en' \
actual code:
#!/bin/bash
HOST_NAME="localhost"
SITE_NAME="site"
API_URL="http://$HOST_NAME//$SITE_NAME/check_mk/api/1.0"
USERNAME="USER"
PASSWORD="PASSWD"
http --verbose --verify=no --follow --timeout 3600 PUT "$API_URL/objects/user_config/user" \
"Authorization: Bearer $USERNAME $PASSWORD" \
"Accept: application/json" \
roles='['user']'
The API call runs fine however i am not seeing any change in the role, i have simplified the call to change role for now. Any idea what i may be missing ?
Output:
"idle_timeout": { "option": "global" }, "pager_address": "", "roles": [] }