Skip to content

cancel_schema_extension

cancel_schema_extension(
    directory_id: DirectoryId,
    schema_extension_id: SchemaExtensionId,
    *,
    config_overrides: Optional[DirectoryServiceClientConfig] = None,
) -> CancelSchemaExtensionResult

Cancels an in-progress schema extension to a Microsoft AD directory. Once a schema extension has started replicating to all domain controllers, the task can no longer be canceled. A schema extension can be canceled during any of the following states; Initializing, CreatingSnapshot, and UpdatingSchema.

Parameters:

  • directory_id (DirectoryId) –

    The identifier of the directory whose schema extension will be canceled.

  • schema_extension_id (SchemaExtensionId) –

    The identifier of the schema extension that will be canceled.

Raises:

Examples:

To cancel a Microsoft AD schema extension that is in progress The following example cancels an in-progress schema extension to a Microsoft AD directory.

>>> client.cancel_schema_extension(directory_id='d-92654abfed', schema_extension_id='e-926731d2a0')
Source code in docs_src/capo_directory_service/_services/directory_service.py
def cancel_schema_extension(
    self,
    directory_id: "capo_directory_service.types.directory_id.DirectoryId",
    schema_extension_id: "capo_directory_service.types.schema_extension_id.SchemaExtensionId",
    *,
    config_overrides: Optional[DirectoryServiceClientConfig] = None,
) -> "capo_directory_service.types.cancel_schema_extension_result.CancelSchemaExtensionResult":
    """<p>Cancels an in-progress schema extension to a Microsoft AD directory. Once a schema extension has started replicating to all domain controllers, the task can no longer be canceled. A schema extension can be canceled during any of the following states; <code>Initializing</code>, <code>CreatingSnapshot</code>, and <code>UpdatingSchema</code>.</p>

    Args:
        directory_id: <p>The identifier of the directory whose schema extension will be canceled.</p>
        schema_extension_id: <p>The identifier of the schema extension that will be canceled.</p>

    Raises:
        capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
        capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
        capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
        capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To cancel a Microsoft AD schema extension that is in progress
        The following example cancels an in-progress schema extension to a Microsoft AD directory.

        >>> client.cancel_schema_extension(directory_id='d-92654abfed', schema_extension_id='e-926731d2a0')
    """

    def _handler(
        req: "OperationRequest[capo_directory_service.types.cancel_schema_extension_request.CancelSchemaExtensionRequest]",
    ) -> OperationResponse[
        "capo_directory_service.types.cancel_schema_extension_result.CancelSchemaExtensionResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.cancel_schema_extension

        output, http_response = (
            capo_directory_service._operations.directory_service_20150416.cancel_schema_extension.cancel_schema_extension(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelSchemaExtension")
    )
    input_: capo_directory_service.types.cancel_schema_extension_request.CancelSchemaExtensionRequest = {
        "directory_id": directory_id,
        "schema_extension_id": schema_extension_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output