PrometheusService / Client / update_scraper

update_scraper#

PrometheusService.Client.update_scraper(**kwargs)#

Updates an existing scraper.

You can’t use this function to update the source from which the scraper is collecting metrics. To change the source, delete the scraper and create a new one.

See also: AWS API Documentation

Request Syntax

response = client.update_scraper(
    alias='string',
    clientToken='string',
    destination={
        'ampConfiguration': {
            'workspaceArn': 'string'
        }
    },
    scrapeConfiguration={
        'configurationBlob': b'bytes'
    },
    scraperId='string'
)
Parameters:
  • alias (string) – The new alias of the scraper.

  • clientToken (string) –

    A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.

    This field is autopopulated if not provided.

  • destination (dict) –

    The new Amazon Managed Service for Prometheus workspace to send metrics to.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: ampConfiguration.

    • ampConfiguration (dict) –

      The Amazon Managed Service for Prometheus workspace to send metrics to.

      • workspaceArn (string) – [REQUIRED]

        ARN of the Amazon Managed Service for Prometheus workspace.

  • scrapeConfiguration (dict) –

    Contains the base-64 encoded YAML configuration for the scraper.

    Note

    For more information about configuring a scraper, see Using an Amazon Web Services managed collector in the Amazon Managed Service for Prometheus User Guide.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: configurationBlob.

    • configurationBlob (bytes) –

      The base 64 encoded scrape configuration file.

  • scraperId (string) –

    [REQUIRED]

    The ID of the scraper to update.

Return type:

dict

Returns:

Response Syntax

{
    'arn': 'string',
    'scraperId': 'string',
    'status': {
        'statusCode': 'CREATING'|'UPDATING'|'ACTIVE'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED'|'DELETION_FAILED'
    },
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • arn (string) –

      The Amazon Resource Name (ARN) of the updated scraper.

    • scraperId (string) –

      The ID of the updated scraper.

    • status (dict) –

      A structure that displays the current status of the scraper.

      • statusCode (string) –

        The current status of the scraper.

    • tags (dict) –

      The list of tag keys and values that are associated with the scraper.

      • (string) –

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

        • (string) –

          The value of the tag.

Exceptions