:doc:`IoT <../../iot>` / Client / start_detect_mitigation_actions_task

************************************
start_detect_mitigation_actions_task
************************************



.. py:method:: IoT.Client.start_detect_mitigation_actions_task(**kwargs)

  

  Starts a Device Defender ML Detect mitigation actions task.

   

  Requires permission to access the `StartDetectMitigationActionsTask <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartDetectMitigationActionsTask>`_  


  **Request Syntax**
  ::

    response = client.start_detect_mitigation_actions_task(
        taskId='string',
        target={
            'violationIds': [
                'string',
            ],
            'securityProfileName': 'string',
            'behaviorName': 'string'
        },
        actions=[
            'string',
        ],
        violationEventOccurrenceRange={
            'startTime': datetime(2015, 1, 1),
            'endTime': datetime(2015, 1, 1)
        },
        includeOnlyActiveViolations=True|False,
        includeSuppressedAlerts=True|False,
        clientRequestToken='string'
    )
    
  :type taskId: string
  :param taskId: **[REQUIRED]** 

    The unique identifier of the task.

    

  
  :type target: dict
  :param target: **[REQUIRED]** 

    Specifies the ML Detect findings to which the mitigation actions are applied.

    

  
    - **violationIds** *(list) --* 

      The unique identifiers of the violations.

      

    
      - *(string) --* 

      
  
    - **securityProfileName** *(string) --* 

      The name of the security profile.

      

    
    - **behaviorName** *(string) --* 

      The name of the behavior.

      

    
  
  :type actions: list
  :param actions: **[REQUIRED]** 

    The actions to be performed when a device has unexpected behavior.

    

  
    - *(string) --* 

    

  :type violationEventOccurrenceRange: dict
  :param violationEventOccurrenceRange: 

    Specifies the time period of which violation events occurred between.

    

  
    - **startTime** *(datetime) --* **[REQUIRED]** 

      The start date and time of a time period in which violation events occurred.

      

    
    - **endTime** *(datetime) --* **[REQUIRED]** 

      The end date and time of a time period in which violation events occurred.

      

    
  
  :type includeOnlyActiveViolations: boolean
  :param includeOnlyActiveViolations: 

    Specifies to list only active violations.

    

  
  :type includeSuppressedAlerts: boolean
  :param includeSuppressedAlerts: 

    Specifies to include suppressed alerts.

    

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

    Each mitigation action task must have a unique client request token. If you try to create a new task with the same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request.

    This field is autopopulated if not provided.

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

    
    ::

      {
          'taskId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **taskId** *(string) --* 

        The unique identifier of the task.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.TaskAlreadyExistsException`

  
  *   :py:class:`IoT.Client.exceptions.LimitExceededException`

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

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  