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( scraperId='string', alias='string', scrapeConfiguration={ 'configurationBlob': b'bytes' }, destination={ 'ampConfiguration': { 'workspaceArn': 'string' } }, roleConfiguration={ 'sourceRoleArn': 'string', 'targetRoleArn': 'string' }, clientToken='string' ) - Parameters:
- scraperId (string) – - [REQUIRED] - The ID of the scraper to update. 
- alias (string) – The new alias of the scraper. 
- 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. 
 
- 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. 
 
 
- roleConfiguration (dict) – - Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts. - sourceRoleArn (string) – - The Amazon Resource Name (ARN) of the role used in the source account to enable cross-account scraping. For information about the contents of this policy, see Cross-account setup. 
- targetRoleArn (string) – - The Amazon Resource Name (ARN) of the role used in the target account to enable cross-account scraping. For information about the contents of this policy, see Cross-account setup. 
 
- 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. 
 
- Return type:
- dict 
- Returns:
- Response Syntax- { 'scraperId': 'string', 'arn': 'string', 'status': { 'statusCode': 'CREATING'|'UPDATING'|'ACTIVE'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED'|'DELETION_FAILED' }, 'tags': { 'string': 'string' } } - Response Structure- (dict) – - scraperId (string) – - The ID of the updated scraper. 
- arn (string) – - The Amazon Resource Name (ARN) 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- PrometheusService.Client.exceptions.ThrottlingException
- PrometheusService.Client.exceptions.ConflictException
- PrometheusService.Client.exceptions.ValidationException
- PrometheusService.Client.exceptions.ResourceNotFoundException
- PrometheusService.Client.exceptions.AccessDeniedException
- PrometheusService.Client.exceptions.InternalServerException
- PrometheusService.Client.exceptions.ServiceQuotaExceededException