aws iot list-things, filtering by attribute-name and attribute-value

0

Hello,
I am trying to find an iot Thing in my registry before doing some other logic.
All the things have an attribute "Serial", so I tried this command:

aws iot list-things --attribute-name "Serial" --attribute-value "1234"

And it doesn't find anything:

{
    "things": []
}

If I try it without any filters:

aws iot list-things

I see the Thing with the attributes, including Serial = 1234

{
    "things": [
        {
            "thingName": "test123",
            "thingTypeName": "Tablet",
            "thingArn": "arn:aws:iot:us-west-2:***********:thing/test123",
            "attributes": {
                "Serial": "1234"
            },
            "version": 1
        }
    ]
}

I even tried aws iot list-things --attribute-name "Serial" and still nothing comes back.

What am I missing?

omora
質問済み 4年前467ビュー
1回答
0

Hi omora,

I see your thing has an associated thing type named Tablet. Is the Serial attribute defined by the Tablet thing type? The only searchable/filterable attributes in the ListThings API are those defined by your thing type (or the 3 attributes you get by default when no thing type is associated).

Ryan

AWS
Ryan_B
回答済み 4年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