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

***********************************
start_audit_mitigation_actions_task
***********************************



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

  

  Starts a task that applies a set of mitigation actions to the specified target.

   

  Requires permission to access the `StartAuditMitigationActionsTask <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/StartAuditMitigationActionsTask>`_  


  **Request Syntax**
  ::

    response = client.start_audit_mitigation_actions_task(
        taskId='string',
        target={
            'auditTaskId': 'string',
            'findingIds': [
                'string',
            ],
            'auditCheckToReasonCodeFilter': {
                'string': [
                    'string',
                ]
            }
        },
        auditCheckToActionsMapping={
            'string': [
                'string',
            ]
        },
        clientRequestToken='string'
    )
    
  :type taskId: string
  :param taskId: **[REQUIRED]** 

    A unique identifier for the task. You can use this identifier to check the status of the task or to cancel it.

    

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

    Specifies the audit findings to which the mitigation actions are applied. You can apply them to a type of audit check, to all findings from an audit, or to a specific set of findings.

    

  
    - **auditTaskId** *(string) --* 

      If the task will apply a mitigation action to findings from a specific audit, this value uniquely identifies the audit.

      

    
    - **findingIds** *(list) --* 

      If the task will apply a mitigation action to one or more listed findings, this value uniquely identifies those findings.

      

    
      - *(string) --* 

      
  
    - **auditCheckToReasonCodeFilter** *(dict) --* 

      Specifies a filter in the form of an audit check and set of reason codes that identify the findings from the audit to which the audit mitigation actions task apply.

      

    
      - *(string) --* 

        An audit check name. Checks must be enabled for your account. (Use ``DescribeAccountAuditConfiguration`` to see the list of all checks, including those that are enabled or use ``UpdateAccountAuditConfiguration`` to select which checks are enabled.)

        

      
        - *(list) --* 

        
          - *(string) --* 

          
      
  

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

    For an audit check, specifies which mitigation actions to apply. Those actions must be defined in your Amazon Web Services accounts.

    

  
    - *(string) --* 

      An audit check name. Checks must be enabled for your account. (Use ``DescribeAccountAuditConfiguration`` to see the list of all checks, including those that are enabled or use ``UpdateAccountAuditConfiguration`` to select which checks are enabled.)

      

    
      - *(list) --* 

      
        - *(string) --* 

        
    


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

    Each audit mitigation task must have a unique client request token. If you try to start a new task with the same token as a task that already exists, an exception occurs. If you omit this value, a unique client request token is generated automatically.

    This field is autopopulated if not provided.

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

    
    ::

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

    

    - *(dict) --* 
      

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

        The unique identifier for the audit mitigation task. This matches the ``taskId`` that you specified in the request.

        
  
  **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`

  