Skip to content

update_certificate

update_certificate(
    certificate_id: CertificateId,
    new_status: CertificateStatus,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
) -> None

Updates the status of the specified certificate. This operation is idempotent.

Requires permission to access the UpdateCertificate action.

Certificates must be in the ACTIVE state to authenticate devices that use a certificate to connect to IoT.

Within a few minutes of updating a certificate from the ACTIVE state to any other state, IoT disconnects all devices that used that certificate to connect. Devices cannot use a certificate that is not in the ACTIVE state to reconnect.

Parameters:

  • certificate_id (CertificateId) –

    The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)

  • new_status (CertificateStatus) –

    The new status.

    Note: Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by IoT. They are not intended for developer use.

    Note: The status value REGISTER_INACTIVE is deprecated and should not be used.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def update_certificate(
    self,
    certificate_id: "capo_iot.types.certificate_id.CertificateId",
    new_status: "capo_iot.types.certificate_status.CertificateStatus",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
) -> None:
    """<p>Updates the status of the specified certificate. This operation is idempotent.</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">UpdateCertificate</a> action.</p> <p>Certificates must be in the ACTIVE state to authenticate devices that use a certificate to connect to IoT.</p> <p>Within a few minutes of updating a certificate from the ACTIVE state to any other state, IoT disconnects all devices that used that certificate to connect. Devices cannot use a certificate that is not in the ACTIVE state to reconnect.</p>

    Args:
        certificate_id: <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
        new_status: <p>The new status.</p> <p> <b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by IoT. They are not intended for developer use.</p> <p> <b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</p>

    Raises:
        capo_iot.errors.certificate_state_exception.CertificateStateException: <p>The certificate operation is not allowed.</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_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</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.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.update_certificate_request.UpdateCertificateRequest]",
    ) -> OperationResponse[None]:
        import capo_iot._operations.aws_iot_service.update_certificate

        output, http_response = (
            capo_iot._operations.aws_iot_service.update_certificate.update_certificate(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCertificate")
    )
    input_: capo_iot.types.update_certificate_request.UpdateCertificateRequest = {
        "certificate_id": certificate_id,
        "new_status": new_status,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output