:doc:`PrometheusService <../../amp>` / Client / update_scraper

**************
update_scraper
**************



.. py:method:: 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 <https://docs.aws.amazon.com/goto/WebAPI/amp-2020-08-01/UpdateScraper>`_  


  **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'
    )
    
  :type scraperId: string
  :param scraperId: **[REQUIRED]** 

    The ID of the scraper to update.

    

  
  :type alias: string
  :param alias: 

    The new alias of the scraper.

    

  
  :type scrapeConfiguration: dict
  :param scrapeConfiguration: 

    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 <https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html>`__ 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.

      

    
  
  :type destination: dict
  :param destination: 

    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.

        

      
    
  
  :type roleConfiguration: dict
  :param roleConfiguration: 

    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 <https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#cross-account-remote-write>`__.

      

    
    - **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 <https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html#cross-account-remote-write>`__.

      

    
  
  :type clientToken: string
  :param clientToken: 

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

    This field is autopopulated if not provided.

  
  
  :rtype: 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**
  
  *   :py:class:`PrometheusService.Client.exceptions.ThrottlingException`

  
  *   :py:class:`PrometheusService.Client.exceptions.ConflictException`

  
  *   :py:class:`PrometheusService.Client.exceptions.ValidationException`

  
  *   :py:class:`PrometheusService.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`PrometheusService.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`PrometheusService.Client.exceptions.InternalServerException`

  
  *   :py:class:`PrometheusService.Client.exceptions.ServiceQuotaExceededException`

  