:doc:`SnowDeviceManagement <../../snow-device-management>` / Client / create_task

***********
create_task
***********



.. py:method:: SnowDeviceManagement.Client.create_task(**kwargs)

  

  Instructs one or more devices to start a task, such as unlocking or rebooting.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/snow-device-management-2021-08-04/CreateTask>`_  


  **Request Syntax**
  ::

    response = client.create_task(
        clientToken='string',
        command={
            'reboot': {}
            ,
            'unlock': {}
            
        },
        description='string',
        tags={
            'string': 'string'
        },
        targets=[
            'string',
        ]
    )
    
  :type clientToken: string
  :param clientToken: 

    A token ensuring that the action is called only once with the specified details.

    This field is autopopulated if not provided.

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

    The task to be performed. Only one task is executed on a device at a time.

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

  
    - **reboot** *(dict) --* 

      Reboots the device.

      

    
    
    - **unlock** *(dict) --* 

      Unlocks the device.

      

    
    
  
  :type description: string
  :param description: 

    A description of the task and its targets.

    

  
  :type tags: dict
  :param tags: 

    Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    A list of managed device IDs.

    

  
    - *(string) --* 

    

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

    
    ::

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

    

    - *(dict) --* 
      

      - **taskArn** *(string) --* 

        The Amazon Resource Name (ARN) of the task that you created.

        
      

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

        The ID of the task that you created.

        
  
  **Exceptions**
  
  *   :py:class:`SnowDeviceManagement.Client.exceptions.ServiceQuotaExceededException`

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

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

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

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

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

  