Skip to content

get_lifecycle_policy_preview async

get_lifecycle_policy_preview(
    repository_name: RepositoryName,
    *,
    config_overrides: Optional[AsyncECRClientConfig] = None,
    registry_id: Optional[RegistryId] = None,
    image_ids: Optional[ImageIdentifierList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[LifecyclePreviewMaxResults] = None,
    filter: Optional[LifecyclePolicyPreviewFilter] = None,
) -> GetLifecyclePolicyPreviewResponse

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

Parameters:

  • registry_id (Optional[RegistryId], default: None ) –

    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.

  • repository_name (RepositoryName) –

    The name of the repository.

  • image_ids (Optional[ImageIdentifierList], default: None ) –

    The list of imageIDs to be included.

  • next_token (Optional[NextToken], default: None ) –

    The nextToken value returned from a previous paginated GetLifecyclePolicyPreviewRequest request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return. This option cannot be used when you specify images with imageIds.

  • max_results (Optional[LifecyclePreviewMaxResults], default: None ) –

    The maximum number of repository results returned by GetLifecyclePolicyPreviewRequest in paginated output. When this parameter is used, GetLifecyclePolicyPreviewRequest only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another GetLifecyclePolicyPreviewRequest request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, then GetLifecyclePolicyPreviewRequest returns up to 100 results and a nextToken value, if applicable. This option cannot be used when you specify images with imageIds.

  • filter (Optional[LifecyclePolicyPreviewFilter], default: None ) –

    An optional parameter that filters results based on image tag status and all tags, if tagged.

Raises:

Source code in docs_src/capo_ecr/_services/async_ecr.py
async def get_lifecycle_policy_preview(
    self,
    repository_name: "capo_ecr.types.repository_name.RepositoryName",
    *,
    config_overrides: Optional[AsyncECRClientConfig] = None,
    registry_id: Optional["capo_ecr.types.registry_id.RegistryId"] = None,
    image_ids: Optional[
        "capo_ecr.types.image_identifier_list.ImageIdentifierList"
    ] = None,
    next_token: Optional["capo_ecr.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_ecr.types.lifecycle_preview_max_results.LifecyclePreviewMaxResults"
    ] = None,
    filter: Optional[
        "capo_ecr.types.lifecycle_policy_preview_filter.LifecyclePolicyPreviewFilter"
    ] = None,
) -> "capo_ecr.types.get_lifecycle_policy_preview_response.GetLifecyclePolicyPreviewResponse":
    """<p>Retrieves the results of the lifecycle policy preview request for the specified repository.</p>

    Args:
        registry_id: <p>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.</p>
        repository_name: <p>The name of the repository.</p>
        image_ids: <p>The list of imageIDs to be included.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>GetLifecyclePolicyPreviewRequest</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return. This option cannot be used when you specify images with <code>imageIds</code>.</p>
        max_results: <p>The maximum number of repository results returned by <code>GetLifecyclePolicyPreviewRequest</code> in paginated output. When this parameter is used, <code>GetLifecyclePolicyPreviewRequest</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>GetLifecyclePolicyPreviewRequest</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>GetLifecyclePolicyPreviewRequest</code> returns up to 100 results and a <code>nextToken</code> value, if applicable. This option cannot be used when you specify images with <code>imageIds</code>.</p>
        filter: <p>An optional parameter that filters results based on image tag status and all tags, if tagged.</p>

    Raises:
        capo_ecr.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr.errors.lifecycle_policy_preview_not_found_exception.LifecyclePolicyPreviewNotFoundException: <p>There is no dry run for this repository.</p>
        capo_ecr.errors.repository_not_found_exception.RepositoryNotFoundException: <p>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.</p>
        capo_ecr.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr.errors.validation_exception.ValidationException: <p>There was an exception validating this request.</p>
        capo_ecr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecr.types.get_lifecycle_policy_preview_request.GetLifecyclePolicyPreviewRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecr.types.get_lifecycle_policy_preview_response.GetLifecyclePolicyPreviewResponse"
    ]:
        import capo_ecr._operations.amazon_ec2_container_registry_v20150921.get_lifecycle_policy_preview

        (
            output,
            http_response,
        ) = await capo_ecr._operations.amazon_ec2_container_registry_v20150921.get_lifecycle_policy_preview.async_get_lifecycle_policy_preview(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetLifecyclePolicyPreview")
    )
    input_: capo_ecr.types.get_lifecycle_policy_preview_request.GetLifecyclePolicyPreviewRequest = {
        "repository_name": repository_name
    }
    if registry_id is not None:
        input_["registry_id"] = registry_id
    if image_ids is not None:
        input_["image_ids"] = image_ids
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filter is not None:
        input_["filter"] = filter

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output