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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인