cterasdk.core.directoryservice module

cterasdk.core.directoryservice module#

class cterasdk.core.directoryservice.DirectoryService(portal)

Bases: BaseCommand

Portal Active Directory APIs

connect(domain, username, password, directory='ActiveDirectory', domain_controllers=None, ou=None, ssl=False, krb=False, mapping=None, acl=None, default='Disabled', fetch='Lazy')

Connect a Portal tenant to directory services

Parameters:
  • domain (str) – The directory services domain to connect to

  • username (str) – The user name to use when connecting to the active directory services

  • password (str) – The password to use when connecting to the active directory services

  • ou (str,optional) – The OU path to use when connecting to the active directory services, defaults to None

  • directory (cterasdk.core.enum.DirectoryServiceType,optional) – The directory service type, deafults to ‘ActiveDirectory’

  • domain_controllers (cterasdk.core.types.DomainControllers,optional) – Connect to a primary and a secondary domain controllers, defaults to None

  • ssl (bool,optional) – Connect using SSL, defaults to False

  • krb (bool,optional) – Connect using Kerberos, defaults to False

  • list[cterasdk.common.types.ADDomainIDMapping],optional – The directory services UID/GID mapping

  • acl (list[cterasdk.core.types.AccessControlEntry],optional) – List of access control entries and their associated roles

  • default (cterasdk.core.enum.Role) – Default role if no match applies, defaults to None

  • fetch (str,optional) – Configure identity fetching mode, defaults to ‘Lazy’

connected()
disconnect()

Disconnect a Portal tenant from directory services

domains()

Get domains

Return list(str):

List of names of all discovered domains

fetch(active_directory_accounts)

Instruct the Portal to fetch the provided Active Directory Accounts

Parameters:

active_directory_accounts (list[cterasdk.core.types.PortalAccount]) – List of Active Directory Accounts to fetch

Returns:

Response Code

get_access_control()

Retrieve directory services access control list

Returns:

List of access control entries

Return type:

list[cterasdk.core.types.AccessControlEntry]

get_advanced_mapping()

Retrieve directory services advanced mapping configuration

Returns:

A dictionary of domain mapping objects

Return type:

dict

get_connected_domain()

Get the connected domain information. Returns None if the Portal tenant is not connected to a domain

Return str:

The connected domain

get_default_role()

Retrieve the default role assigned when no access control entry match was found

set_access_control(acl=None, default=None)

Configure directory services access control

Parameters:
set_advanced_mapping(mapping)

Configure advanced mapping

Parameters:

mapping (list[cterasdk.common.types.ADDomainIDMapping]) – List of domains and their UID/GID mapping range