:doc:`SageMaker <../../sagemaker>` / Client / list_monitoring_alert_history

*****************************
list_monitoring_alert_history
*****************************



.. py:method:: SageMaker.Client.list_monitoring_alert_history(**kwargs)

  

  Gets a list of past alerts in a model monitoring schedule.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListMonitoringAlertHistory>`_  


  **Request Syntax**
  ::

    response = client.list_monitoring_alert_history(
        MonitoringScheduleName='string',
        MonitoringAlertName='string',
        SortBy='CreationTime'|'Status',
        SortOrder='Ascending'|'Descending',
        NextToken='string',
        MaxResults=123,
        CreationTimeBefore=datetime(2015, 1, 1),
        CreationTimeAfter=datetime(2015, 1, 1),
        StatusEquals='InAlert'|'OK'
    )
    
  :type MonitoringScheduleName: string
  :param MonitoringScheduleName: 

    The name of a monitoring schedule.

    

  
  :type MonitoringAlertName: string
  :param MonitoringAlertName: 

    The name of a monitoring alert.

    

  
  :type SortBy: string
  :param SortBy: 

    The field used to sort results. The default is ``CreationTime``.

    

  
  :type SortOrder: string
  :param SortOrder: 

    The sort order, whether ``Ascending`` or ``Descending``, of the alert history. The default is ``Descending``.

    

  
  :type NextToken: string
  :param NextToken: 

    If the result of the previous ``ListMonitoringAlertHistory`` request was truncated, the response includes a ``NextToken``. To retrieve the next set of alerts in the history, use the token in the next request.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to display. The default is 100.

    

  
  :type CreationTimeBefore: datetime
  :param CreationTimeBefore: 

    A filter that returns only alerts created on or before the specified time.

    

  
  :type CreationTimeAfter: datetime
  :param CreationTimeAfter: 

    A filter that returns only alerts created on or after the specified time.

    

  
  :type StatusEquals: string
  :param StatusEquals: 

    A filter that retrieves only alerts with a specific status.

    

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

    
    ::

      {
          'MonitoringAlertHistory': [
              {
                  'MonitoringScheduleName': 'string',
                  'MonitoringAlertName': 'string',
                  'CreationTime': datetime(2015, 1, 1),
                  'AlertStatus': 'InAlert'|'OK'
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **MonitoringAlertHistory** *(list) --* 

        An alert history for a model monitoring schedule.

        
        

        - *(dict) --* 

          Provides summary information of an alert's history.

          
          

          - **MonitoringScheduleName** *(string) --* 

            The name of a monitoring schedule.

            
          

          - **MonitoringAlertName** *(string) --* 

            The name of a monitoring alert.

            
          

          - **CreationTime** *(datetime) --* 

            A timestamp that indicates when the first alert transition occurred in an alert history. An alert transition can be from status ``InAlert`` to ``OK``, or from ``OK`` to ``InAlert``.

            
          

          - **AlertStatus** *(string) --* 

            The current alert status of an alert.

            
      
    
      

      - **NextToken** *(string) --* 

        If the response is truncated, SageMaker returns this token. To retrieve the next set of alerts, use it in the subsequent request.

        
  
  **Exceptions**
  
  *   :py:class:`SageMaker.Client.exceptions.ResourceNotFound`

  