PrometheusService / Paginator / ListScrapers

ListScrapers#

class PrometheusService.Paginator.ListScrapers#
paginator = client.get_paginator('list_scrapers')
paginate(**kwargs)#

Creates an iterator that will paginate through responses from PrometheusService.Client.list_scrapers().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    filters={
        'string': [
            'string',
        ]
    },
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • filters (dict) –

    (Optional) A list of key-value pairs to filter the list of scrapers returned. Keys include status, sourceArn, destinationArn, and alias.

    Filters on the same key are OR’d together, and filters on different keys are AND’d together. For example, status=ACTIVE&status=CREATING&alias=Test, will return all scrapers that have the alias Test, and are either in status ACTIVE or CREATING.

    To find all active scrapers that are sending metrics to a specific Amazon Managed Service for Prometheus workspace, you would use the ARN of the workspace in a query:

    status=ACTIVE&destinationArn=arn:aws:aps:us-east-1:123456789012:workspace/ws-example1-1234-abcd-56ef-123456789012

    If this is included, it filters the results to only the scrapers that match the filter.

    • (string) –

      The name of the key to filter by. Currently supported filter keys are status, sourceArn, destinationArn, and alias.

      • (list) –

        The values of the given key by which to filter.

        • (string) –

          The value for a given key by which to filter.

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) –

      The size of each page.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:

dict

Returns:

Response Syntax

{
    'scrapers': [
        {
            'alias': 'string',
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'destination': {
                'ampConfiguration': {
                    'workspaceArn': 'string'
                }
            },
            'lastModifiedAt': datetime(2015, 1, 1),
            'roleArn': 'string',
            'scraperId': 'string',
            'source': {
                'eksConfiguration': {
                    'clusterArn': 'string',
                    'securityGroupIds': [
                        'string',
                    ],
                    'subnetIds': [
                        'string',
                    ]
                }
            },
            'status': {
                'statusCode': 'CREATING'|'ACTIVE'|'DELETING'|'CREATION_FAILED'|'DELETION_FAILED'
            },
            'statusReason': 'string',
            'tags': {
                'string': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    Represents the output of a ListScrapers operation.

    • scrapers (list) –

      A list of ScraperSummary structures giving information about scrapers in the account that match the filters provided.

      • (dict) –

        The ScraperSummary structure contains a summary of the details about one scraper in your account.

        • alias (string) –

          (Optional) A name associated with the scraper.

        • arn (string) –

          The Amazon Resource Name (ARN) of the scraper.

        • createdAt (datetime) –

          The date and time that the scraper was created.

        • destination (dict) –

          The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: ampConfiguration. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • ampConfiguration (dict) –

            The Amazon Managed Service for Prometheusworkspace to send metrics to.

            • workspaceArn (string) –

              ARN of the Amazon Managed Service for Prometheus workspace.

        • lastModifiedAt (datetime) –

          The date and time that the scraper was last modified.

        • roleArn (string) –

          The Amazon Resource Name (ARN) of the IAM role that provides permissions for the scraper to discover and collect metrics on your behalf.

        • scraperId (string) –

          The ID of the scraper.

        • source (dict) –

          The Amazon EKS cluster from which the scraper collects metrics.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: eksConfiguration. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • eksConfiguration (dict) –

            The Amazon EKS cluster from which a scraper collects metrics.

            • clusterArn (string) –

              ARN of the Amazon EKS cluster.

            • securityGroupIds (list) –

              A list of the security group IDs for the Amazon EKS cluster VPC configuration.

              • (string) –

                ID of a VPC security group.

            • subnetIds (list) –

              A list of subnet IDs for the Amazon EKS cluster VPC configuration.

              • (string) –

                ID of a VPC subnet.

        • status (dict) –

          A structure that contains the current status of the scraper.

          • statusCode (string) –

            The current status of the scraper.

        • statusReason (string) –

          If there is a failure, the reason for the failure.

        • tags (dict) –

          (Optional) The list of tag keys and values associated with the scraper.

          • (string) –

            The key of the tag. May not begin with aws:.

            • (string) –

              The value of the tag.

    • NextToken (string) –

      A token to resume pagination.