Skip to content

remove_region async

remove_region(
    directory_id: DirectoryId,
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
) -> RemoveRegionResult

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/async_directory_service.py
async def remove_region(
    self,
    directory_id: "capo_directory_service.types.directory_id.DirectoryId",
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_directory_service.types.remove_region_request.RemoveRegionRequest]",
    ) -> AsyncOperationResponse[
        "capo_directory_service.types.remove_region_result.RemoveRegionResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.remove_region

        (
            output,
            http_response,
        ) = await capo_directory_service._operations.directory_service_20150416.remove_region.async_remove_region(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output