更新时间:2023-11-29 GMT+08:00
分享

绑定或解绑边缘节点

功能介绍

边缘节点组绑定或解绑边缘节点。该API只能在铂金版实例中使用

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

PUT /v2/{project_id}/edgemgr/groups/{group_id}/nodes

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID

group_id

String

边缘节点组ID

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

ief-instance-id

String

铂金版实例ID,专业版实例为空值

Content-Type

String

消息体的类型(格式),默认取值为“application/json”

表3 请求Body参数

参数

是否必选

参数类型

描述

add_node_ids

Array of strings

新增绑定的节点ID列表

remove_node_ids

Array of strings

新增解绑的节点ID列表

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

id

String

边缘节点组ID

name

String

边缘节点组名称,小写英文字母、数字、中划线,以小写字母或数字开头,最大长度为32个字符,不能为空

description

String

描述

created_at

String

创建时间

updated_at

String

更新时间

project_id

String

边缘节点组所属的项目ID

iam_role

String

边缘节点组所属账号的IAM权限,没有铂金版权限的账号无法使用节点组功能

cpu

Integer

边缘节点组CPU总数,为边缘节点组所绑定的边缘节点的CPU数目之和

memory

Integer

边缘节点组内存总数,为边缘节点组所绑定的边缘节点的内存之和

gpu_num

Integer

边缘节点组GPU总数,为边缘节点组所绑定的边缘节点的GPU数目之和

nodes

Array of EdgeNodeResp objects

绑定的边缘节点详情

deployments

Array of GroupDeployment objects

绑定的边缘应用详情

attributes

Array of Attributes objects

属性

tags

Array of Attributes objects

标签

success_node_add

Array of strings

绑定操作成功的节点ID列表

success_node_del

Array of strings

解绑操作成功的节点ID列表

failed_node_add

Array of strings

绑定操作失败的节点ID列表

failed_node_del

Array of strings

解绑操作失败的节点ID列表

表5 EdgeNodeResp

参数

参数类型

描述

id

String

边缘节点ID

name

String

边缘节点名称,只允许中文字符、英文字母、数字、下划线、中划线,最大长度64 Name为必填字段,且本账号中唯一。

description

String

边缘节点描述,最大长度255,不允许^ ~ # $ % & * < > ( ) [ ] { } ' " \

created_at

String

创建时间

updated_at

String

更新时间

project_id

String

项目ID

private_key

String

私钥

certificate

String

证书

ca

String

根证书

state

String

边缘节点状态

  • UNCONNECTED(未注册)

  • RUNNING(运行中)

  • FAIL(故障)

  • STOPPED(停用)

  • UPGRADING(升级中)

  • FREEZE(冻结)

package

String

将证书文件certificate/ca/private_key打成.tar.gz包后用base64编码的字符串。 使用时请使用base64解码成.tar.gz包。

master_addr

String

云端服务URL

cpu

Integer

边缘节点CPU核心数

memory

Integer

边缘节点内存大小,单位M

os_name

String

边缘节点操作系统名称

os_version

String

边缘节点操作系统版本

pause_docker_image

String

pause容器镜像URL

arch

String

边缘节点架构

os_type

String

边缘节点操作系统类型

deployment_num

Integer

部署在该边缘节点上的应用实例个数

enable_gpu

Boolean

边缘节点是否开启GPU,默认为false

log_configs

Array of LogConfigs objects

边缘节点日志配置,当用户未配置日志相关字段时,将默认打开日志上传到云端功能。

device_infos

Array of DeviceInfos objects

关联设备信息

edged_version

String

edged版本

gpu_num

Integer

gpu个数

host_ips

Array of strings

主机IP,默认返回eth0网卡的IP。

relation

String

与device绑定关系名称(通过device id查询node时有值)

comment

String

与device绑定关系描述(通过device id查询node时有值)

gpu_info

Array of GpuInfo objects

gpu型号和gpu memory大小

device_num

Integer

关联设备数量

enable_npu

Boolean

边缘节点是否开启NPU,true表示开启,false表示不开启,默认为false

npu_type

String

NPU类型,支持D310、D310B,支持填写:

  • D310:D310类型

  • D310B:D310B类型

  • 空值:D310类型。

nics

