:doc:`CodeGuruProfiler <../../codeguruprofiler>` / Client / add_notification_channels

*************************
add_notification_channels
*************************



.. py:method:: CodeGuruProfiler.Client.add_notification_channels(**kwargs)

  

  Add up to 2 anomaly notifications channels for a profiling group.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codeguruprofiler-2019-07-18/AddNotificationChannels>`_  


  **Request Syntax**
  ::

    response = client.add_notification_channels(
        channels=[
            {
                'eventPublishers': [
                    'AnomalyDetection',
                ],
                'id': 'string',
                'uri': 'string'
            },
        ],
        profilingGroupName='string'
    )
    
  :type channels: list
  :param channels: **[REQUIRED]** 

    One or 2 channels to report to when anomalies are detected.

    

  
    - *(dict) --* 

      Notification medium for users to get alerted for events that occur in application profile. We support SNS topic as a notification channel.

      

    
      - **eventPublishers** *(list) --* **[REQUIRED]** 

        List of publishers for different type of events that may be detected in an application from the profile. Anomaly detection is the only event publisher in Profiler.

        

      
        - *(string) --* 

        
    
      - **id** *(string) --* 

        Unique identifier for each ``Channel`` in the notification configuration of a Profiling Group. A random UUID for channelId is used when adding a channel to the notification configuration if not specified in the request.

        

      
      - **uri** *(string) --* **[REQUIRED]** 

        Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.

        

      
    

  :type profilingGroupName: string
  :param profilingGroupName: **[REQUIRED]** 

    The name of the profiling group that we are setting up notifications for.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'notificationConfiguration': {
              'channels': [
                  {
                      'eventPublishers': [
                          'AnomalyDetection',
                      ],
                      'id': 'string',
                      'uri': 'string'
                  },
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The structure representing the AddNotificationChannelsResponse.

      
      

      - **notificationConfiguration** *(dict) --* 

        The new notification configuration for this profiling group.

        
        

        - **channels** *(list) --* 

          List of up to two channels to be used for sending notifications for events detected from the application profile.

          
          

          - *(dict) --* 

            Notification medium for users to get alerted for events that occur in application profile. We support SNS topic as a notification channel.

            
            

            - **eventPublishers** *(list) --* 

              List of publishers for different type of events that may be detected in an application from the profile. Anomaly detection is the only event publisher in Profiler.

              
              

              - *(string) --* 
          
            

            - **id** *(string) --* 

              Unique identifier for each ``Channel`` in the notification configuration of a Profiling Group. A random UUID for channelId is used when adding a channel to the notification configuration if not specified in the request.

              
            

            - **uri** *(string) --* 

              Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`CodeGuruProfiler.Client.exceptions.ServiceQuotaExceededException`

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

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

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

  
  *   :py:class:`CodeGuruProfiler.Client.exceptions.ThrottlingException`

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

  