Skip to content

LDAP

Bases: Spout

__init__(output, state, **kwargs)

Initialize the LDAP class.

Parameters:

Name Type Description Default
output BatchOutput

An instance of the BatchOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius LDAP rise \
    batch \
        --output_s3_bucket my_bucket \
        --output_s3_folder s3/folder \
    none \
    fetch \
        --args url=ldap://myldap.example.com:389 bind_dn="cn=admin,dc=example,dc=com" bind_password="password" search_base="dc=example,dc=com" search_filter="(objectClass=person)" attributes=["cn", "givenName", "sn"]

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_ldap_spout:
        name: "LDAP"
        method: "fetch"
        args:
            url: "ldap://myldap.example.com:389"
            bind_dn: "cn=admin,dc=example,dc=com"
            bind_password: "password"
            search_base: "dc=example,dc=com"
            search_filter: "(objectClass=person)"
            attributes: ["cn", "givenName", "sn"]
        output:
            type: "batch"
            args:
                bucket: "my_bucket"
                s3_folder: "s3/folder"

fetch(url, bind_dn, bind_password, search_base, search_filter, attributes)

📖 Fetch data from an LDAP server and save it in batch.

Parameters:

Name Type Description Default
url str

The LDAP URL.

required
bind_dn str

The DN to bind as.

required
bind_password str

The password for the DN.

required
search_base str

The search base.

required
search_filter str

The search filter.

required
attributes list

The list of attributes to retrieve.

required

Raises:

Type Description
Exception

If unable to connect to the LDAP server or execute the search.