Array of Nics objects

节点网卡和对应IP地址信息

host_name

String

边缘节点主机名

ief_node_version

String

边缘节点版本

upgrade_flag

Boolean

是否能升级的标志

  • true:需要升级

  • false:不需要升级

product_id

String

产品ID(通过产品证书方式纳管)

group_ids

Array of strings

节点组ID(一个节点属于多个节点组)

upgrade_history

Array of UpgradeHistory objects

节点安装或升级记录

attributes

Array of Attributes objects

边缘节点属性,关联属性个数最多为32个

docker_enable

Boolean

节点是否开启Docker

mqtt_mode

String

mqtt集成模式

  • internal:edgecore内置mqtt

  • external:外置开源mqtt

mqtt_external

String

外置开源mqtt地址

mqtt_internal

String

edgecore内置的mqtt地址

node_type

String

节点类型,默认为空,非空时为小站节点

ntp_configs

NtpConfigs object

ntp配置

error_reason

String

节点故障原因

tags

Array of ResourceTag objects

边缘节点标签,标签个数最多为20个

npu_num

Integer

NPU数量

npu_info

Array of NpuInfo objects

NPU型号和NPU Memory大小

container_runtime_version

String

容器运行时版本

identifier

String

边缘节点使用token注册时的凭证

purchase_id

String

IEC/IES节点id

state_details

StateDetails object

IEC/IES节点状态详情

cert_remaining_valid_time

Integer

证书有效期持续时间

表6 LogConfigs

参数

参数类型

描述

id

String

数据库保存的主键,不需要关注此字段。

size

Integer

应用日志文件大小限制,单位MB,默认50,取值范围10-1000。

level

String

  • 当type为LTS时,应用级日志可配置为On或Off;系统级日志可配置为Off/Error/Warning/Info/Debug;

  • 当type为local时,无需配置level。

rotate_num

Integer

应用日志rotate个数,默认5,取值范围1-10。

rotate_period

String

应用日志rotate周期,可选项:

  • daily

  • monthly

  • weekly

  • yearly

type

String

  • LTS:将日志发送到AOM

  • local:本地日志

component

String

  • app:部署到边缘节点上的应用的日志

  • system:边缘节点上系统的日志

表7 DeviceInfos

参数

参数类型

描述

relation

String

设备和节点关系的名称,只允许中文字符、英文字母、数字、下划线、中划线,最大长度64

comment

String

设备和节点关系的描述,最大长度64,不允许^ ~ # $ % & * < > ( ) [ ] { } ' " \

device_ids

Array of strings

设备ID列表

表8 GpuInfo

参数

参数类型

描述

name

String

GPU名称

type

String

GPU类型

capacity

String

GPU memory大小,单位MB

表9 Nics

参数

参数类型

描述

interface

String

边缘节点网卡名称

ip

String

上述网卡对应的IPv4地址

表10 UpgradeHistory

参数

参数类型

描述

id

Integer

节点升级或安装历史版本id

from_version

String

节点升级前节点上edgecore版本号,形式如2.1.0,其中每一位都是整数

to_version

String

节点升级或安装后节点行edgecore版本号,形式如2.1.0,其中每一位都是整数

upgrade_time

Integer

节点升级或安装的十位时间戳

result

String

节点升级或安装状态,包含

  • install_success:边缘节点安装成功

  • upgrade_success:边缘节点升级成功

  • install_failed:边缘节点安装失败

  • upgrade_failed:边缘节点升级失败

  • upgrade_failed_rollback_success:边缘节点升级失败回滚成功

  • upgrade_failed_rollback_failed:边缘节点升级失败回滚失败

dur_time

Integer

节点升级所消耗的时间

表11 NtpConfigs

参数

参数类型

描述

ntp_enabled

Boolean

ntp服务是否开启

ntp_servers

Array of strings

ntp server地址

表12 ResourceTag

参数

参数类型

描述

key

String

键。最大长度36个unicode字符。 不能为空,只能包含大小写字母,数字,中划线“-”,下划线“_”。

value

String

值。每个值最大长度43个unicode字符,删除时如果value有值按照key/value删除,如果value没值,则按照key删除。 不能为空,只能包含大小写字母,数字,中划线“-”,下划线“_”。

