Skip to content

create_asset_revision async

create_asset_revision(
    name: AssetName,
    domain_identifier: DomainId,
    identifier: AssetIdentifier,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    type_revision: Optional[Revision] = None,
    description: Optional[Description] = None,
    glossary_terms: Optional[GlossaryTerms] = None,
    forms_input: Optional[FormInputList] = None,
    prediction_configuration: Optional[PredictionConfiguration] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateAssetRevisionOutput

Creates a revision of the asset.

Asset revisions represent new versions of existing assets, capturing changes to either the underlying data or its metadata. They maintain a historical record of how assets evolve over time, who made changes, and when those changes occurred. This versioning capability is crucial for governance and compliance, allowing organizations to track changes, understand their impact, and roll back if necessary.

Prerequisites:

  • Asset must already exist in the domain with identifier.

  • formsInput is required when asset has the form type. typeRevision should be the latest version of form type.

  • The form content must include all required fields (e.g., bucketArn for S3ObjectCollectionForm).

  • The owning project of the original asset must still exist and be active.

  • User must have write access to the project and domain.

Parameters:

  • name (AssetName) –

    Te revised name of the asset.

  • domain_identifier (DomainId) –

    The unique identifier of the domain where the asset is being revised.

  • identifier (AssetIdentifier) –

    The identifier of the asset.

  • type_revision (Optional[Revision], default: None ) –

    The revision type of the asset.

  • description (Optional[Description], default: None ) –

    The revised description of the asset.

  • glossary_terms (Optional[GlossaryTerms], default: None ) –

    The glossary terms to be attached to the asset as part of asset revision.

  • forms_input (Optional[FormInputList], default: None ) –

    The metadata forms to be attached to the asset as part of asset revision.

  • prediction_configuration (Optional[PredictionConfiguration], default: None ) –

    The configuration of the automatically generated business-friendly metadata for the asset.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def create_asset_revision(
    self,
    name: "capo_datazone.types.asset_name.AssetName",
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    identifier: "capo_datazone.types.asset_identifier.AssetIdentifier",
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    type_revision: Optional["capo_datazone.types.revision.Revision"] = None,
    description: Optional["capo_datazone.types.description.Description"] = None,
    glossary_terms: Optional[
        "capo_datazone.types.glossary_terms.GlossaryTerms"
    ] = None,
    forms_input: Optional[
        "capo_datazone.types.form_input_list.FormInputList"
    ] = None,
    prediction_configuration: Optional[
        "capo_datazone.types.prediction_configuration.PredictionConfiguration"
    ] = None,
    client_token: Optional["capo_datazone.types.client_token.ClientToken"] = None,
) -> "capo_datazone.types.create_asset_revision_output.CreateAssetRevisionOutput":
    """<p>Creates a revision of the asset.</p> <p>Asset revisions represent new versions of existing assets, capturing changes to either the underlying data or its metadata. They maintain a historical record of how assets evolve over time, who made changes, and when those changes occurred. This versioning capability is crucial for governance and compliance, allowing organizations to track changes, understand their impact, and roll back if necessary.</p> <p>Prerequisites:</p> <ul> <li> <p>Asset must already exist in the domain with identifier. </p> </li> <li> <p> <code>formsInput</code> is required when asset has the form type. <code>typeRevision</code> should be the latest version of form type. </p> </li> <li> <p>The form content must include all required fields (e.g., <code>bucketArn</code> for <code>S3ObjectCollectionForm</code>).</p> </li> <li> <p>The owning project of the original asset must still exist and be active.</p> </li> <li> <p>User must have write access to the project and domain.</p> </li> </ul>

    Args:
        name: <p>Te revised name of the asset.</p>
        domain_identifier: <p>The unique identifier of the domain where the asset is being revised.</p>
        identifier: <p>The identifier of the asset.</p>
        type_revision: <p>The revision type of the asset.</p>
        description: <p>The revised description of the asset.</p>
        glossary_terms: <p>The glossary terms to be attached to the asset as part of asset revision.</p>
        forms_input: <p>The metadata forms to be attached to the asset as part of asset revision.</p>
        prediction_configuration: <p>The configuration of the automatically generated business-friendly metadata for the asset.</p>
        client_token: <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.conflict_exception.ConflictException: <p>There is a conflict while performing this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datazone.types.create_asset_revision_input.CreateAssetRevisionInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.create_asset_revision_output.CreateAssetRevisionOutput"
    ]:
        import capo_datazone._operations.data_zone.create_asset_revision

        (
            output,
            http_response,
        ) = await capo_datazone._operations.data_zone.create_asset_revision.async_create_asset_revision(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datazone.types.create_asset_revision_input.CreateAssetRevisionInput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_asset_revision_input

        return capo_datazone.types.create_asset_revision_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_datazone.types.create_asset_revision_output.CreateAssetRevisionOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_asset_revision_output

        return capo_datazone.types.create_asset_revision_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateAssetRevision",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.create_asset_revision_input.CreateAssetRevisionInput = {
        "name": name,
        "domain_identifier": domain_identifier,
        "identifier": identifier,
    }
    if type_revision is not None:
        input_["type_revision"] = type_revision
    if description is not None:
        input_["description"] = description
    if glossary_terms is not None:
        input_["glossary_terms"] = glossary_terms
    if forms_input is not None:
        input_["forms_input"] = forms_input
    if prediction_configuration is not None:
        input_["prediction_configuration"] = prediction_configuration
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output