Registering an Edge Node

Function

This API is used to register an edge node.

After the API is successfully called, use Base64 to decode the node.package field in the response body to a tar.gz file. Then, download the edge core software and install it on the edge node to enable IEF to manage the node.

URI

POST /v2/{project_id}/edgemgr/nodes
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

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

Request

Request parameters

Table 2 Parameter description

Parameter

Mandatory

Type

Description

node

Yes

Table 3 object

Parameters about the edge node.

Table 3 node

Parameter

Mandatory

Type

Description

name

Yes

String

Edge node name. The value contains a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

This parameter is mandatory and must be unique in the account.

description

No

String

Edge node description. The value contains a maximum of 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\

enable_gpu

No

Boolean

Whether to enable the Graphics Processing Unit (GPU) on the edge node. Default value: false.

log_configs

No

Array of Table 2 objects

Edge device log configuration.

device_infos

No

Array of Table 3 objects

Device information.

enable_npu

No

Boolean

Whether NPU is enabled on the edge node. The value true indicates that NPU is enabled, and the value false indicates that NPU is not enabled. The default value is false.

attributes

No

Array of Table 26 objects

Properties of the edge node. An edge node can be associated with a maximum of 32 properties.

enable_docker

No

Boolean

Whether Docker is enabled on the edge node. The default value is true.

tags

No

Array of Table 27 objects

Tags of the edge node. An edge node can be configured with a maximum of 20 tags.

mqtt_config

No

Table 38 object

MQTT configuration.

Request example:

{
    "node": {
        "name": "node_test",
        "description": "This is a test node",
        "enable_gpu": false,
        "enable_npu": false,
        "log_configs": [
            {
                "component": "app",
                "type": "local",
                "level": "debug",
                "size": 100,
                "rotate_num": 5,
                "rotate_period": "daily"
            }
        ]
    }
}

Response

Response parameters
Table 4 Parameter description

Parameter

Type

Description

node

Table 1 object

Edge node details.

Response example:

{
    "node": {
        "id": "86715318-a5a7-4507-a289-7238d53d5fed",
        "project_id": "05041fffa40025702f6dc009cc6f8f33",
        "name": "node_test",
        "description": "This is a test node",
        "created_at": "2020-08-11T01:23:55.527805447Z",
        "updated_at": "",
        "state": "UNCONNECTED",
        "master_addr": "https://ief2-placement.cn-north-4.myhuaweicloud.com:443",
        "arch": "",
        "enable_gpu": false,
        "gpu_info": [],
        "gpu_num": 0,
        "memory": 0,
        "os_version": "",
        "os_name": "",
        "device_infos": [],
        "os_type": "",
        "pause_docker_image": "swr.cn-north-4.myhuaweicloud.com/huawei-ief-internal-app/pause",
        "host_name": "",
        "cpu": 0,
        "log_configs": [
            {
                "level": "",
                "rotate_num": 5,
                "component": "app",
                "rotate_period": "daily",
                "type": "local",
                "id": "9b795f5e-01b7-47e8-b1ae-6dc59b9c0005",
                "size": 100
            },
            {
                "level": "false",
                "rotate_num": 5,
                "component": "app",
                "rotate_period": "daily",
                "type": "LTS",
                "id": "e419ab7f-17ea-4757-b62e-311fc777af69",
                "size": 50
            },
            {
                "level": "",
                "rotate_num": 5,
                "component": "system",
                "rotate_period": "daily",
                "type": "local",
                "id": "56dabbb7-4fb1-46cc-85df-dc80a2bd24f8",
                "size": 50
            },
            {
                "level": "false",
                "rotate_num": 5,
                "component": "system",
                "rotate_period": "daily",
                "type": "LTS",
                "id": "0f6935c1-e59d-4b0d-a0db-1ba07b2ac8d1",
                "size": 50
            }
        ],
        "host_ips": [],
        "edged_version": "",
        "deployment_num": 0,
        "device_num": 0,
        "upgrade_history": [],
        "ief_node_version": "",
        "comment": "",
        "ca": "",
        "relation": "",
        "certificate": "",
        "private_key": "",
        "attributes": [],
        "package": "",
        "tags": null,
        "product_id": "",
        "mqtt_mode": "internal",
        "mqtt_internal": "tls://docker0:8883,tls://127.0.0.1:8883",
        "mqtt_external": "",
        "enable_npu": false,
        "docker_enable": true,
        "npu_num": 0,
        "npu_info": [],
        "node_type": "",
        "ntp_configs": null,
        "nics": [],
        "error_reason": "",
        "container_runtime_version": ""
    }
}

Error Codes

For details, see Error Codes.