Skip to content

register_thing async

register_thing(
    template_body: TemplateBody,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    parameters: Optional[Parameters] = None,
) -> RegisterThingResponse

Provisions a thing in the device registry. RegisterThing calls other IoT control plane APIs. These calls might exceed your account level IoT Throttling Limits and cause throttle errors. Please contact Amazon Web Services Customer Support to raise your throttling limits if necessary.

Requires permission to access the RegisterThing action.

Parameters:

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def register_thing(
    self,
    template_body: "capo_iot.types.template_body.TemplateBody",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    parameters: Optional["capo_iot.types.parameters.Parameters"] = None,
) -> "capo_iot.types.register_thing_response.RegisterThingResponse":
    """<p>Provisions a thing in the device registry. RegisterThing calls other IoT control plane APIs. These calls might exceed your account level <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_iot"> IoT Throttling Limits</a> and cause throttle errors. Please contact <a href="https://console.aws.amazon.com/support/home">Amazon Web Services Customer Support</a> to raise your throttling limits if necessary.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">RegisterThing</a> action.</p>

    Args:
        template_body: <p>The provisioning template. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-w-cert.html">Provisioning Devices That Have Device Certificates</a> for more information.</p>
        parameters: <p>The parameters for provisioning a thing. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html">Provisioning Templates</a> for more information.</p>

    Raises:
        capo_iot.errors.conflicting_resource_update_exception.ConflictingResourceUpdateException: <p>A conflicting resource update exception. This exception is thrown when two pending updates cause a conflict.</p>
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.resource_registration_failure_exception.ResourceRegistrationFailureException: <p>The resource registration failed.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.register_thing_request.RegisterThingRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.register_thing_response.RegisterThingResponse"
    ]:
        import capo_iot._operations.aws_iot_service.register_thing

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.register_thing.async_register_thing(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RegisterThing")
    )
    input_: capo_iot.types.register_thing_request.RegisterThingRequest = {
        "template_body": template_body
    }
    if parameters is not None:
        input_["parameters"] = parameters

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