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 年前檢視次數 483 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南