Skip to content

list_publisher_reports

list_publisher_reports(
    *,
    config_overrides: Optional[ECRPUBLICClientConfig] = None,
    report_type: Optional[PublisherReportType] = None,
    granularity: Optional[PublisherReportGranularity] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListPublisherReportsResponse

Lists the publisher reports for your public registry that were created in the last 365 days. Each report is a compressed CSV file. Reports include images in your premium repositories and in free repositories that are associated with a premium repository.

Parameters:

  • report_type (Optional[PublisherReportType], default: None ) –

    The type of report to list. If you don't specify a type, reports of all types are listed. Valid values:

    • SUMMARY: The number of pulls and version checks for each image.

    • TRENDS: The same counts for each image, broken down by the country, cloud provider, client, domain and company of the puller.

  • granularity (Optional[PublisherReportGranularity], default: None ) –

    The time period that each report covers. If you don't specify a granularity, reports of all granularities are listed. Valid values:

    • WEEKLY: Each report covers one week, from Monday to Sunday.

    • MONTHLY: Each report covers one calendar month.

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

    The maximum number of results that ListPublisherReports returns in paginated output. When you use this parameter, ListPublisherReports returns only maxResults results in a single page along with a nextToken response element. To see the remaining results, send another ListPublisherReports request with the returned nextToken value. You can specify a value between 1 and 1000. If you don't use this parameter, ListPublisherReports returns up to 100 results and a nextToken value, if applicable. A page can contain fewer than maxResults reports, so use nextToken to check for more.

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

    The nextToken value that's returned from a previous paginated ListPublisherReports request. Pagination continues from the end of the previous results. You must specify the same reportType and granularity values as the request that returned the token; otherwise, the request fails with InvalidParameterException.

    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.

Raises:

  • InvalidParameterException –

    The specified parameter is invalid. Review the available parameters for the API request.

  • LimitExceededException –

    The operation didn't succeed because it would have exceeded a service limit for your account. For more information, see Amazon ECR Public service quotas in the Amazon Elastic Container Registry Public User Guide.

  • ServerException –

    These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact Amazon Web Services Support.

  • UnsupportedCommandException –

    The action isn't supported in this Region. Check that the action is available in the Amazon Web Services Region that you're using, and try again in a supported Region.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To list the monthly summary reports for a registry This example lists the monthly summary publisher reports that are available for your public registry.

>>> client.list_publisher_reports(report_type='SUMMARY', granularity='MONTHLY')
Source code in docs_src/capo_ecr_public/_services/ecrpublic.py
def list_publisher_reports(
    self,
    *,
    config_overrides: Optional[ECRPUBLICClientConfig] = None,
    report_type: Optional[
        "capo_ecr_public.types.publisher_report_type.PublisherReportType"
    ] = None,
    granularity: Optional[
        "capo_ecr_public.types.publisher_report_granularity.PublisherReportGranularity"
    ] = None,
    max_results: Optional["capo_ecr_public.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_ecr_public.types.next_token.NextToken"] = None,
) -> "capo_ecr_public.types.list_publisher_reports_response.ListPublisherReportsResponse":
    """<p>Lists the publisher reports for your public registry that were created in the last 365 days. Each report is a compressed CSV file. Reports include images in your premium repositories and in free repositories that are associated with a premium repository.</p>

    Args:
        report_type: <p>The type of report to list. If you don't specify a type, reports of all types are listed. Valid values:</p> <ul> <li> <p> <code>SUMMARY</code>: The number of pulls and version checks for each image.</p> </li> <li> <p> <code>TRENDS</code>: The same counts for each image, broken down by the country, cloud provider, client, domain and company of the puller.</p> </li> </ul>
        granularity: <p>The time period that each report covers. If you don't specify a granularity, reports of all granularities are listed. Valid values:</p> <ul> <li> <p> <code>WEEKLY</code>: Each report covers one week, from Monday to Sunday.</p> </li> <li> <p> <code>MONTHLY</code>: Each report covers one calendar month.</p> </li> </ul>
        max_results: <p>The maximum number of results that <code>ListPublisherReports</code> returns in paginated output. When you use this parameter, <code>ListPublisherReports</code> returns only <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. To see the remaining results, send another <code>ListPublisherReports</code> request with the returned <code>nextToken</code> value. You can specify a value between 1 and 1000. If you don't use this parameter, <code>ListPublisherReports</code> returns up to 100 results and a <code>nextToken</code> value, if applicable. A page can contain fewer than <code>maxResults</code> reports, so use <code>nextToken</code> to check for more.</p>
        next_token: <p>The <code>nextToken</code> value that's returned from a previous paginated <code>ListPublisherReports</code> request. Pagination continues from the end of the previous results. You must specify the same <code>reportType</code> and <code>granularity</code> values as the request that returned the token; otherwise, the request fails with <code>InvalidParameterException</code>.</p> <note> <p>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.</p> </note>

    Raises:
        capo_ecr_public.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr_public.errors.limit_exceeded_exception.LimitExceededException: <p>The operation didn't succeed because it would have exceeded a service limit for your account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html">Amazon ECR Public service quotas</a> in the Amazon Elastic Container Registry Public User Guide.</p>
        capo_ecr_public.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact Amazon Web Services Support.</p>
        capo_ecr_public.errors.unsupported_command_exception.UnsupportedCommandException: <p>The action isn't supported in this Region. Check that the action is available in the Amazon Web Services Region that you're using, and try again in a supported Region.</p>
        capo_ecr_public.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list the monthly summary reports for a registry
        This example lists the monthly summary publisher reports that are available for your public registry.

        >>> client.list_publisher_reports(report_type='SUMMARY', granularity='MONTHLY')
    """

    def _handler(
        req: "OperationRequest[capo_ecr_public.types.list_publisher_reports_request.ListPublisherReportsRequest]",
    ) -> OperationResponse[
        "capo_ecr_public.types.list_publisher_reports_response.ListPublisherReportsResponse"
    ]:
        import capo_ecr_public._operations.spencer_frontend_service.list_publisher_reports

        output, http_response = (
            capo_ecr_public._operations.spencer_frontend_service.list_publisher_reports.list_publisher_reports(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPublisherReports")
    )
    input_: capo_ecr_public.types.list_publisher_reports_request.ListPublisherReportsRequest = {}
    if report_type is not None:
        input_["report_type"] = report_type
    if granularity is not None:
        input_["granularity"] = granularity
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output