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

Updating End Devices for an Edge Node

Function

This API is used to bind an end device to or unbind an end device from an edge node.

URI

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

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.

node_id

Yes

Node 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

devices

Yes

Table 4 object

End device information.

Table 4 devices

Parameter

Mandatory

Type

Description

added

No

Table 5 object

Details about the end device to be bound.

removed

No

Array of strings

ID of the end device to be unbound.

Table 5 added

Parameter

Mandatory

Type

Description

relation

No

String

Relationship between the node and end device. 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 node and end device. The value contains a maximum of 64 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\

device_ids

Yes

Array of strings

A list of end device IDs.

Example request

{
    "devices":{
        "added":{
            "relation":"This_is_a_test_relation",
            "comment":"This is a test comment",
            "device_ids": [
                "c59d8205-e786-4455-8883-12578a34ae90"
            ]
        }
    }
}

Response

Response parameters

Table 6 Parameters in the response body

Parameter

Type

Description

delete_connector

Boolean

Reserved field for industrial devices.

deploy_connector

Array of strings

Reserved field for industrial devices.

deployment_id

String

Reserved field for industrial devices.

update_devices

Table 7 object

Details about the operations on the end devices.

Table 7 devices

Parameter

Type

Description

added

Table 8 object

Details about the end device to be bound.

removed

Array of strings

ID of the end device to be unbound.

Table 8 added

Parameter

Type

Description

relation

String

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

comment

String

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

device_ids

Array of strings

A list of end device IDs.

Example response

{
    "delete_connector": false,
    "deploy_connector": false,
    "deployment_id": "",
    "update_devices": {
        "added": {
            "comment": "This is a test comment",
            "device_ids": [
                "114a9718-052d-4152-a4f5-cd7ab84e6fad"
            ],
            "relation": "This_is_a_test_relation"
        }
    }
}

Error Codes

For details, see Error Codes.