Table of Contents
DirectoryService.
Client
¶A low-level client representing AWS Directory Service:
import boto3
client = boto3.client('ds')
These are the available methods:
can_paginate()
connect_directory()
create_alias()
create_computer()
create_directory()
create_snapshot()
delete_directory()
delete_snapshot()
describe_directories()
describe_snapshots()
disable_radius()
disable_sso()
enable_radius()
enable_sso()
generate_presigned_url()
get_directory_limits()
get_paginator()
get_snapshot_limits()
get_waiter()
restore_from_snapshot()
update_radius()
can_paginate
(operation_name)¶Check if an operation can be paginated.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Returns: | True if the operation can be paginated,
False otherwise. |
connect_directory
(**kwargs)¶Creates an AD Connector to connect an on-premises directory.
Request Syntax
response = client.connect_directory(
Name='string',
ShortName='string',
Password='string',
Description='string',
Size='Small'|'Large',
ConnectSettings={
'VpcId': 'string',
'SubnetIds': [
'string',
],
'CustomerDnsIps': [
'string',
],
'CustomerUserName': 'string'
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'DirectoryId': 'string'
}
Response Structure
|
create_alias
(**kwargs)¶Creates an alias for a directory and assigns the alias to the directory. The alias is used to construct the access URL for the directory, such as http://alias.awsapps.com
.
Warning
After an alias has been created, it cannot be deleted or reused, so this operation should only be used when absolutely necessary.
Request Syntax
response = client.create_alias(
DirectoryId='string',
Alias='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'DirectoryId': 'string',
'Alias': 'string'
}
Response Structure
|
create_computer
(**kwargs)¶Creates a computer account in the specified directory, and joins the computer to the directory.
Request Syntax
response = client.create_computer(
DirectoryId='string',
ComputerName='string',
Password='string',
OrganizationalUnitDistinguishedName='string',
ComputerAttributes=[
{
'Name': 'string',
'Value': 'string'
},
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'Computer': {
'ComputerId': 'string',
'ComputerName': 'string',
'ComputerAttributes': [
{
'Name': 'string',
'Value': 'string'
},
]
}
}
Response Structure
|
create_directory
(**kwargs)¶Creates a Simple AD directory.
Request Syntax
response = client.create_directory(
Name='string',
ShortName='string',
Password='string',
Description='string',
Size='Small'|'Large',
VpcSettings={
'VpcId': 'string',
'SubnetIds': [
'string',
]
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'DirectoryId': 'string'
}
Response Structure
|
create_snapshot
(**kwargs)¶Creates a snapshot of an existing directory.
You cannot take snapshots of extended or connected directories.
Request Syntax
response = client.create_snapshot(
DirectoryId='string',
Name='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'SnapshotId': 'string'
}
Response Structure
|
delete_directory
(**kwargs)¶Deletes an AWS Directory Service directory.
Request Syntax
response = client.delete_directory(
DirectoryId='string'
)
Parameters: | DirectoryId (string) -- [REQUIRED] The identifier of the directory to delete. |
---|---|
Return type: | dict |
Returns: | Response Syntax{
'DirectoryId': 'string'
}
Response Structure
|
delete_snapshot
(**kwargs)¶Deletes a directory snapshot.
Request Syntax
response = client.delete_snapshot(
SnapshotId='string'
)
Parameters: | SnapshotId (string) -- [REQUIRED] The identifier of the directory snapshot to be deleted. |
---|---|
Return type: | dict |
Returns: | Response Syntax{
'SnapshotId': 'string'
}
Response Structure
|
describe_directories
(**kwargs)¶Obtains information about the directories that belong to this account.
You can retrieve information about specific directories by passing the directory identifiers in the DirectoryIds parameter. Otherwise, all directories that belong to the current account are returned.
This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeDirectoriesResult.NextToken member contains a token that you pass in the next call to DescribeDirectories to retrieve the next set of items.
You can also specify a maximum number of return results with the Limit parameter.
Request Syntax
response = client.describe_directories(
DirectoryIds=[
'string',
],
NextToken='string',
Limit=123
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'DirectoryDescriptions': [
{
'DirectoryId': 'string',
'Name': 'string',
'ShortName': 'string',
'Size': 'Small'|'Large',
'Alias': 'string',
'AccessUrl': 'string',
'Description': 'string',
'DnsIpAddrs': [
'string',
],
'Stage': 'Requested'|'Creating'|'Created'|'Active'|'Inoperable'|'Impaired'|'Restoring'|'RestoreFailed'|'Deleting'|'Deleted'|'Failed',
'LaunchTime': datetime(2015, 1, 1),
'StageLastUpdatedDateTime': datetime(2015, 1, 1),
'Type': 'SimpleAD'|'ADConnector',
'VpcSettings': {
'VpcId': 'string',
'SubnetIds': [
'string',
],
'SecurityGroupId': 'string',
'AvailabilityZones': [
'string',
]
},
'ConnectSettings': {
'VpcId': 'string',
'SubnetIds': [
'string',
],
'CustomerUserName': 'string',
'SecurityGroupId': 'string',
'AvailabilityZones': [
'string',
],
'ConnectIps': [
'string',
]
},
'RadiusSettings': {
'RadiusServers': [
'string',
],
'RadiusPort': 123,
'RadiusTimeout': 123,
'RadiusRetries': 123,
'SharedSecret': 'string',
'AuthenticationProtocol': 'PAP'|'CHAP'|'MS-CHAPv1'|'MS-CHAPv2',
'DisplayLabel': 'string',
'UseSameUsername': True|False
},
'RadiusStatus': 'Creating'|'Completed'|'Failed',
'StageReason': 'string',
'SsoEnabled': True|False
},
],
'NextToken': 'string'
}
Response Structure
|
describe_snapshots
(**kwargs)¶Obtains information about the directory snapshots that belong to this account.
This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeSnapshots.NextToken member contains a token that you pass in the next call to DescribeSnapshots to retrieve the next set of items.
You can also specify a maximum number of return results with the Limit parameter.
Request Syntax
response = client.describe_snapshots(
DirectoryId='string',
SnapshotIds=[
'string',
],
NextToken='string',
Limit=123
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'Snapshots': [
{
'DirectoryId': 'string',
'SnapshotId': 'string',
'Type': 'Auto'|'Manual',
'Name': 'string',
'Status': 'Creating'|'Completed'|'Failed',
'StartTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
disable_radius
(**kwargs)¶Disables multi-factor authentication (MFA) with Remote Authentication Dial In User Service (RADIUS) for an AD Connector directory.
Request Syntax
response = client.disable_radius(
DirectoryId='string'
)
Parameters: | DirectoryId (string) -- [REQUIRED] The identifier of the directory to disable MFA for. |
---|---|
Return type: | dict |
Returns: | Response Syntax{}
Response Structure
|
disable_sso
(**kwargs)¶Disables single-sign on for a directory.
Request Syntax
response = client.disable_sso(
DirectoryId='string',
UserName='string',
Password='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
enable_radius
(**kwargs)¶Enables multi-factor authentication (MFA) with Remote Authentication Dial In User Service (RADIUS) for an AD Connector directory.
Request Syntax
response = client.enable_radius(
DirectoryId='string',
RadiusSettings={
'RadiusServers': [
'string',
],
'RadiusPort': 123,
'RadiusTimeout': 123,
'RadiusRetries': 123,
'SharedSecret': 'string',
'AuthenticationProtocol': 'PAP'|'CHAP'|'MS-CHAPv1'|'MS-CHAPv2',
'DisplayLabel': 'string',
'UseSameUsername': True|False
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
enable_sso
(**kwargs)¶Enables single-sign on for a directory.
Request Syntax
response = client.enable_sso(
DirectoryId='string',
UserName='string',
Password='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
generate_presigned_url
(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
Parameters: |
|
---|---|
Returns: | The presigned url |
get_directory_limits
()¶Obtains directory limit information for the current region.
Request Syntax
response = client.get_directory_limits()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'DirectoryLimits': {
'CloudOnlyDirectoriesLimit': 123,
'CloudOnlyDirectoriesCurrentCount': 123,
'CloudOnlyDirectoriesLimitReached': True|False,
'ConnectedDirectoriesLimit': 123,
'ConnectedDirectoriesCurrentCount': 123,
'ConnectedDirectoriesLimitReached': True|False
}
}
Response Structure
|
get_paginator
(operation_name)¶Create a paginator for an operation.
Parameters: | operation_name (string) -- The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo , and you'd normally invoke the
operation as client.create_foo(**kwargs) , if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo") . |
---|---|
Raises OperationNotPageableError: | |
Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
|
Return type: | L{botocore.paginate.Paginator} |
Returns: | A paginator object. |
get_snapshot_limits
(**kwargs)¶Obtains the manual snapshot limits for a directory.
Request Syntax
response = client.get_snapshot_limits(
DirectoryId='string'
)
Parameters: | DirectoryId (string) -- [REQUIRED] Contains the identifier of the directory to obtain the limits for. |
---|---|
Return type: | dict |
Returns: | Response Syntax{
'SnapshotLimits': {
'ManualSnapshotsLimit': 123,
'ManualSnapshotsCurrentCount': 123,
'ManualSnapshotsLimitReached': True|False
}
}
Response Structure
|
get_waiter
(waiter_name)¶restore_from_snapshot
(**kwargs)¶Restores a directory using an existing directory snapshot.
When you restore a directory from a snapshot, any changes made to the directory after the snapshot date are overwritten.
This action returns as soon as the restore operation is initiated. You can monitor the progress of the restore operation by calling the DescribeDirectories operation with the directory identifier. When the DirectoryDescription.Stage value changes to Active
, the restore operation is complete.
Request Syntax
response = client.restore_from_snapshot(
SnapshotId='string'
)
Parameters: | SnapshotId (string) -- [REQUIRED] The identifier of the snapshot to restore from. |
---|---|
Return type: | dict |
Returns: | Response Syntax{}
Response Structure
|
update_radius
(**kwargs)¶Updates the Remote Authentication Dial In User Service (RADIUS) server information for an AD Connector directory.
Request Syntax
response = client.update_radius(
DirectoryId='string',
RadiusSettings={
'RadiusServers': [
'string',
],
'RadiusPort': 123,
'RadiusTimeout': 123,
'RadiusRetries': 123,
'SharedSecret': 'string',
'AuthenticationProtocol': 'PAP'|'CHAP'|'MS-CHAPv1'|'MS-CHAPv2',
'DisplayLabel': 'string',
'UseSameUsername': True|False
}
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|