:doc:`ManagedintegrationsforIoTDeviceManagement <../../iot-managed-integrations>` / Client / create_ota_task

***************
create_ota_task
***************



.. py:method:: ManagedintegrationsforIoTDeviceManagement.Client.create_ota_task(**kwargs)

  

  Create an over-the-air (OTA) task to target a device.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-managed-integrations-2025-03-03/CreateOtaTask>`_  


  **Request Syntax**
  ::

    response = client.create_ota_task(
        Description='string',
        S3Url='string',
        Protocol='HTTP',
        Target=[
            'string',
        ],
        TaskConfigurationId='string',
        OtaMechanism='PUSH',
        OtaType='ONE_TIME'|'CONTINUOUS',
        OtaTargetQueryString='string',
        ClientToken='string',
        OtaSchedulingConfig={
            'EndBehavior': 'STOP_ROLLOUT'|'CANCEL'|'FORCE_CANCEL',
            'EndTime': 'string',
            'MaintenanceWindows': [
                {
                    'DurationInMinutes': 123,
                    'StartTime': 'string'
                },
            ],
            'StartTime': 'string'
        },
        OtaTaskExecutionRetryConfig={
            'RetryConfigCriteria': [
                {
                    'FailureType': 'FAILED'|'TIMED_OUT'|'ALL',
                    'MinNumberOfRetries': 123
                },
            ]
        },
        Tags={
            'string': 'string'
        }
    )
    
  :type Description: string
  :param Description: 

    The description of the over-the-air (OTA) task.

    

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

    The URL to the Amazon S3 bucket where the over-the-air (OTA) task is stored.

    

  
  :type Protocol: string
  :param Protocol: 

    The connection protocol the over-the-air (OTA) task uses to update the device.

    

  
  :type Target: list
  :param Target: 

    The device targeted for the over-the-air (OTA) task.

    

  
    - *(string) --* 

    

  :type TaskConfigurationId: string
  :param TaskConfigurationId: 

    The identifier for the over-the-air (OTA) task configuration.

    

  
  :type OtaMechanism: string
  :param OtaMechanism: 

    The deployment mechanism for the over-the-air (OTA) task.

    

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

    The frequency type for the over-the-air (OTA) task.

    

  
  :type OtaTargetQueryString: string
  :param OtaTargetQueryString: 

    The query string to add things to the thing group.

    

  
  :type ClientToken: string
  :param ClientToken: 

    An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

    This field is autopopulated if not provided.

  
  :type OtaSchedulingConfig: dict
  :param OtaSchedulingConfig: 

    Over-the-air (OTA) task scheduling config.

    

  
    - **EndBehavior** *(string) --* 

      Specifies the end behavior for all task executions after a task reaches the selected ``endTime``. If ``endTime`` is not selected when creating the task, then ``endBehavior`` does not apply.

      

    
    - **EndTime** *(string) --* 

      The time an over-the-air (OTA) task will stop.

      

    
    - **MaintenanceWindows** *(list) --* 

      Maintenance window list for over-the-air (OTA) task scheduling config.

      

    
      - *(dict) --* 

        Structure representing scheduling maintenance window.

        

      
        - **DurationInMinutes** *(integer) --* 

          Displays the duration of the next maintenance window.

          

        
        - **StartTime** *(string) --* 

          Displays the start time of the next maintenance window.

          

        
      
  
    - **StartTime** *(string) --* 

      The time an over-the-air (OTA) task will start.

      

    
  
  :type OtaTaskExecutionRetryConfig: dict
  :param OtaTaskExecutionRetryConfig: 

    Over-the-air (OTA) task retry config.

    

  
    - **RetryConfigCriteria** *(list) --* 

      The list of retry config criteria.

      

    
      - *(dict) --* 

        Structure representing one retry config criteria.

        

      
        - **FailureType** *(string) --* 

          Over-the-air (OTA) retry criteria failure type.

          

        
        - **MinNumberOfRetries** *(integer) --* 

          The number of retries allowed for a failure type for the over-the-air (OTA) task.

          

        
      
  
  
  :type Tags: dict
  :param Tags: 

    A set of key/value pairs that are used to manage the over-the-air (OTA) task.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'TaskId': 'string',
          'TaskArn': 'string',
          'Description': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **TaskId** *(string) --* 

        The identifier of the over-the-air (OTA) task.

        
      

      - **TaskArn** *(string) --* 

        The Amazon Resource Name (ARN) of the over-the-air (OTA) task.

        
      

      - **Description** *(string) --* 

        A description of the over-the-air (OTA) task.

        
  
  **Exceptions**
  
  *   :py:class:`ManagedintegrationsforIoTDeviceManagement.Client.exceptions.AccessDeniedException`

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

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

  
  *   :py:class:`ManagedintegrationsforIoTDeviceManagement.Client.exceptions.UnauthorizedException`

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

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

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

  