This is a translation of the original English documentation page. Help us make it better.

userdirectory.get

Description

integer/array userdirectory.get(object parameters)

The method allows to retrieve user directories according to the given parameters.

This method is only available to Super admin user types.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
userdirectoryids string/array Return only user directory with the given IDs.
selectUsrgrps query Return a usrgrps property with user groups associated with user directory.

Supports count.
sortfield string/array Sort the result by the given properties.

Possible values are: name, host.
filter object Return only those results that exactly match the given filter.

Possible values are: userdirectoryid, host, name.
search object Return results that match the given wildcard search (case-insensitive).

Possible values are: base_dn, bind_dn, description, host, name, search_attribute, search_filter.
countOutput boolean These parameters being common for all get methods are described in detail in the reference commentary.
excludeSearch boolean
limit integer
output query
preservekeys boolean
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

戻り値

(integer/array) 次のいずれかを返します:

  • オブジェクトの配列
  • countOutputパラメータが使用されている場合、取得されたオブジェクトの数

ユーザーディレクトリの取得

各ユーザーディレクトリに関連付けられたメディアタイプマッピングとプロビジョニンググループマッピングを表示する追加プロパティを含むすべてのユーザーディレクトリを取得します。

リクエスト :

{
           "jsonrpc": "2.0",
           "method": "userdirectory.get",
           "params": {
               "output": "extend",
               "selectProvisionMedia": "extend",
               "selectProvisionGroups": "extend"
           },
           "id": 1
       }

レスポンス :

{
           "jsonrpc": "2.0",
           "result": [
              {
                   "userdirectoryid": "1",
                   "idp_type": "2",
                   "name": "",
                   "provision_status": "1",
                   "description": "",
                   "group_name": "groups",
                   "user_username": "",
                   "user_lastname": "",
                   "idp_entityid": "http://example.com/simplesaml/saml2/idp/metadata.php",
                   "sso_url": "http://example.com/simplesaml/saml2/idp/SSOService.php",
                   "slo_url": "",
                   "username_attribute": "uid",
                   "sp_entityid": "zabbix",
                   "nameid_format": "",
                   "sign_messages": "0",
                   "sign_assertions": "0",
                   "sign_authn_requests": "0",
                   "sign_logout_requests": "0",
                   "sign_logout_responses": "0",
                   "encrypt_nameid": "0",
                   "encrypt_assertions": "0",
                   "scim_status": "1",
                   "provision_media": [
                       {
                           "name": "example.com",
                           "mediatypeid": "1",
                           "attribute": "[email protected]"
                       }
                   ],
                   "provision_groups": [
                       {
                           "name": "*",
                           "roleid": "1",
                           "user_groups": [
                               {
                                   "usrgrpid": "13"
                               }
                           ]
                       }
                   ]
               },
               {
                   "userdirectoryid": "2",
                   "idp_type": "1",
                   "name": "AD server",
                   "provision_status": "1",
                   "description": "",
                   "host": "host.example.com",
                   "port": "389",
                   "base_dn": "DC=zbx,DC=local",
                   "search_attribute": "sAMAccountName",
                   "bind_dn": "CN=Admin,OU=Users,OU=Zabbix,DC=zbx,DC=local",
                   "start_tls": "0",
                   "search_filter": "",
                   "group_basedn": "OU=Zabbix,DC=zbx,DC=local",
                   "group_name": "CN",
                   "group_member": "member",
                   "group_filter": "(%{groupattr}=CN=%{ref},OU=Users,OU=Zabbix,DC=zbx,DC=local)",
                   "group_membership": "",
                   "user_username": "givenName",
                   "user_lastname": "sn",
                   "user_ref_attr": "CN",
                   "provision_media": [
                       {
                           "name": "example.com",
                           "mediatypeid": "1",
                           "attribute": "[email protected]"
                       }
                   ],
                   "provision_groups": [
                       {
                           "name": "*",
                           "roleid": "4",
                           "user_groups": [
                               {
                                   "usrgrpid": "8"
                               }
                           ]
                       },
                       {
                           "name": "Zabbix administrators",
                           "roleid": "2",
                           "user_groups": [
                               {
                                   "usrgrpid": "7"
                               },
                               {
                                   "usrgrpid": "8"
                               }
                           ]
                       }
                   ]
               },
               {
                   "userdirectoryid": "3",
                   "idp_type": "1",
                   "name": "LDAP API server #1",
                   "provision_status": "0",
                   "description": "",
                   "host": "ldap://local.ldap",
                   "port": "389",
                   "base_dn": "ou=Users,dc=example,dc=org",
                   "search_attribute": "uid",
                   "bind_dn": "cn=ldap_search,dc=example,dc=org",
                   "start_tls": "1",
                   "search_filter": "",
                   "group_basedn": "",
                   "group_name": "",
                   "group_member": "",
                   "group_filter": "",
                   "group_membership": "",
                   "user_username": "",
                   "user_lastname": "",
                   "user_ref_attr": "",
                   "provision_media": [],
                   "provision_groups": []
               }
           ],
           "id": 1
       }

参照

ソース

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