qos=mqtt.QoS.AT_LEAST_ONCE,
                callback=createcertificatefromcsr_execution_accepted)

            # Wait for subscription to succeed
            createcertificatefromcsr_subscribed_accepted_future.result()

            print("Subscribing to CreateCertificateFromCsr Rejected topic...")
            createcertificatefromcsr_subscribed_rejected_future, _ = identity_client.subscribe_to_create_certificate_from_csr_rejected(
                request=createcertificatefromcsr_subscription_request,
                qos=mqtt.QoS.AT_LEAST_ONCE,
                callback=createcertificatefromcsr_execution_rejected)

            # Wait for subscription to succeed
            createcertificatefromcsr_subscribed_rejected_future.result()

        registerthing_subscription_request = iotidentity.RegisterThingSubscriptionRequest(
            template_name=args.templateName)

        print("Subscribing to RegisterThing Accepted topic...")
        registerthing_subscribed_accepted_future, _ = identity_client.subscribe_to_register_thing_accepted(
            request=registerthing_subscription_request,
            qos=mqtt.QoS.AT_LEAST_ONCE,
            callback=registerthing_execution_accepted)

        # Wait for subscription to succeed
        registerthing_subscribed_accepted_future.result()

        print("Subscribing to RegisterThing Rejected topic...")
        registerthing_subscribed_rejected_future, _ = identity_client.subscribe_to_register_thing_rejected(
            request=registerthing_subscription_request,
            qos=mqtt.QoS.AT_LEAST_ONCE,
            callback=registerthing_execution_rejected)
Beispiel #2
0
    qos=mqtt.QoS.AT_LEAST_ONCE,
    callback=createkeysandcertificate_execution_accepted)

# Wait for subscription to succeed
createkeysandcertificate_subscribed_accepted_future.result()

print("Subscribing to CreateKeysAndCertificate Rejected topic...")
createkeysandcertificate_subscribed_rejected_future, _ = identity_client.subscribe_to_create_keys_and_certificate_rejected(
    request=createkeysandcertificate_subscription_request,
    qos=mqtt.QoS.AT_LEAST_ONCE,
    callback=createkeysandcertificate_execution_rejected)

# Wait for subscription to succeed
createkeysandcertificate_subscribed_rejected_future.result()

registerthing_subscription_request = iotidentity.RegisterThingSubscriptionRequest(
    provisioning_template_name)
print("Subscribing to RegisterThing Accepted topic...")
registerthing_subscribed_accepted_future, _ = identity_client.subscribe_to_register_thing_accepted(
    request=registerthing_subscription_request,
    qos=mqtt.QoS.AT_LEAST_ONCE,
    callback=registerthing_execution_accepted)

# Wait for subscription to succeed
registerthing_subscribed_accepted_future.result()

print("Subscribing to RegisterThing Rejected topic...")
registerthing_subscribed_rejected_future, _ = identity_client.subscribe_to_register_thing_rejected(
    request=registerthing_subscription_request,
    qos=mqtt.QoS.AT_LEAST_ONCE,
    callback=registerthing_execution_rejected)
# Wait for subscription to succeed