Skip to content

DirectoryServiceClient#

Index > DirectoryService > DirectoryServiceClient

Auto-generated documentation for DirectoryService type annotations stubs module mypy-boto3-ds.

DirectoryServiceClient#

Type annotations and code completion for boto3.client("ds"). boto3 documentation

# DirectoryServiceClient usage example

from boto3.session import Session
from mypy_boto3_ds.client import DirectoryServiceClient

def get_ds_client() -> DirectoryServiceClient:
    return Session().client("ds")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("ds").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("ds")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.AuthenticationFailedException,
    client.exceptions.CertificateAlreadyExistsException,
    client.exceptions.CertificateDoesNotExistException,
    client.exceptions.CertificateInUseException,
    client.exceptions.CertificateLimitExceededException,
    client.exceptions.ClientError,
    client.exceptions.ClientException,
    client.exceptions.DirectoryAlreadyInRegionException,
    client.exceptions.DirectoryAlreadySharedException,
    client.exceptions.DirectoryDoesNotExistException,
    client.exceptions.DirectoryInDesiredStateException,
    client.exceptions.DirectoryLimitExceededException,
    client.exceptions.DirectoryNotSharedException,
    client.exceptions.DirectoryUnavailableException,
    client.exceptions.DomainControllerLimitExceededException,
    client.exceptions.EntityAlreadyExistsException,
    client.exceptions.EntityDoesNotExistException,
    client.exceptions.IncompatibleSettingsException,
    client.exceptions.InsufficientPermissionsException,
    client.exceptions.InvalidCertificateException,
    client.exceptions.InvalidClientAuthStatusException,
    client.exceptions.InvalidLDAPSStatusException,
    client.exceptions.InvalidNextTokenException,
    client.exceptions.InvalidParameterException,
    client.exceptions.InvalidPasswordException,
    client.exceptions.InvalidTargetException,
    client.exceptions.IpRouteLimitExceededException,
    client.exceptions.NoAvailableCertificateException,
    client.exceptions.OrganizationsException,
    client.exceptions.RegionLimitExceededException,
    client.exceptions.ServiceException,
    client.exceptions.ShareLimitExceededException,
    client.exceptions.SnapshotLimitExceededException,
    client.exceptions.TagLimitExceededException,
    client.exceptions.UnsupportedOperationException,
    client.exceptions.UnsupportedSettingsException,
    client.exceptions.UserDoesNotExistException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_ds.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

accept_shared_directory#

Accepts a directory sharing request that was sent from the directory owner account.

Type annotations and code completion for boto3.client("ds").accept_shared_directory method. boto3 documentation

# accept_shared_directory method definition

def accept_shared_directory(
    self,
    *,
    SharedDirectoryId: str,
) -> AcceptSharedDirectoryResultTypeDef:  # (1)
    ...
  1. See AcceptSharedDirectoryResultTypeDef
# accept_shared_directory method usage example with argument unpacking

kwargs: AcceptSharedDirectoryRequestRequestTypeDef = {  # (1)
    "SharedDirectoryId": ...,
}

parent.accept_shared_directory(**kwargs)
  1. See AcceptSharedDirectoryRequestRequestTypeDef

add_ip_routes#

If the DNS server for your self-managed domain uses a publicly addressable IP address, you must add a CIDR address block to correctly route traffic to and from your Microsoft AD on Amazon Web Services.

Type annotations and code completion for boto3.client("ds").add_ip_routes method. boto3 documentation

# add_ip_routes method definition

def add_ip_routes(
    self,
    *,
    DirectoryId: str,
    IpRoutes: Sequence[IpRouteTypeDef],  # (1)
    UpdateSecurityGroupForDirectoryControllers: bool = ...,
) -> Dict[str, Any]:
    ...
  1. See IpRouteTypeDef
# add_ip_routes method usage example with argument unpacking

kwargs: AddIpRoutesRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "IpRoutes": ...,
}

parent.add_ip_routes(**kwargs)
  1. See AddIpRoutesRequestRequestTypeDef

add_region#

Adds two domain controllers in the specified Region for the specified directory.

Type annotations and code completion for boto3.client("ds").add_region method.