请求参数
4.1.3 更新边缘节点
}
状态码
状态码 描述
200 响应参数
错误码
请参见错误码。
4.1.3 更新边缘节点
功能介绍
该API用于更新边缘节点。
调试
您可以在API Explorer中调试该接口。
URI
PUT /v2/{project_id}/edgemgr/nodes/{node_id}
表4-36 路径参数
参数 是否必选 参数类型 描述
project_id 是 String 项目ID
node_id 是 String 边缘节点ID
请求参数
表4-37 请求 Header 参数
参数 是否必选 参数类型 描述
X-Auth-Token 是 String 用户Token。
通过调用IAM服务获取用户 Token接口获取(响应消息头中 X-Subject-Token的值)。
ief-instance-id 否 String 铂金版实例ID,专业版实例为空 值
表4-38 请求 Body 参数
参数 是否必选 参数类型 描述
description 否 String 边缘节点描述,最大长度255,
不允许^ ~ # $ % & * < > ( ) [ ] { } ' " \
log_configs 否 Array of LogConfigs objects
边缘节点日志配置
ntp_servers 否 Array of
strings ntp服务器地址,每个节点最多 仅能配置两个 D310表示D310 类型。 D910表示D910类型。
不填表示为D310类型。
attributes 否 Array of Attributes objects
边缘节点属性,关联属性个数最 多为32个
表4-39 LogConfigs
参数 是否必选 参数类型 描述
参数 是否必选 参数类型 描述
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:边缘节点上系统的 日志
表4-40 Attributes
参数 是否必选 参数类型 描述
key 否 String 节点属性的key值,长度取值范
围为1~128, 仅允许大小写英 文字母、数字、下划线、中划线
value 否 String 节点属性的value值,长度取值
范围为1~256, 仅允许大小写 英文字母、数字、下划线、中划 线
响应参数
状态码: 200
表4-41 响应 Body 参数
参数 参数类型 描述
node EdgeNodeRe
sp object 边缘节点参数
表4-42 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_n
um 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类型和D910类型。
● D310表示D310类型。
● D910表示D910类型。
● 不填表示为D310类型。
nics Array of Nics
objects 节点网卡和对应IP地址信息 host_name String 边缘节点主机名
ief_node_versi
on String 边缘节点版本
参数 参数类型 描述
upgrade_flag Boolean 是否能升级的标志
● true:需要升级
● false:不需要升级
product_id String 产品ID(通过产品证书方式纳管)
group_ids Array of
strings 节点组ID(一个节点属于多个节点组)
upgrade_histo
ry Array of UpgradeHist ory 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_run
time_version String 容器运行时版本
表4-43 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:边缘节点上系统的日志
表4-44 DeviceInfos
参数 参数类型 描述
relation String 设备和节点关系的名称,只允许中文字符、英文 字母、数字、下划线、中划线,最大长度64 comment String 设备和节点关系的描述,最大长度64,不允许^ ~
# $ % & * < > ( ) [ ] { } ' " \ device_ids Array of
strings 设备ID列表
表4-45 GpuInfo
参数 参数类型 描述
name String GPU名称
type String GPU类型
capacity String GPU memory大小,单位MB
表4-46 Nics
参数 参数类型 描述
interface String 边缘节点网卡名称
ip String 上述网卡对应的IPv4地址
表4-47 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 节点升级所消耗的时间
表4-48 Attributes
参数 参数类型 描述
key String 节点属性的key值,长度取值范围为1~128, 仅 允许大小写英文字母、数字、下划线、中划线 value String 节点属性的value值,长度取值范围为1~256, 仅
允许大小写英文字母、数字、下划线、中划线
表4-49 NtpConfigs
参数 参数类型 描述
ntp_enabled Boolean ntp服务是否开启 ntpservers Array of
strings ntp server地址
表4-50 ResourceTag
参数 参数类型 描述
key String 键。最大长度36个unicode字符。 不能为空,只 能包含大小写字母,数字,中划线“-”,下划线
“_”。
value String 值。每个值最大长度43个unicode字符,删除时 如果value有值按照key/value删除,如果value没 值,则按照key删除。 不能为空,只能包含大小 写字母,数字,中划线“-”,下划线“_”。
表4-51 NpuInfo
参数 参数类型 描述
name String NPU名称
type String NPU类型
capacity String NPU memory大小 driver_version String NPU驱动版本
请求示例
{ "node" : {
"description" : "This is a new test node"
}}
响应示例
状态码: 200 更新成功
{ "node" : {
"edged_version" : null, "ca" : null,
"updated_at" : "2018-11-08T04:11:02.138839+08:00", "device_infos" : [ ],
"upgrade_history" : [ ], "pause_docker_image" : null, "ief_node_version" : null,
"id" : "59710cd5-2ade-4b87-b2f8-5752f308a25b", "device_num" : 1,
"certificate" : null, "gpu_num" : null, "os_version" : null, "state" : "UNCONNECTED", "memory" : null,
"project_id" : "{project_id}", "private_key" : null, "os_name" : null,
"description" : "This is a new test node.", "gpu_info" : [ ],
"arch" : null, "host_ips" : [ ], "enable_gpu" : false, "name" : "node_test7", "deployment_num" : 0, "package" : null,
"container_runtime_version" : null,
"created_at" : "2018-11-08T04:03:43.215561+08:00", "cpu" : null,
"id" : "79a1d6fb-4411-4e7e-8d15-b3d5c1b8612b", "size" : null
"id" : "7e6419ac-05e8-4264-a082-f0824cbcd3bb", "size" : 50
"id" : "b5150a39-325a-4872-8b1c-d4585424875e", "size" : null
"id" : "4a19d570-05b6-49e5-9851-cc25f33eb1c3", "size" : 100
错误码
请参见错误码。