Skip to content

batch_associate_client_device_with_core_device async

batch_associate_client_device_with_core_device(
    core_device_thing_name: IoTThingName,
    *,
    config_overrides: Optional[AsyncGreengrassV2ClientConfig] = None,
    entries: Optional[AssociateClientDeviceWithCoreDeviceEntryList] = None,
) -> BatchAssociateClientDeviceWithCoreDeviceResponse

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 in the IoT Greengrass V2 Developer Guide.

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 in the IoT Greengrass V2 Developer Guide.

Parameters:

Raises:

  • AccessDeniedException –

    You don't have permission to perform the action.

  • InternalServerException –

    IoT Greengrass can't process your request right now. Try again later.

  • ResourceNotFoundException –

    The requested resource can't be found.

  • ThrottlingException –

    Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.

  • ValidationException –

    The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_greengrassv2/_services/async_greengrass_v2.py
async def batch_associate_client_device_with_core_device(
    self,
    core_device_thing_name: "capo_greengrassv2.types.io_t_thing_name.IoTThingName",
    *,
    config_overrides: Optional[AsyncGreengrassV2ClientConfig] = None,
    entries: Optional[
        "capo_greengrassv2.types.associate_client_device_with_core_device_entry_list.AssociateClientDeviceWithCoreDeviceEntryList"
    ] = None,
) -> "capo_greengrassv2.types.batch_associate_client_device_with_core_device_response.BatchAssociateClientDeviceWithCoreDeviceResponse":
    """<p>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 <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/configure-cloud-discovery.html">Configure cloud discovery</a> in the <i>IoT Greengrass V2 Developer Guide</i>.</p> <note> <p>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 <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/interact-with-local-iot-devices.html">Interact with local IoT devices</a> in the <i>IoT Greengrass V2 Developer Guide</i>.</p> </note>

    Args:
        entries: <p>The list of client devices to associate.</p>
        core_device_thing_name: <p>The name of the core device. This is also the name of the IoT thing.</p>

    Raises:
        capo_greengrassv2.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_greengrassv2.errors.internal_server_exception.InternalServerException: <p>IoT Greengrass can't process your request right now. Try again later.</p>
        capo_greengrassv2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_greengrassv2.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.</p>
        capo_greengrassv2.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_greengrassv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_greengrassv2.types.batch_associate_client_device_with_core_device_request.BatchAssociateClientDeviceWithCoreDeviceRequest]",
    ) -> AsyncOperationResponse[
        "capo_greengrassv2.types.batch_associate_client_device_with_core_device_response.BatchAssociateClientDeviceWithCoreDeviceResponse"
    ]:
        import capo_greengrassv2._operations.greengrass_v2.batch_associate_client_device_with_core_device

        (
            output,
            http_response,
        ) = await capo_greengrassv2._operations.greengrass_v2.batch_associate_client_device_with_core_device.async_batch_associate_client_device_with_core_device(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("BatchAssociateClientDeviceWithCoreDevice"),
    )
    input_: capo_greengrassv2.types.batch_associate_client_device_with_core_device_request.BatchAssociateClientDeviceWithCoreDeviceRequest = {
        "core_device_thing_name": core_device_thing_name
    }
    if entries is not None:
        input_["entries"] = entries

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output