Services

Usage example

# Don't forget that Services requires created rdn='ou=Services'
# This you can create with OrganizationalUnits

from lib389.idm.organizationalunit import OrganizationalUnits
from lib389.idm.services import ServiceAccounts

ous = OrganizationalUnits(standalone, DEFAULT_SUFFIX)
services = ServiceAccounts(standalone, DEFAULT_SUFFIX)

# Create the OU for them
ous.create(properties={
        'ou': 'Services',
        'description': 'Computer Service accounts which request DS bind',
    })

# Now, we can create the services from here.
service = services.create(properties={
    'cn': 'testbind',
    'userPassword': 'Password1'
    })

conn = service.bind('Password1')
conn.unbind_s()

Module documentation

class lib389.idm.services.ServiceAccounts(instance, basedn, rdn='ou=Services')[source]

DSLdapObjects that represents Services entry By default it uses ‘ou=Services’ as rdn.

Parameters
  • instance (lib389.DirSrv) – An instance

  • basedn (str) – Base DN for all group entries below

class lib389.idm.services.ServiceAccount(instance, dn=None)[source]

A single instance of Service entry

Parameters
  • instance (lib389.DirSrv) – An instance

  • dn (str) – Entry DN