Read Devices collection
Devices collection with at least the threadBorderRouter item representing the Thread Border Router.
Background Logic
A updateDeviceCollectionTask posted on api/actions triggers an update of this resource. For updateing the resource, it performs a procedure similar to the ot-ctl meshdiag topology CLI command:
- for each router, query the following Diagnostic TLVs using multicast and unicast retries:
- TLV 0: MAC Extended Address (64-bit)
- TLV 1: MAC Address (16-bit)
- TLV 8: IPv6 Address List
- TLV 24: Version
- TLV 29: Child
- TLV 30: Child IPv6 Address List
- look up hostname and services instance name for each SRP-registered IPv6 address
- augment local data for the local threadBorderRouter item
- generate threadDevice or threadBorderRouter items based on the TLV and networkData
On GET request, the collection is returned, with following attributes for each device:
- extAddress
- mlEidIid
- mode
- omrIpv6Address
- eui (optional)
- hostname
- role
- created
- updated (optional)
And additional attributes for this threadBorderRouter item:
- rloc16
- extPanId
- networkName
- routerId (optional)
- leaderData
- routerCount
- rlocAddress
- baId
Query parameters
A selector that allows clients to request a subset of items of the given type only:
- with all attributes, for example, fields[addThreadDeviceTask] or fields[{type}] in general
- with selected attributes only ("Sparse Fieldset"), fields[nodeDevice]=vendorModel,operationalDataset.active.channel or fields[{type}]={attributeKey}(,{attributeKey})* in general
Condition
The {type} must be given (in other words, not empty). The value of the parameter must be fully omitted (in other words, no = in query) or contain one or more type-specific {attributeKey}s in a comma-separated list. An {attributeKey} may use the dot notation to select a subordinate field of the attribute.
Allowed characters for {type} and {attributeKey} are alphanumeric characters, underscores (_), hyphens (-), and dots (.) for nested fields. Commas (,) are used as separators. Allowed character set (regex): ^[A-Za-z0-9_.\-\,]+$
Examples
- ?fields[threadDevice]=hostname,role
- ?fields[addThreadDeviceTask]=eui,pskd&fields[threadDevice]=hostname
- ?fields[threadDevice] (all attributes for threadDevice)
Headers
Must be set to application/vnd.api+json or application/json
Response
(JSON:API) document with one or more data objects representing threadDevice items.