表13 NpuInfo

参数

参数类型

描述

name

String

NPU名称

type

String

NPU类型

capacity

String

NPU memory大小

driver_version

String

NPU驱动版本

表14 StateDetails

参数

参数类型

描述

register_stat

String

IEC/IES节点注册状态

purchase_stat

String

IEC/IES节点状态

purchase_error

String

IEC/IES节点错误信息

表15 GroupDeployment

参数

参数类型

描述

id

String

应用部署uuid

name

String

应用部署名称,只允许英文小写字母、数字、中划线,最大长度32, 英文小写字母或数字开头和结尾

description

String

应用部署描述,最大长度255,不允许^ ~ # $ % & * < > ( ) [ ] { } ' " \

project_id

String

项目ID

created_at

String

应用部署创建时间

updated_at

String

应用部署更新时间

表16 Attributes

参数

参数类型

描述

key

String

节点属性的key值,长度取值范围为1~128, 仅允许大小写英文字母、数字、下划线、中划线

value

String

节点属性的value值,长度取值范围为1~256, 仅允许大小写英文字母、数字、下划线、中划线

请求示例

绑定边缘节点,指定绑定的节点ID。

{
  "add_node_ids" : [ "024e05a8-89bf-46d8-b298-700a2af69605" ],
  "remove_node_ids" : [ ]
}

响应示例

状态码: 200

成功

