:doc:`SSMIncidents <../../ssm-incidents>` / Client / create_timeline_event

*********************
create_timeline_event
*********************



.. py:method:: SSMIncidents.Client.create_timeline_event(**kwargs)

  

  Creates a custom timeline event on the incident details page of an incident record. Incident Manager automatically creates timeline events that mark key moments during an incident. You can create custom timeline events to mark important events that Incident Manager can detect automatically.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-incidents-2018-05-10/CreateTimelineEvent>`_  


  **Request Syntax**
  ::

    response = client.create_timeline_event(
        clientToken='string',
        eventData='string',
        eventReferences=[
            {
                'relatedItemId': 'string',
                'resource': 'string'
            },
        ],
        eventTime=datetime(2015, 1, 1),
        eventType='string',
        incidentRecordArn='string'
    )
    
  :type clientToken: string
  :param clientToken: 

    A token that ensures that a client calls the action only once with the specified details.

    This field is autopopulated if not provided.

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

    A short description of the event.

    

  
  :type eventReferences: list
  :param eventReferences: 

    Adds one or more references to the ``TimelineEvent``. A reference is an Amazon Web Services resource involved or associated with the incident. To specify a reference, enter its Amazon Resource Name (ARN). You can also specify a related item associated with a resource. For example, to specify an Amazon DynamoDB (DynamoDB) table as a resource, use the table's ARN. You can also specify an Amazon CloudWatch metric associated with the DynamoDB table as a related item.

    

  
    - *(dict) --* 

      An item referenced in a ``TimelineEvent`` that is involved in or somehow associated with an incident. You can specify an Amazon Resource Name (ARN) for an Amazon Web Services resource or a ``RelatedItem`` ID.

      .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``relatedItemId``, ``resource``. 

    
      - **relatedItemId** *(string) --* 

        The ID of a ``RelatedItem`` referenced in a ``TimelineEvent``.

        

      
      - **resource** *(string) --* 

        The Amazon Resource Name (ARN) of an Amazon Web Services resource referenced in a ``TimelineEvent``.

        

      
    

  :type eventTime: datetime
  :param eventTime: **[REQUIRED]** 

    The timestamp for when the event occurred.

    

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

    The type of event. You can create timeline events of type ``Custom Event`` and ``Note``.

     

    To make a Note-type event appear on the *Incident notes* panel in the console, specify ``eventType`` as ``Note``and enter the Amazon Resource Name (ARN) of the incident as the value for ``eventReference``.

    

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

    The Amazon Resource Name (ARN) of the incident record that the action adds the incident to.

    

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

    
    ::

      {
          'eventId': 'string',
          'incidentRecordArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **eventId** *(string) --* 

        The ID of the event for easy reference later.

        
      

      - **incidentRecordArn** *(string) --* 

        The ARN of the incident record that you added the event to.

        
  
  **Exceptions**
  
  *   :py:class:`SSMIncidents.Client.exceptions.ThrottlingException`

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

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

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

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

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

  