:doc:`GreengrassV2 <../../greengrassv2>` / Client / batch_associate_client_device_with_core_device

**********************************************
batch_associate_client_device_with_core_device
**********************************************



.. py:method:: GreengrassV2.Client.batch_associate_client_device_with_core_device(**kwargs)

  

  Associates a list of client devices with a core device. Use this API operation to specify which client devices can discover a core device through cloud discovery. With cloud discovery, client devices connect to IoT Greengrass to retrieve associated core devices' connectivity information and certificates. For more information, see `Configure cloud discovery <https://docs.aws.amazon.com/greengrass/v2/developerguide/configure-cloud-discovery.html>`__ in the *IoT Greengrass V2 Developer Guide*.

   

  .. note::

    

    Client devices are local IoT devices that connect to and communicate with an IoT Greengrass core device over MQTT. You can connect client devices to a core device to sync MQTT messages and data to Amazon Web Services IoT Core and interact with client devices in Greengrass components. For more information, see `Interact with local IoT devices <https://docs.aws.amazon.com/greengrass/v2/developerguide/interact-with-local-iot-devices.html>`__ in the *IoT Greengrass V2 Developer Guide*.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/greengrassv2-2020-11-30/BatchAssociateClientDeviceWithCoreDevice>`_  


  **Request Syntax**
  ::

    response = client.batch_associate_client_device_with_core_device(
        entries=[
            {
                'thingName': 'string'
            },
        ],
        coreDeviceThingName='string'
    )
    
  :type entries: list
  :param entries: 

    The list of client devices to associate.

    

  
    - *(dict) --* 

      Contains a request to associate a client device with a core device. The `BatchAssociateClientDeviceWithCoreDevice <https://docs.aws.amazon.com/greengrass/v2/APIReference/API_BatchAssociateClientDeviceWithCoreDevice.html>`__ operation consumes a list of these requests.

      

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

        The name of the IoT thing that represents the client device to associate.

        

      
    

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

    The name of the core device. This is also the name of the IoT thing.

    

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

    
    ::

      {
          'errorEntries': [
              {
                  'thingName': 'string',
                  'code': 'string',
                  'message': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **errorEntries** *(list) --* 

        The list of any errors for the entries in the request. Each error entry contains the name of the IoT thing that failed to associate.

        
        

        - *(dict) --* 

          Contains an error that occurs from a request to associate a client device with a core device. The `BatchAssociateClientDeviceWithCoreDevice <https://docs.aws.amazon.com/greengrass/v2/APIReference/API_BatchAssociateClientDeviceWithCoreDevice.html>`__ operation returns a list of these errors.

          
          

          - **thingName** *(string) --* 

            The name of the IoT thing whose associate request failed.

            
          

          - **code** *(string) --* 

            The error code for the request.

            
          

          - **message** *(string) --* 

            A message that provides additional information about the error.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`GreengrassV2.Client.exceptions.ValidationException`

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

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

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

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

  