You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

userdirectory.update

Description

object userdirectory.update(object/array userDirectory)

This method allows to update existing user directories.

This method is only available to Super admin user type.

Parameters

(object/array) User directory properties to be updated.

The userdirectoryid property must be defined for each user directory, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Return values

(object) Returns an object containing the IDs of the updated user directories under the userdirectoryids property.

Examples

Update bind password for user directory

Set new bind password for a user directory.

Request:

{
           "jsonrpc": "2.0",
           "method": "userdirectory.update",
           "params": {
               "userdirectoryid": "3",
               "bind_password": "newldappassword"
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "userdirectoryids": [
                   "3"
               ]
           },
           "id": 1
       }
Update mappings for user directory

Update provisioning groups mappings and media type mappings for user directory "2".

Request:

{
           "jsonrpc": "2.0",
           "method": "userdirectory.update",
           "params": {
               "userdirectoryid": "2",
               "provision_media": [
                       {
                           "userdirectory_mediaid": "2"
                       }
                   ],
                   "provision_groups": [
                       {
                           "name": "Zabbix administrators",
                           "roleid": "2",
                           "user_groups": [
                               {
                                   "usrgrpid": "7"
                               },
                               {
                                   "usrgrpid": "8"
                               },
                               {
                                   "usrgrpid": "11"
                               }
                           ]
                       }
                   ]
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "userdirectoryids": [
                   "2"
               ]
           },
           "id": 1
       }

Source

CUserDirectory::update() in ui/include/classes/api/services/CUserDirectory.php.