Stops all replication and removes the domain controllers from the specified Region. You cannot remove the primary Region with this operation. Instead, use the DeleteDirectory API.
Parameters:
-
directory_id
(DirectoryId)
–
The identifier of the directory for which you want to remove Region replication.
Raises:
Source code in docs_src/capo_directory_service/_services/directory_service.py
| def remove_region(
self,
directory_id: "capo_directory_service.types.directory_id.DirectoryId",
*,
config_overrides: Optional[DirectoryServiceClientConfig] = None,
) -> "capo_directory_service.types.remove_region_result.RemoveRegionResult":
"""<p>Stops all replication and removes the domain controllers from the specified Region. You cannot remove the primary Region with this operation. Instead, use the <code>DeleteDirectory</code> API.</p>
Args:
directory_id: <p>The identifier of the directory for which you want to remove Region replication.</p>
Raises:
capo_directory_service.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
capo_directory_service.errors.directory_does_not_exist_exception.DirectoryDoesNotExistException: <p>The specified directory does not exist in the system.</p>
capo_directory_service.errors.directory_unavailable_exception.DirectoryUnavailableException: <p>The specified directory is unavailable.</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.remove_region_request.RemoveRegionRequest]",
) -> OperationResponse[
"capo_directory_service.types.remove_region_result.RemoveRegionResult"
]:
import capo_directory_service._operations.directory_service_20150416.remove_region
output, http_response = (
capo_directory_service._operations.directory_service_20150416.remove_region.remove_region(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("RemoveRegion")
)
input_: capo_directory_service.types.remove_region_request.RemoveRegionRequest = {
"directory_id": directory_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|