DeleteArtifactCommand

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

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SageMakerClient, DeleteArtifactCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
// const { SageMakerClient, DeleteArtifactCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
const client = new SageMakerClient(config);
const input = { // DeleteArtifactRequest
  ArtifactArn: "STRING_VALUE",
  Source: { // ArtifactSource
    SourceUri: "STRING_VALUE", // required
    SourceTypes: [ // ArtifactSourceTypes
      { // ArtifactSourceType
        SourceIdType: "MD5Hash" || "S3ETag" || "S3Version" || "Custom", // required
        Value: "STRING_VALUE", // required
      },
    ],
  },
};
const command = new DeleteArtifactCommand(input);
const response = await client.send(command);
// { // DeleteArtifactResponse
//   ArtifactArn: "STRING_VALUE",
// };

DeleteArtifactCommand Input

See DeleteArtifactCommandInput for more details

Parameter
Type
Description
ArtifactArn
string | undefined

The Amazon Resource Name (ARN) of the artifact to delete.

Source
ArtifactSource | undefined

The URI of the source.

DeleteArtifactCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
ArtifactArn
string | undefined

The Amazon Resource Name (ARN) of the artifact.

Throws

Name
Fault
Details
ResourceNotFound
client

Resource being access is not found.

SageMakerServiceException
Base exception class for all service exceptions from SageMaker service.