Skip to content

Lightweight Directory Access Protocol

ucmdb_rest.ldap.RetrieveLDAP(server)

Initialize the service with a reference to the main level UCMDB server

Source code in ucmdb_rest\ldap.py
def __init__(self, server):
    """
    Initialize the service with a reference to the main level UCMDB server
    """
    self.server = server

getLDAPSettings()

Retrieves the full LDAP configuration from the UCMDB server.

This includes connection URLs, service account details (masked), user/group search filters, and attribute mappings.

Returns:

Type Description
Response

A JSON array containing dictionaries for each configured LDAP repository.

Example Response Structure:

[ { "connection": {"url": "ldap://...", "searchUser": "..."}, "user": {"userClass": "user", "uniqueIdAttribute": "employeeID"}, "group": {"groupClass": "group", "memberAttribute": "member"} } ]

Source code in ucmdb_rest\ldap.py
def getLDAPSettings(self):
    """
    Retrieves the full LDAP configuration from the UCMDB server.

    This includes connection URLs, service account details (masked), 
    user/group search filters, and attribute mappings.

    Returns
    -------
    requests.Response
        A JSON array containing dictionaries for each configured 
        LDAP repository.

    Example Response Structure:
    ---------------------------
    [
        {
            "connection": {"url": "ldap://...", "searchUser": "..."},
            "user": {"userClass": "user", "uniqueIdAttribute": "employeeID"},
            "group": {"groupClass": "group", "memberAttribute": "member"}
        }
    ]
    """
    url = '/ldap/settings'
    return self.server._request("GET",url)