【发布时间】:2018-10-13 18:38:22
【问题描述】:
我使用 boto3 创建了一个工作
import boto3
client = boto3.client('iot')
response = client.create_job(
jobId='job_id',
targets=[
'thing_arn',
],
document="{\"operation\":\"restart\"}",
description='job created using boto',
targetSelection='SNAPSHOT'
)
我已经创建了一个 python 程序来订阅监听响应
end_point = 'ur end point'
rootCAPath = 'rootCA Path'
certificatePath = 'certificate Path'
privateKeyPath = 'private Key Path'
clientId = 'myClientID'
#$aws/things/thingname/jobs/notify (or
#$aws/things/thingname/jobs/notify-next)
#$aws/things/thingname/jobs/get/accepted
#$aws/things/thingname/jobs/get/rejected
#$aws/things/thingname/jobs/jobId/get/accepted
#$aws/things/thingname/jobs/jobId/get/rejected
topic = 'try with above all topics'
myAWSIoTMQTTClient = None
myAWSIoTMQTTClient = AWSIoTMQTTClient(clientId)
myAWSIoTMQTTClient.configureEndpoint(end_point, 8883)
myAWSIoTMQTTClient.configureCredentials(rootCAPath, privateKeyPath, certificatePath)
# Connect and Subscribe
while True:
myAWSIoTMQTTClient.connect(1000)
#subscribe multiple topic
myAWSIoTMQTTClient.subscribe(topic, 1, customCallback)
time.sleep(2)
当我收听上述主题时,没有任何回应。我还使用 aws iot 控制台 (TEST) 进行了检查,并订阅了上面给定的主题,也没有任何回应。作业如何发送到注册的 iot 设备和作业详细信息发送到该设备的主题是什么?
【问题讨论】:
标签: python aws-sdk boto3 aws-iot