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. boto3 documentation

# add_region method definition

def add_region(
    self,
    *,
    DirectoryId: str,
    RegionName: str,
    VPCSettings: DirectoryVpcSettingsTypeDef,  # (1)
) -> Dict[str, Any]:
    ...
  1. See DirectoryVpcSettingsTypeDef
# add_region method usage example with argument unpacking

kwargs: AddRegionRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "RegionName": ...,
    "VPCSettings": ...,
}

parent.add_region(**kwargs)
  1. See AddRegionRequestRequestTypeDef

add_tags_to_resource#

Adds or overwrites one or more tags for the specified directory.

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

# add_tags_to_resource method definition

def add_tags_to_resource(
    self,
    *,
    ResourceId: str,
    Tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TagTypeDef
# add_tags_to_resource method usage example with argument unpacking

kwargs: AddTagsToResourceRequestRequestTypeDef = {  # (1)
    "ResourceId": ...,
    "Tags": ...,
}

parent.add_tags_to_resource(**kwargs)
  1. See AddTagsToResourceRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

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

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

cancel_schema_extension#

Cancels an in-progress schema extension to a Microsoft AD directory.

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

# cancel_schema_extension method definition

def cancel_schema_extension(
    self,
    *,
    DirectoryId: str,
    SchemaExtensionId: str,
) -> Dict[str, Any]:
    ...
# cancel_schema_extension method usage example with argument unpacking

kwargs: CancelSchemaExtensionRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "SchemaExtensionId": ...,
}

parent.cancel_schema_extension(**kwargs)
  1. See CancelSchemaExtensionRequestRequestTypeDef

close#

Closes underlying endpoint connections.

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

# close method definition

def close(
    self,
) -> None:
    ...

connect_directory#

Creates an AD Connector to connect to a self-managed directory.

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

# connect_directory method definition

def connect_directory(
    self,
    *,
    Name: str,
    Password: str,
    Size: DirectorySizeType,  # (1)
    ConnectSettings: DirectoryConnectSettingsTypeDef,  # (2)
    ShortName: str = ...,
    Description: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (3)
) -> ConnectDirectoryResultTypeDef:  # (4)
    ...
  1. See DirectorySizeType
  2. See DirectoryConnectSettingsTypeDef
  3. See TagTypeDef
  4. See ConnectDirectoryResultTypeDef
# connect_directory method usage example with argument unpacking

kwargs: ConnectDirectoryRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "Password": ...,
    "Size": ...,
    "ConnectSettings": ...,
}

parent.connect_directory(**kwargs)
  1. See ConnectDirectoryRequestRequestTypeDef

create_alias#

Creates an alias for a directory and assigns the alias to the directory.

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

# create_alias method definition

def create_alias(
    self,
    *,
    DirectoryId: str,
    Alias: str,
) -> CreateAliasResultTypeDef:  # (1)
    ...
  1. See CreateAliasResultTypeDef
# create_alias method usage example with argument unpacking

kwargs: CreateAliasRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "Alias": ...,
}

parent.create_alias(**kwargs)
  1. See CreateAliasRequestRequestTypeDef

create_computer#

Creates an Active Directory computer object in the specified directory.

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

# create_computer method definition

def create_computer(
    self,
    *,
    DirectoryId: str,
    ComputerName: str,
    Password: str,
    OrganizationalUnitDistinguishedName: str = ...,
    ComputerAttributes: Sequence[AttributeTypeDef] = ...,  # (1)
) -> CreateComputerResultTypeDef:  # (2)
    ...
  1. See AttributeTypeDef
  2. See CreateComputerResultTypeDef
# create_computer method usage example with argument unpacking

kwargs: CreateComputerRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "ComputerName": ...,
    "Password": ...,
}

parent.create_computer(**kwargs)
  1. See CreateComputerRequestRequestTypeDef

create_conditional_forwarder#

Creates a conditional forwarder associated with your Amazon Web Services directory.

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

# create_conditional_forwarder method definition

def create_conditional_forwarder(
    self,
    *,
    DirectoryId: str,
    RemoteDomainName: str,
    DnsIpAddrs: Sequence[str],
) -> Dict[str, Any]:
    ...
# create_conditional_forwarder method usage example with argument unpacking

kwargs: CreateConditionalForwarderRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "RemoteDomainName": ...,
    "DnsIpAddrs": ...,
}

parent.create_conditional_forwarder(**kwargs)
  1. See CreateConditionalForwarderRequestRequestTypeDef

create_directory#

Creates a Simple AD directory.

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

# create_directory method definition

def create_directory(
    self,
    *,
    Name: str,
    Password: str,
    Size: DirectorySizeType,  # (1)
    ShortName: str = ...,
    Description: str = ...,
    VpcSettings: DirectoryVpcSettingsTypeDef = ...,  # (2)
    Tags: Sequence[TagTypeDef] = ...,  # (3)
) -> CreateDirectoryResultTypeDef:  # (4)
    ...
  1. See DirectorySizeType
  2. See DirectoryVpcSettingsTypeDef
  3. See TagTypeDef
  4. See CreateDirectoryResultTypeDef
# create_directory method usage example with argument unpacking

kwargs: CreateDirectoryRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "Password": ...,
    "Size": ...,
}

parent.create_directory(**kwargs)
  1. See CreateDirectoryRequestRequestTypeDef

create_log_subscription#

Creates a subscription to forward real-time Directory Service domain controller security logs to the specified Amazon CloudWatch log group in your Amazon Web Services account.

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

# create_log_subscription method definition

def create_log_subscription(
    self,
    *,
    DirectoryId: str,
    LogGroupName: str,
) -> Dict[str, Any]:
    ...
# create_log_subscription method usage example with argument unpacking

kwargs: CreateLogSubscriptionRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "LogGroupName": ...,
}

parent.create_log_subscription(**kwargs)
  1. See CreateLogSubscriptionRequestRequestTypeDef

create_microsoft_ad#

Creates a Microsoft AD directory in the Amazon Web Services Cloud.

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

# create_microsoft_ad method definition

def create_microsoft_ad(
    self,
    *,
    Name: str,
    Password: str,
    VpcSettings: DirectoryVpcSettingsTypeDef,  # (1)
    ShortName: str = ...,
    Description: str = ...,
    Edition: DirectoryEditionType = ...,  # (2)
    Tags: Sequence[TagTypeDef] = ...,  # (3)
) -> CreateMicrosoftADResultTypeDef:  # (4)
    ...
  1. See DirectoryVpcSettingsTypeDef
  2. See DirectoryEditionType
  3. See TagTypeDef
  4. See CreateMicrosoftADResultTypeDef
# create_microsoft_ad method usage example with argument unpacking

kwargs: CreateMicrosoftADRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "Password": ...,
    "VpcSettings": ...,
}

parent.create_microsoft_ad(**kwargs)
  1. See CreateMicrosoftADRequestRequestTypeDef

create_snapshot#

Creates a snapshot of a Simple AD or Microsoft AD directory in the Amazon Web Services cloud.

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

# create_snapshot method definition

def create_snapshot(
    self,
    *,
    DirectoryId: str,
    Name: str = ...,
) -> CreateSnapshotResultTypeDef:  # (1)
    ...
  1. See CreateSnapshotResultTypeDef
# create_snapshot method usage example with argument unpacking

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

parent.create_snapshot(**kwargs)
  1. See CreateSnapshotRequestRequestTypeDef

create_trust#

Directory Service for Microsoft Active Directory allows you to configure trust relationships.

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

# create_trust method definition

def create_trust(
    self,
    *,
    DirectoryId: str,
    RemoteDomainName: str,
    TrustPassword: str,
    TrustDirection: TrustDirectionType,  # (1)
    TrustType: TrustTypeType = ...,  # (2)
    ConditionalForwarderIpAddrs: Sequence[str] = ...,
    SelectiveAuth: SelectiveAuthType = ...,  # (3)
) -> CreateTrustResultTypeDef:  # (4)
    ...
  1. See TrustDirectionType
  2. See TrustTypeType
  3. See SelectiveAuthType
  4. See CreateTrustResultTypeDef
# create_trust method usage example with argument unpacking

kwargs: CreateTrustRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "RemoteDomainName": ...,
    "TrustPassword": ...,
    "TrustDirection": ...,
}

parent.create_trust(**kwargs)
  1. See CreateTrustRequestRequestTypeDef

delete_conditional_forwarder#

Deletes a conditional forwarder that has been set up for your Amazon Web Services directory.

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

# delete_conditional_forwarder method definition

def delete_conditional_forwarder(
    self,
    *,
    DirectoryId: str,
    RemoteDomainName: str,
) -> Dict[str, Any]:
    ...
# delete_conditional_forwarder method usage example with argument unpacking

kwargs: DeleteConditionalForwarderRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "RemoteDomainName": ...,
}

parent.delete_conditional_forwarder(**kwargs)
  1. See DeleteConditionalForwarderRequestRequestTypeDef

delete_directory#

Deletes an Directory Service directory.

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

# delete_directory method definition

def delete_directory(
    self,
    *,
    DirectoryId: str,
) -> DeleteDirectoryResultTypeDef:  # (1)
    ...
  1. See DeleteDirectoryResultTypeDef
# delete_directory method usage example with argument unpacking

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

