【问题标题】:auto creation of aws iot thing and attaching it to a thing group自动创建 aws iot 事物并将其附加到事物组
【发布时间】:2018-04-07 19:46:10
【问题描述】:
  • 我已经创建了东西、证书、策略并使用 python 成功地附加了它们。
  • 我已经建立了一个想法,即不是为每个创建的新事物创建策略,我们可以创建一个事物组并为该组创建一个策略并将事物添加到其中,然后将该组策略分享给我们创建的每一个新事物

  • 我对如何实现我的想法一无所知,我一直在寻找参考来做这件事,但我仍然没有找到任何有用的链接或指南。如果你知道任何帖子

【问题讨论】:

    标签: python-3.x aws-iot


    【解决方案1】:

    大家好,经过长时间的搜索,我找到了解决方案。

    def add_thing_to_thing_group():
        client = boto3.client('iot')
        thing_group_name ='your thing group name'
        thing_group_arn ='your thing group arn'
        thing_name ='your thing name'
        thing_arn ='your thing arn'
        client.add_thing_to_thing_group(
        thingGroupName= thing_group_name,
        thingGroupArn= thing_group_arn,
        thingName= thing_name,
        thingArn= thing_arn
        )
    
    • 需要boto3包
    • 事物组 arn 和事物 arn 在 aws iot 控制台中可用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-03
      • 2019-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      • 2020-05-05
      相关资源
      最近更新 更多