简体   繁体   English

在AWS-IoT中使用http的列表项api?

[英]List-things api using http in AWS-IoT?

I am new to this AWS IoT, i was able to get/update thing shadows using http api ( https://endpoint/things/thingName/shadow ), provided by AWS IoT, but i want the list of things created under my account. 我是这个AWS IoT的新手,我能够使用AWS IoT提供的http api( https:// endpoint / things / thingName / shadow )获取/更新事物阴影,但是我想要在我的账户下创建的事物列表。 Documentation provides the way of getting list-things using AWS CLI, how can i achieve the same using rest-api ? 文档提供了使用AWS CLI获取列表内容的方式,如何使用rest-api实现相同功能?

I found a solution for this, first i build up custom sdk for AWS IoT, using this link you can build, i selected AWS.IoT and AWS.IoTData and build a sdk. 我为此找到了解决方案,首先我为您建立了适用于AWS IoT的自定义sdk,并使用可以构建的链接选择了AWS.IoT和AWS.IoTData并构建了sdk。 After importing that sdk to your solution, you can query like this : 将该SDK导入您的解决方案后,您可以像这样查询:

var iot = new AWS.Iot({
            "accessKeyId":"accessKeyId",
            "secretAccessKey":"secretAccessKey",
            "region":"region"
            });

            iot.listThings({}, function(err, data) {
            if (err) console.log(err, err.stack); // an error occurred
              else     console.log(data);           // successful response
            });

You can find the API documentation here 您可以在此处找到API文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM