Help Center/ Intelligent EdgeFabric/ API Reference/ API/ End Device Management/ Updating Edge Nodes for an End Device
Updated on 2023-11-23 GMT+08:00

Updating Edge Nodes for an End Device

Function

This API is used to update edge nodes for an end device.

The function is the same as that of the API described in Updating End Devices for an Edge Node. The API described in Updating End Devices for an Edge Node is recommended.

URI

PUT /v2/{project_id}/edgemgr/devices/{device_id}/nodes

Table 1 Path parameters

Parameter

Mandatory

Description

project_id

Yes

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

device_id

Yes

Device ID.

Request

Request parameters

Table 2 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.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

nodes

Yes

Table 4 object

Node information.

Table 4 node

Parameter

Mandatory

Type

Description

added

No

Table 5 object

Details about the node to be bound.

removed

No

Array of strings

ID of the edge node to be unbound.

Table 5 added

Parameter

Mandatory

Type

Description

relation

No

String

Relationship between the device and node. The value contains a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

comment

No

String

Description of the relationship between the device and node. The description contains a maximum of 64 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\

node_ids

Yes

Array of strings

Node ID list. A device can be bound to only one edge node.

Example request

{
    "nodes": {
        "added": {
            "node_ids": [
                "592ede18-d030-4cc1-afb8-34ac1bae47f6"
            ],
            "relation": "abcd",
            "comment": "hello world"
        },
        "removed": []
    }
}

Response

Response parameters

Table 6 Parameters in the response body

Parameter

Type

Description

update_nodes

Table 7 object

Node information.

Table 7 update_nodes

Parameter

Type

Description

added

Table 8 object

Details about the node to be bound.

removed

Array of strings

ID of the edge node to be unbound.

Table 8 added

Parameter

Type

Description

relation

String

Relationship between the device and node. The value contains a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

comment

String

Description of the relationship between the device and node. The description contains a maximum of 64 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\

node_ids

Array of strings

Node ID list. A device can be bound to only one edge node.

Example response

{
    "update_nodes": {
        "removed": [],
        "added": {
            "comment": "hello world",
            "relation": "abcd",
            "node_ids": [
                "592ede18-d030-4cc1-afb8-34ac1bae47f6"
            ]
        }
    }
}

Error Codes

For details, see Error Codes.