Skip to content

delete_artifact

delete_artifact(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    artifact_arn: Optional[ArtifactArn] = None,
    source: Optional[ArtifactSource] = None,
) -> DeleteArtifactResponse

Deletes an artifact. Either ArtifactArn or Source must be specified.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def delete_artifact(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    artifact_arn: Optional["capo_sagemaker.types.artifact_arn.ArtifactArn"] = None,
    source: Optional["capo_sagemaker.types.artifact_source.ArtifactSource"] = None,
) -> "capo_sagemaker.types.delete_artifact_response.DeleteArtifactResponse":
    """<p>Deletes an artifact. Either <code>ArtifactArn</code> or <code>Source</code> must be specified.</p>

    Args:
        artifact_arn: <p>The Amazon Resource Name (ARN) of the artifact to delete.</p>
        source: <p>The URI of the source.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.delete_artifact_request.DeleteArtifactRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.delete_artifact_response.DeleteArtifactResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.delete_artifact

        output, http_response = (
            capo_sagemaker._operations.sage_maker.delete_artifact.delete_artifact(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteArtifact")
    )
    input_: capo_sagemaker.types.delete_artifact_request.DeleteArtifactRequest = {}
    if artifact_arn is not None:
        input_["artifact_arn"] = artifact_arn
    if source is not None:
        input_["source"] = source

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