ecr.lifecycle-defaults.preview

What the default would expire across every inheriting repository, as if active

POST /ecr/api/lifecycle-defaults/previewIAM ecr:GetLifecyclePolicyRead

A dry run, nothing changes. Without a body it runs the saved default; with {"policy": …} it runs that draft instead. `images` lists every image (the first 5,000; `totalImages` counts all) with `action`, `reason` and `by`, what decided it.

Request syntax

POST /ecr/api/lifecycle-defaults/preview
{
  "policy": "object"
}

Request body

  • policyOptional

    object

    A draft default in ews-lifecycle/v1 to dry-run instead of the saved one. Omitted (or no body at all): the saved default, else the platform default

    Constraints: JSON

Response

200 with { source, mode, policy, repositories (how many inherit the default), wouldExpire { count, bytes }, kept, byRepository (the 50 repositories with the most bytes to expire: id, name, count, bytes), images (repositoryId, repositoryName, manifestId, label, action, reason, by, sizeBytes, pushedAt, lastPulledAt; the first 5,000) and totalImages }. Changes nothing.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow ecr:GetLifecyclePolicy on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud ecr lifecycle-defaults preview

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_ecr_lifecycle-defaults_preview.