{
  "id" : "e4f9c0d6-e1d7-41d5-a108-f38aa8372ffd",
  "name" : "test1",
  "description" : "",
  "created_at" : "2022-06-07 08:21:05.794205 +0000 UTC",
  "updated_at" : "2022-06-07 08:21:05.794217 +0000 UTC",
  "project_id" : "xxx",
  "iam_role" : "",
  "memory" : 8595,
  "cpu" : 5,
  "gpu_num" : 0,
  "nodes" : [ {
    "id" : "024e05a8-89bf-46d8-b298-700a2af69605",
    "project_id" : "xxx",
    "name" : "test1",
    "description" : "",
    "created_at" : "2022-08-05 02:14:52.351802 +0000 UTC",
    "updated_at" : "2022-10-31 19:19:37.104359 +0000 UTC",
    "state" : "RUNNING",
    "master_addr" : "xxx/xxx",
    "arch" : "x86_64",
    "enable_gpu" : false,
    "gpu_info" : [ ],
    "gpu_num" : 0,
    "memory" : 990,
    "os_version" : "3.10.0-1062.12.1.el7.x86_64",
    "os_name" : "CentOS Linux 7 (Core)",
    "device_infos" : null,
    "os_type" : "linux",
    "pause_docker_image" : "",
    "host_name" : "test1",
    "cpu" : 1,
    "log_configs" : [ {
      "level" : "on",
      "rotate_num" : 5,
      "component" : "app",
      "rotate_period" : "yearly",
      "type" : "LTS",
      "id" : "",
      "size" : 50
    }, {
      "level" : "info",
      "rotate_num" : 5,
      "component" : "system",
      "rotate_period" : "yearly",
      "type" : "LTS",
      "id" : "",
      "size" : 50
    }, {
      "level" : "",
      "rotate_num" : 5,
      "component" : "app",
      "rotate_period" : "daily",
      "type" : "local",
      "id" : "",
      "size" : 50
    }, {
      "level" : "info",
      "rotate_num" : 5,
      "component" : "system",
      "rotate_period" : "daily",
      "type" : "local",
      "id" : "",
      "size" : 50
    } ],
    "host_ips" : [ "192.168.0.x" ],
    "edged_version" : "2.1.0",
    "deployment_num" : 1,
    "device_num" : 2,
    "upgrade_history" : [ {
      "to_version" : "2.55.8",
      "upgrade_time" : 1659694662,
      "id" : 0,
      "result" : "install_success",
      "from_version" : "",
      "dur_time" : 0
    }, {
      "to_version" : "2.55.9",
      "upgrade_time" : 1660642318,
      "id" : 1,
      "result" : "upgrade_success",
      "from_version" : "2.55.8",
      "dur_time" : 30
    }, {
      "to_version" : "2.56.0",
      "upgrade_time" : 1662019732,
      "id" : 2,
      "result" : "upgrade_success",
      "from_version" : "2.55.9",
      "dur_time" : 29
    }, {
      "to_version" : "2.56.0",
      "upgrade_time" : 1663125401,
      "id" : 3,
      "result" : "upgrade_failed_rollback_success",
      "from_version" : "2.56.0",
      "dur_time" : 3
    } ],
    "ief_node_version" : "2.3.0",
    "upgrade_flag" : false,
    "comment" : "",
    "ca" : "",
    "relation" : "",
    "certificate" : "",
    "private_key" : "",
    "attributes" : null,
    "package" : "",
    "tags" : null,
    "product_id" : "",
    "mqtt_mode" : "internal",
    "mqtt_internal" : "",
    "mqtt_external" : "",
    "enable_npu" : false,
    "npu_type" : "",
    "docker_enable" : null,
    "npu_num" : 0,
    "npu_info" : [ ],
    "node_type" : "",
    "ntp_configs" : null,
    "nics" : null,
    "error_reason" : "",
    "container_runtime_version" : "",
    "purchase_id" : "",
    "state_details" : {
      "register_stat" : "",
      "purchase_stat" : "",
      "purchase_error" : ""
    },
    "cert_remaining_valid_time" : 0
  }, {
    "id" : "de5d81fe-a58e-4ec4-be9d-f3906d7fe356",
    "project_id" : "xxx",
    "name" : "cjq-test-1008",
    "description" : "",
    "created_at" : "2022-10-07 23:19:18.147956 +0000 UTC",
    "updated_at" : "2022-10-27 23:20:09.631153 +0000 UTC",
    "state" : "RUNNING",
    "master_addr" : "xxx",
    "arch" : "x86_64",
    "enable_gpu" : false,
    "gpu_info" : [ ],
    "gpu_num" : 0,
    "memory" : 7805,
    "os_version" : "3.10.0-862.14.1.5.h408.eulerosv2r7.x86_64",
    "os_name" : "EulerOS 2.0 (SP5)",
    "device_infos" : null,
    "os_type" : "linux",
    "pause_docker_image" : "",
    "host_name" : "ecs-81ba",
    "cpu" : 4,
    "log_configs" : null,
    "host_ips" : [ "192.168.0.161" ],
    "edged_version" : "2.1.0",
    "deployment_num" : 1,
    "device_num" : 0,
    "upgrade_history" : [ {
      "to_version" : "2.53.4",
      "upgrade_time" : 1665215216,
      "id" : 0,
      "result" : "install_success",
      "from_version" : "",
      "dur_time" : 0
    }, {
      "to_version" : "2.56.5",
      "upgrade_time" : 1666839798,
      "id" : 1,
      "result" : "upgrade_success",
      "from_version" : "2.56.4",
      "dur_time" : 22
    }, {
      "to_version" : "2.56.6",
      "upgrade_time" : 1666872187,
      "id" : 2,
      "result" : "upgrade_success",
      "from_version" : "2.56.5",
      "dur_time" : 23
    } ],
    "ief_node_version" : "2.56.6",
    "upgrade_flag" : false,
    "comment" : "",
    "ca" : "",
    "relation" : "",
    "certificate" : "",
    "private_key" : "",
    "attributes" : null,
    "package" : "",
    "tags" : null,
    "product_id" : "",
    "mqtt_mode" : "internal",
    "mqtt_internal" : "",
    "mqtt_external" : "",
    "enable_npu" : false,
    "npu_type" : "",
    "docker_enable" : null,
    "npu_num" : 0,
    "npu_info" : [ ],
    "node_type" : "",
    "ntp_configs" : null,
    "nics" : null,
    "error_reason" : "",
    "container_runtime_version" : "",
    "purchase_id" : "",
    "state_details" : {
      "register_stat" : "",
      "purchase_stat" : "",
      "purchase_error" : ""
    },
    "cert_remaining_valid_time" : 0
  } ],
  "deployments" : [ ],
  "attributes" : [ ],
  "failed_node_add" : null,
  "failed_node_del" : null,
  "success_node_add" : null,
  "success_node_del" : null
}

状态码

状态码

描述

200

成功

错误码

请参见错误码

分享:

    相关文档

    相关产品