update_scraper
¶
update_scraper(
scraper_id: ScraperId,
*,
config_overrides: Optional[ampClientConfig] = None,
alias: Optional[ScraperAlias] = None,
scrape_configuration: Optional[ScrapeConfiguration] = None,
destination: Optional[Destination] = None,
role_configuration: Optional[RoleConfiguration] = None,
client_token: Optional[IdempotencyToken] = None,
exporters: Optional[ExporterList] = None,
) -> UpdateScraperResponse
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.
Parameters:
-
scraper_id(ScraperId) –The ID of the scraper to update.
-
alias(Optional[ScraperAlias], default:None) –The new alias of the scraper.
-
scrape_configuration(Optional[ScrapeConfiguration], default:None) –Contains the base-64 encoded YAML configuration for the scraper.
For more information about configuring a scraper, see Using an Amazon Web Services managed collector in the Amazon Managed Service for Prometheus User Guide.
-
destination(Optional[Destination], default:None) –The new destination where the scraper sends metrics. Valid destinations are Amazon Managed Service for Prometheus workspaces and CloudWatch datasets.
-
role_configuration(Optional[RoleConfiguration], default:None) –Use this structure to enable cross-account access, so that you can use a target account to access Prometheus metrics from source accounts.
-
client_token(Optional[IdempotencyToken], default:None) –A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.
-
exporters(Optional[ExporterList], default:None) –The exporter configurations for the scraper. You can configure at most one Amazon OpenSearch Service domain. If you don't specify a value, the existing exporter configuration remains unchanged.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
ConflictException–The request would cause an inconsistent state.
-
InternalServerException–An unexpected error occurred during the processing of the request.
-
ResourceNotFoundException–The request references a resources that doesn't exist.
-
ServiceQuotaExceededException–Completing the request would cause a service quota to be exceeded.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
UpdateScraper with all optional parameters
>>> client.update_scraper(scraper_id='scraper-123', alias='alias-update', scrape_configuration={'configurationBlob': 'blob-update'}, destination={'ampConfiguration': {'workspaceArn': 'arn:aws:aps:us-west-2:123456789012:workspace/ws-ogh2u499-ce12-hg89-v6c7-123412341234-update'}}, client_token='token')
Source code in docs_src/capo_amp/_services/amp.py
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 | |