---
title: "POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview"
method: POST
path: "/#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview"
---

# POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview

`POST /#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview`

Retrieves the results of the lifecycle policy preview request for the specified repository.

## Query parameters

- `maxResults` string
- `nextToken` string

## Headers

- `X-Amz-Target` 'AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview', required

## Request body

- GetLifecyclePolicyPreviewRequest
  - `registryId` string — The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
  - `repositoryName` string, required — The name of the repository.
  - `imageIds` ImageIdentifier[] — The list of imageIDs to be included.
    - `imageDigest` string — The <code>sha256</code> digest of the image manifest.
    - `imageTag` string — The tag used for the image.
  - `nextToken` string — The <code>nextToken</code> value returned from a previous paginated&#x2028; <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code> was used and the&#x2028; results exceeded the value of that parameter. Pagination continues from the end of the&#x2028; previous results that returned the <code>nextToken</code> value. This value is&#x2028; <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.
  - `maxResults` integer — The maximum number of repository results returned by <code>GetLifecyclePolicyPreviewRequest</code> in&#x2028; paginated output. When this parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns&#x2028; <code>maxResults</code> results in a single page along with a <code>nextToken</code>&#x2028; response element. The remaining results of the initial request can be seen by sending&#x2028; another <code>GetLifecyclePolicyPreviewRequest</code> request with the returned <code>nextToken</code>&#x2028; value. This value can be between 1 and 1000. If this&#x2028; parameter is not used, then <code>GetLifecyclePolicyPreviewRequest</code> returns up to&#x2028; 100 results and a <code>nextToken</code> value, if&#x2028; applicable. This option cannot be used when you specify images with <code>imageIds</code>.
  - `filter` object — An optional parameter that filters results based on image tag status and all tags, if tagged.
    - `tagStatus` 'TAGGED' | 'UNTAGGED' | 'ANY' — The tag status of the image.

## Response `200`

Success

- GetLifecyclePolicyPreviewResponse
  - `registryId` string — The registry ID associated with the request.
  - `repositoryName` string — The repository name associated with the request.
  - `lifecyclePolicyText` string — The JSON lifecycle policy text.
  - `status` 'IN_PROGRESS' | 'COMPLETE' | 'EXPIRED' | 'FAILED' — The status of the lifecycle policy preview request.
  - `nextToken` string — The <code>nextToken</code> value to include in a future <code>GetLifecyclePolicyPreview</code> request. When the results of a <code>GetLifecyclePolicyPreview</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.
  - `previewResults` LifecyclePolicyPreviewResult[] — The results of the lifecycle policy preview request.
    - `imageTags` ImageTag[] — The list of tags associated with this image.
    - `imageDigest` string — The <code>sha256</code> digest of the image manifest.
    - `imagePushedAt` string, date-time — The date and time, expressed in standard JavaScript date format, at which the current image was pushed to the repository.
    - `action` object — The type of action to be taken.
      - `type` 'EXPIRE' — The type of action to be taken.
    - `appliedRulePriority` integer — The priority of the applied rule.
  - `summary` object — The list of images that is returned as a result of the action.
    - `expiringImageTotalCount` integer — The number of expiring images.

## Other responses

- `480` — ServerException
- `481` — InvalidParameterException
- `482` — RepositoryNotFoundException
- `483` — LifecyclePolicyPreviewNotFoundException

---

[API](https://skmtc.net/aws/apis/ecr.md) · [All operations](https://skmtc.net/aws/apis/ecr/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/ecr/versions/965cbb14e137/schema)
