Querying a List of Edge Devices

Function

This API is used to query a list of edge devices.

URI

GET /v2/{project_id}/edgemgr/devices?{name=xxx,tags=xxx,limit=xxx,offset=xxx}

Table 1 Path parameter

Parameter

Mandatory

Description

project_id

Yes

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

name

No

String

Edge device name, which supports fuzzy match.

node_id

No

String

Node ID, which exactly matches a node.

limit

No

String

Number of records displayed on each page. The value range is 1–1000. The default value is 1000.

offset

No

String

Start position for a query. The value is a non-negative integer. The default value is 0.

is_binding

No

String

Whether to bind a device to an edge node. If the value is true, a list of devices that have been bound to a node is returned. If the value is false, a list of devices that are not bound to a node is returned.

tags

No

String

Tag, which is a key-value pair. Connect each key and value by a period (.).

If there are multiple tags, separate them by commas (,). Example: tags=key1.value1,key2.value2

  • If no query parameter is specified, all edge devices about an account are returned.
  • tags and node_id can be used for a compound query. If multiple other query parameters are specified, the edge services that meet all the specified query parameters are returned.
  • is_binding cannot be used with other parameters for a compound query.

Request

None

Response

Response parameters
Table 3 Parameter description

Parameter

Type

Description

devices

Array of Table 5 objects

Edge device list.

count

Integer

Number of edge devices that meet the conditions.

Example response

{
    "devices": [
        {
            "id": "1398f13d-f24d-4de4-8cd3-5905db1d6d9f",
            "name": "device",
            "access_protocol": "",
            "project_id": "05e1aef9040010e22fccc009adecb056",
            "description": "",
            "created_at": "2020-09-23T02:00:22.858736Z",
            "updated_at": "",
            "access_config": {},
            "connection_type": "edge"
        }
    ],
    "count": 1
}

Error Codes

For details, see Error Codes.