Updated on 2023-11-23 GMT+08:00

Querying a List of Edge Nodes

Function

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

URI

GET /v2/{project_id}/edgemgr/nodes?{name=xxx,limit=xxx,app_name=xxx,tags=xxx.xxx,device_id=xxx,device_name=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 node name, which supports fuzzy match.

limit

No

String

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

offset

No

String

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

device_id

No

String

Search by end device ID.

device_name

No

String

Search by the name of the bound end device.

app_name

No

String

Search by application name.

tags

No

String

The key and value of a tag are separated by dots (.), and multiple tags are separated by commas (,). For example, tags=key1.value1,key2.value2.

  • If no query parameter is specified, all edge nodes about an account are returned.
  • app_name cannot be combined with tags for a compound query. If the two parameters are both specified, only the edge nodes that meet the tags parameter are returned. If multiple other query parameters are specified, the edge nodes that meet all the specified query parameters are returned.

Request

Table 3 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

The default value application/json is recommended.

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Response

Response parameters
Table 4 Parameters in the response body

Parameter

Type

Description

nodes

Array of Table 1 objects

Edge node list.

count

Integer

Number of edge nodes that meet the conditions.

Example response

{
    "count": 1,
    "nodes": [
        {
            "comment": null,
            "enable_npu": null,
            "edged_version": "2.6.0",
            "mqtt_internal": "tls://0.0.0.0:8883",
            "ca": null,
            "updated_at": "2019-07-24T03:52:53.545185+08:00",
            "node_type": null,
            "docker_enable": true,
            "device_infos": [],
            "upgrade_history": [
                {
                    "to_version": "2.3.0",
                    "upgrade_time": 1557987888,
                    "result": "install_success",
                    "id": 0
                },
                {
                    "from_version": "2.3.0",
                    "to_version": "2.3.0",
                    "result": "install_success",
                    "dur_time": 2248264,
                    "upgrade_time": 1560236152,
                    "id": 1
                },
                {
                    "from_version": "2.3.0",
                    "to_version": "2.3.0",
                    "result": "install_success",
                    "dur_time": 87129,
                    "upgrade_time": 1560323281,
                    "id": 2
                },
                {
                    "from_version": "2.3.0",
                    "to_version": "2.3.0",
                    "result": "install_success",
                    "dur_time": 158246,
                    "upgrade_time": 1560481527,
                    "id": 3
                },
                {
                    "from_version": "2.3.0",
                    "to_version": "2.5.0",
                    "result": "install_success",
                    "dur_time": 1466742,
                    "upgrade_time": 1561948269,
                    "id": 4
                },
                {
                    "from_version": "2.5.0",
                    "to_version": "2.5.0",
                    "result": "install_success",
                    "dur_time": 884941,
                    "upgrade_time": 1562833210,
                    "id": 5
                },
                {
                    "from_version": "2.5.0",
                    "to_version": "2.6.0",
                    "result": "install_success",
                    "dur_time": 1106868,
                    "upgrade_time": 1563940078,
                    "id": 6
                }
            ],
            "pause_docker_image": null,
            "ntp_configs": {
                "ntp_servers": [
                    "10.127.1.0",
                    "ntp.myhuaweicloud.com"
                ],
                "ntp_enabled": true
            },
            "ief_node_version": "2.6.0",
            "id": "699de693-8493-4912-89dc-882134c5bf13",
            "device_num": 0,
            "certificate": null,
            "nics": [
                {
                    "interface": "eth0",
                    "ip": "10.0.0.41"
                }
            ],
            "gpu_num": 0,
            "os_version": "3.10.0-957.21.3.el7.x86_64",
            "state": "RUNNING",
            "error_reason": null,
            "memory": 990,
            "mqtt_mode": "internal",
            "project_id": "",
            "private_key": null,
            "os_name": "CentOS Linux 7 (Core)",
            "description": "",
            "gpu_info": [],
            "attributes": [],
            "mqtt_external": null,
            "arch": "x86_64",
            "host_ips": [
                "10.0.0.41"
            ],
            "enable_gpu": false,
            "enable_npu": false,
  
            "name": "ief-node",
            "deployment_num": 0,
            "package": null,
            "container_runtime_version": "docker://19.03.0",
            "created_at": "2019-05-16T06:19:10.303502+08:00",
            "cpu": 1,
            "product_id": null,
            "host_name": "iefnode",
            "relation": null,
            "os_type": "linux",
            "log_configs": []
        }
    ]
}

Error Codes

For details, see Error Codes.