parent.delete_directory(**kwargs)
  1. See DeleteDirectoryRequestRequestTypeDef

delete_log_subscription#

Deletes the specified log subscription.

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

# delete_log_subscription method definition

def delete_log_subscription(
    self,
    *,
    DirectoryId: str,
) -> Dict[str, Any]:
    ...
# delete_log_subscription method usage example with argument unpacking

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

parent.delete_log_subscription(**kwargs)
  1. See DeleteLogSubscriptionRequestRequestTypeDef

delete_snapshot#

Deletes a directory snapshot.

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

# delete_snapshot method definition

def delete_snapshot(
    self,
    *,
    SnapshotId: str,
) -> DeleteSnapshotResultTypeDef:  # (1)
    ...
  1. See DeleteSnapshotResultTypeDef
# delete_snapshot method usage example with argument unpacking

kwargs: DeleteSnapshotRequestRequestTypeDef = {  # (1)
    "SnapshotId": ...,
}

parent.delete_snapshot(**kwargs)
  1. See DeleteSnapshotRequestRequestTypeDef

delete_trust#

Deletes an existing trust relationship between your Managed Microsoft AD directory and an external domain.

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

# delete_trust method definition

def delete_trust(
    self,
    *,
    TrustId: str,
    DeleteAssociatedConditionalForwarder: bool = ...,
) -> DeleteTrustResultTypeDef:  # (1)
    ...
  1. See DeleteTrustResultTypeDef
# delete_trust method usage example with argument unpacking

kwargs: DeleteTrustRequestRequestTypeDef = {  # (1)
    "TrustId": ...,
}

parent.delete_trust(**kwargs)
  1. See DeleteTrustRequestRequestTypeDef

deregister_certificate#

Deletes from the system the certificate that was registered for secure LDAP or client certificate authentication.

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

# deregister_certificate method definition

def deregister_certificate(
    self,
    *,
    DirectoryId: str,
    CertificateId: str,
) -> Dict[str, Any]:
    ...
# deregister_certificate method usage example with argument unpacking

kwargs: DeregisterCertificateRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "CertificateId": ...,
}

parent.deregister_certificate(**kwargs)
  1. See DeregisterCertificateRequestRequestTypeDef

deregister_event_topic#

Removes the specified directory as a publisher to the specified Amazon SNS topic.

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

# deregister_event_topic method definition

def deregister_event_topic(
    self,
    *,
    DirectoryId: str,
    TopicName: str,
) -> Dict[str, Any]:
    ...
# deregister_event_topic method usage example with argument unpacking

kwargs: DeregisterEventTopicRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "TopicName": ...,
}

parent.deregister_event_topic(**kwargs)
  1. See DeregisterEventTopicRequestRequestTypeDef

describe_certificate#

Displays information about the certificate registered for secure LDAP or client certificate authentication.

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

# describe_certificate method definition

def describe_certificate(
    self,
    *,
    DirectoryId: str,
    CertificateId: str,
) -> DescribeCertificateResultTypeDef:  # (1)
    ...
  1. See DescribeCertificateResultTypeDef
# describe_certificate method usage example with argument unpacking

kwargs: DescribeCertificateRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "CertificateId": ...,
}

parent.describe_certificate(**kwargs)
  1. See DescribeCertificateRequestRequestTypeDef

describe_client_authentication_settings#

Retrieves information about the type of client authentication for the specified directory, if the type is specified.

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

# describe_client_authentication_settings method definition

def describe_client_authentication_settings(
    self,
    *,
    DirectoryId: str,
    Type: ClientAuthenticationTypeType = ...,  # (1)
    NextToken: str = ...,
    Limit: int = ...,
) -> DescribeClientAuthenticationSettingsResultTypeDef:  # (2)
    ...
  1. See ClientAuthenticationTypeType
  2. See DescribeClientAuthenticationSettingsResultTypeDef
# describe_client_authentication_settings method usage example with argument unpacking

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

parent.describe_client_authentication_settings(**kwargs)
  1. See DescribeClientAuthenticationSettingsRequestRequestTypeDef

describe_conditional_forwarders#

Obtains information about the conditional forwarders for this account.

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

# describe_conditional_forwarders method definition

def describe_conditional_forwarders(
    self,
    *,
    DirectoryId: str,
    RemoteDomainNames: Sequence[str] = ...,
) -> DescribeConditionalForwardersResultTypeDef:  # (1)
    ...
  1. See DescribeConditionalForwardersResultTypeDef
# describe_conditional_forwarders method usage example with argument unpacking

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

parent.describe_conditional_forwarders(**kwargs)
  1. See DescribeConditionalForwardersRequestRequestTypeDef

describe_directories#

Obtains information about the directories that belong to this account.

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