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
gefragt vor 4 Jahren493 Aufrufe
1 Antwort
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
beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen