listImageReferrers
abstract suspend fun listImageReferrers(input: ListImageReferrersRequest): ListImageReferrersResponse
Lists the artifacts associated with a specified subject image.
Samples
import aws.sdk.kotlin.services.ecr.model.ArtifactStatusFilter
import aws.sdk.kotlin.services.ecr.model.ListImageReferrersFilter
import aws.sdk.kotlin.services.ecr.model.SubjectIdentifier
fun main() {
//sampleStart
// This example lists all artifacts including those that have been archived, by specifying the
// artifactStatus filter as ANY.
val resp = ecrClient.listImageReferrers {
repositoryName = "sample-repo"
subjectId = SubjectIdentifier {
imageDigest = "sha256:943e640159415616581703a53fa4ed87e96740655fd67daf2d2146a35337bce5"
}
filter = ListImageReferrersFilter {
artifactStatus = ArtifactStatusFilter.fromValue("ANY")
}
}
//sampleEnd
}import aws.sdk.kotlin.services.ecr.model.ArtifactStatusFilter
import aws.sdk.kotlin.services.ecr.model.ListImageReferrersFilter
import aws.sdk.kotlin.services.ecr.model.SubjectIdentifier
fun main() {
//sampleStart
// This example lists all artifacts (such as Sigstore signatures) that reference a specific container
// image in the sample repo repository.
val resp = ecrClient.listImageReferrers {
repositoryName = "sample-repo"
subjectId = SubjectIdentifier {
imageDigest = "sha256:943e640159415616581703a53fa4ed87e96740655fd67daf2d2146a35337bce5"
}
}
//sampleEnd
}import aws.sdk.kotlin.services.ecr.model.ArtifactStatusFilter
import aws.sdk.kotlin.services.ecr.model.ListImageReferrersFilter
import aws.sdk.kotlin.services.ecr.model.SubjectIdentifier
fun main() {
//sampleStart
// This example lists only Sigstore bundle artifacts associated with a subject image by filtering on
// the artifact type.
val resp = ecrClient.listImageReferrers {
repositoryName = "sample-repo"
subjectId = SubjectIdentifier {
imageDigest = "sha256:943e640159415616581703a53fa4ed87e96740655fd67daf2d2146a35337bce5"
}
filter = ListImageReferrersFilter {
artifactTypes = listOf<String>(
"application/vnd.dev.sigstore.bundle.v0.3+json"
)
}
}
//sampleEnd
}