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

**************************
create_dynamic_thing_group
**************************



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

  

  Creates a dynamic thing group.

   

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


  **Request Syntax**
  ::

    response = client.create_dynamic_thing_group(
        thingGroupName='string',
        thingGroupProperties={
            'thingGroupDescription': 'string',
            'attributePayload': {
                'attributes': {
                    'string': 'string'
                },
                'merge': True|False
            }
        },
        indexName='string',
        queryString='string',
        queryVersion='string',
        tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type thingGroupName: string
  :param thingGroupName: **[REQUIRED]** 

    The dynamic thing group name to create.

    

  
  :type thingGroupProperties: dict
  :param thingGroupProperties: 

    The dynamic thing group properties.

    

  
    - **thingGroupDescription** *(string) --* 

      The thing group description.

      

    
    - **attributePayload** *(dict) --* 

      The thing group attributes in JSON format.

      

    
      - **attributes** *(dict) --* 

        A JSON string containing up to three key-value pair in JSON format. For example:

         

        ``{\"attributes\":{\"string1\":\"string2\"}}``

        

      
        - *(string) --* 

        
          - *(string) --* 

          
    
  
      - **merge** *(boolean) --* 

        Specifies whether the list of attributes provided in the ``AttributePayload`` is merged with the attributes stored in the registry, instead of overwriting them.

         

        To remove an attribute, call ``UpdateThing`` with an empty attribute value.

         

        .. note::

          

          The ``merge`` attribute is only valid when calling ``UpdateThing`` or ``UpdateThingGroup``.

          

        

      
    
  
  :type indexName: string
  :param indexName: 

    The dynamic thing group index name.

     

    .. note::

      

      Currently one index is supported: ``AWS_Things``.

      

    

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

    The dynamic thing group search query string.

     

    See `Query Syntax <https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html>`__ for information about query string syntax.

    

  
  :type queryVersion: string
  :param queryVersion: 

    The dynamic thing group query version.

     

    .. note::

      

      Currently one query version is supported: "2017-09-30". If not specified, the query version defaults to this value.

      

    

  
  :type tags: list
  :param tags: 

    Metadata which can be used to manage the dynamic thing group.

    

  
    - *(dict) --* 

      A set of key/value pairs that are used to manage the resource.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The tag's key.

        

      
      - **Value** *(string) --* 

        The tag's value.

        

      
    

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

    
    ::

      {
          'thingGroupName': 'string',
          'thingGroupArn': 'string',
          'thingGroupId': 'string',
          'indexName': 'string',
          'queryString': 'string',
          'queryVersion': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **thingGroupName** *(string) --* 

        The dynamic thing group name.

        
      

      - **thingGroupArn** *(string) --* 

        The dynamic thing group ARN.

        
      

      - **thingGroupId** *(string) --* 

        The dynamic thing group ID.

        
      

      - **indexName** *(string) --* 

        The dynamic thing group index name.

        
      

      - **queryString** *(string) --* 

        The dynamic thing group search query string.

        
      

      - **queryVersion** *(string) --* 

        The dynamic thing group query version.

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

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

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

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

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

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

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

  