Adds or removes domain controllers to or from the directory. Based on the difference between current value and new value (provided through this API call), domain controllers will be added or removed. It may take up to 45 minutes for any new domain controllers to become fully active once the requested number of domain controllers is updated. During this time, you cannot make another update request.
Parameters:
-
directory_id
(DirectoryId)
–
Identifier of the directory to which the domain controllers will be added or removed.
-
desired_number
(DesiredNumberOfDomainControllers)
–
The number of domain controllers desired in the directory.
Raises:
Source code in docs_src/capo_directory_service/_services/directory_service.py
| def update_number_of_domain_controllers(
self,
directory_id: "capo_directory_service.types.directory_id.DirectoryId",
desired_number: "capo_directory_service.types.desired_number_of_domain_controllers.DesiredNumberOfDomainControllers",
*,
config_overrides: Optional[DirectoryServiceClientConfig] = None,
) -> "capo_directory_service.types.update_number_of_domain_controllers_result.UpdateNumberOfDomainControllersResult":
"""<p>Adds or removes domain controllers to or from the directory. Based on the difference between current value and new value (provided through this API call), domain controllers will be added or removed. It may take up to 45 minutes for any new domain controllers to become fully active once the requested number of domain controllers is updated. During this time, you cannot make another update request.</p>
Args:
directory_id: <p>Identifier of the directory to which the domain controllers will be added or removed.</p>
desired_number: <p>The number of domain controllers desired in the directory.</p>
Raises:
capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
capo_directory_service.errors.directory_unavailable_exception.DirectoryUnavailableException: <p>The specified directory is unavailable.</p>
capo_directory_service.errors.domain_controller_limit_exceeded_exception.DomainControllerLimitExceededException: <p>The maximum allowed number of domain controllers per directory was exceeded. The default limit per directory is 20 domain controllers.</p>
capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
capo_directory_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
capo_directory_service.errors.unsupported_operation_exception.UnsupportedOperationException: <p>The operation is not supported.</p>
capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_directory_service.types.update_number_of_domain_controllers_request.UpdateNumberOfDomainControllersRequest]",
) -> OperationResponse[
"capo_directory_service.types.update_number_of_domain_controllers_result.UpdateNumberOfDomainControllersResult"
]:
import capo_directory_service._operations.directory_service_20150416.update_number_of_domain_controllers
output, http_response = (
capo_directory_service._operations.directory_service_20150416.update_number_of_domain_controllers.update_number_of_domain_controllers(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateNumberOfDomainControllers")
)
input_: capo_directory_service.types.update_number_of_domain_controllers_request.UpdateNumberOfDomainControllersRequest = {
"directory_id": directory_id,
"desired_number": desired_number,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|