list_image_referrers
async
¶
list_image_referrers(
repository_name: RepositoryName,
subject_id: SubjectIdentifier,
*,
config_overrides: Optional[AsyncECRClientConfig] = None,
registry_id: Optional[RegistryId] = None,
filter: Optional[ListImageReferrersFilter] = None,
next_token: Optional[NextToken] = None,
max_results: Optional[FiftyMaxResults] = None,
) -> ListImageReferrersResponse
Lists the artifacts associated with a specified subject image.
The IAM principal invoking this operation must have the ecr:BatchGetImage permission.
Parameters:
-
registry_id(Optional[RegistryId], default:None) –The Amazon Web Services account ID associated with the registry that contains the repository in which to list image referrers. If you do not specify a registry, the default registry is assumed.
-
repository_name(RepositoryName) –The name of the repository that contains the subject image.
-
subject_id(SubjectIdentifier) –An object containing the image digest of the subject image for which to retrieve associated artifacts.
-
filter(Optional[ListImageReferrersFilter], default:None) –The filter key and value with which to filter your
ListImageReferrersresults. If no filter is specified, only artifacts withACTIVEstatus are returned. -
next_token(Optional[NextToken], default:None) –The
nextTokenvalue returned from a previous paginatedListImageReferrersrequest wheremaxResultswas used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextTokenvalue. This value isnullwhen there are no more results to return.This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
-
max_results(Optional[FiftyMaxResults], default:None) –The maximum number of image referrer results returned by
ListImageReferrersin paginated output. When this parameter is used,ListImageReferrersonly returnsmaxResultsresults in a single page along with anextTokenresponse element. The remaining results of the initial request can be seen by sending anotherListImageReferrersrequest with the returnednextTokenvalue. This value can be between 1 and 50. If this parameter is not used, thenListImageReferrersreturns up to 20 results and anextTokenvalue, if applicable.
Raises:
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
RepositoryNotFoundException–The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.
-
ServerException–These errors are usually caused by a server-side issue.
-
UnableToListUpstreamImageReferrersException–The referrer or referrers were unable to be listed using the pull through cache rule. This is usually caused because of an issue with the Secrets Manager secret containing the credentials for the upstream registry.
-
ValidationException–There was an exception validating this request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To list both active and archived artifacts This example lists all artifacts including those that have been archived, by specifying the artifactStatus filter as ANY.
>>> await client.list_image_referrers(repository_name='sample-repo', subject_id={'imageDigest': 'sha256:943e640159415616581703a53fa4ed87e96740655fd67daf2d2146a35337bce5'}, filter={'artifactStatus': 'ANY'})
To list artifacts associated with a subject image
This example lists all artifacts (such as Sigstore signatures) that reference a specific container image in the sample-repo repository.
>>> await client.list_image_referrers(repository_name='sample-repo', subject_id={'imageDigest': 'sha256:943e640159415616581703a53fa4ed87e96740655fd67daf2d2146a35337bce5'})
To list artifacts of a specific type
This example lists only Sigstore bundle artifacts associated with a subject image by filtering on the artifact type.
>>> await client.list_image_referrers(repository_name='sample-repo', subject_id={'imageDigest': 'sha256:943e640159415616581703a53fa4ed87e96740655fd67daf2d2146a35337bce5'}, filter={'artifactTypes': ['application/vnd.dev.sigstore.bundle.v0.3+json']})
Source code in docs_src/capo_ecr/_services/async_ecr.py
2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 | |