Skip to content

update_asset_owner

update_asset_owner(
    domain_identifier: DomainId,
    identifier: AssetIdentifier,
    target_project_identifier: ProjectId,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateAssetOwnerOutput

Transfers the ownership of an asset to another project in the same Amazon DataZone domain. The transfer changes the asset's owning project and moves its published listing, subscriptions, and subscription grants to the target project.

The transfer runs asynchronously, and the operation returns HTTP status code 202. To follow the transfer, call GetAsset and check ownershipTransfer.status until it is SUCCEEDED or FAILED.

You need to be an owner of the project that currently owns the asset. You can transfer an asset from the domain's administration project to any project. You can also transfer an asset from any project to the administration project.

An asset can have only one ownership transfer in progress at a time. While a transfer is in progress, requests that change the asset or its listing fail with a ConflictException.

Parameters:

  • domain_identifier (DomainId) –

    The ID of the Amazon DataZone domain that contains the asset.

  • identifier (AssetIdentifier) –

    The ID of the asset whose ownership is transferred.

  • target_project_identifier (ProjectId) –

    The ID of the project that the asset is transferred to. The project must be in the same domain and must be different from the project that currently owns the asset.

    If the domain's administration project owns the asset, the target can be any project. Otherwise, the target must be the administration project.

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

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request while its transfer is in progress, the service returns that transfer and doesn't start a new one. This field is automatically populated if not provided.

Raises:

Source code in docs_src/capo_datazone/_services/data_zone.py
def update_asset_owner(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    identifier: "capo_datazone.types.asset_identifier.AssetIdentifier",
    target_project_identifier: "capo_datazone.types.project_id.ProjectId",
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    client_token: Optional["capo_datazone.types.client_token.ClientToken"] = None,
) -> "capo_datazone.types.update_asset_owner_output.UpdateAssetOwnerOutput":
    """<p>Transfers the ownership of an asset to another project in the same Amazon DataZone domain. The transfer changes the asset's owning project and moves its published listing, subscriptions, and subscription grants to the target project.</p> <p>The transfer runs asynchronously, and the operation returns HTTP status code 202. To follow the transfer, call <code>GetAsset</code> and check <code>ownershipTransfer.status</code> until it is <code>SUCCEEDED</code> or <code>FAILED</code>.</p> <p>You need to be an owner of the project that currently owns the asset. You can transfer an asset from the domain's administration project to any project. You can also transfer an asset from any project to the administration project.</p> <p>An asset can have only one ownership transfer in progress at a time. While a transfer is in progress, requests that change the asset or its listing fail with a <code>ConflictException</code>.</p>

    Args:
        domain_identifier: <p>The ID of the Amazon DataZone domain that contains the asset.</p>
        identifier: <p>The ID of the asset whose ownership is transferred.</p>
        target_project_identifier: <p>The ID of the project that the asset is transferred to. The project must be in the same domain and must be different from the project that currently owns the asset.</p> <p>If the domain's administration project owns the asset, the target can be any project. Otherwise, the target must be the administration project.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request while its transfer is in progress, the service returns that transfer and doesn't start a new one. This field is automatically populated if not provided.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request has exceeded the specified service quota.</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.
    """

    def _handler(
        req: "OperationRequest[capo_datazone.types.update_asset_owner_input.UpdateAssetOwnerInput]",
    ) -> OperationResponse[
        "capo_datazone.types.update_asset_owner_output.UpdateAssetOwnerOutput"
    ]:
        import capo_datazone._operations.data_zone.update_asset_owner

        output, http_response = (
            capo_datazone._operations.data_zone.update_asset_owner.update_asset_owner(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAssetOwner")
    )
    input_: capo_datazone.types.update_asset_owner_input.UpdateAssetOwnerInput = {
        "domain_identifier": domain_identifier,
        "identifier": identifier,
        "target_project_identifier": target_project_identifier,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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