下载
中文
注册

配置容器属性

配置容器属性,FusionDirector部署容器之前会通过此消息配置容器相关属性。

消息示例

{
    "header": {
        "msg_id": "741aec66-99b2-4d97-aaf2-63d27f53bbc5",
        "parent_msg_id": "",
        "timestamp": 1550107087319,
        "sync": true
    },
    "route": {
        "source": "controller",
        "group": "hardware",
        "operation": "update",
        "resource": "websocket/container_info"
    },
    "content": {
    }
}

参数说明

content消息内容描述如下:

{
    "operation": "update",
    "source": "all",
    "pod_name": "dockerapplication-bdf3242b-aec1-4100-af91-afa2b8fde88a",
    "pod_uid": "bdf3242b-aec1-4100-af91-afa2b8fde88a",
    "uuid": "447c3c43-4bbe-4dd1-b493-d6dc442b4c72",
    "container": [{
        "modelfile": [{
            "name": "XXX",
            "version": "1.0",
            "active_type": "hot_update| cold_update"  
        }]
    }]
}

一级资源

二级资源

三级资源

说明

operation

-

-

含义:操作类型

类型:string

取值为update,表示模型文件更新操作

source

-

-

含义:目标类型

类型:string

取值为all,表示操作下发消息中的所有模型文件

pod_name

-

-

含义:Pod的名称

类型:string

取值:格式符合正则模式^[0-9a-z][0-9a-z-]{1,128}$

pod_uid

-

-

含义:k8s pod的ID

类型:string

取值:格式符合正则模式 ^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$

uuid

-

-

含义:服务ID

类型:string

取值:格式符合正则模式 ^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$

container

-

-

含义:容器信息

类型:list

取值:1~10

-

modelfile

-

含义:模型文件信息

类型:list

取值:0~256

-

-

name

含义:模型文件名称

类型:string

取值:1~256字节,格式符合正则模式“^[a-zA-Z0-9_.-]{1,256}$”,且不包含两个“.”。仅支持.om、.tar.gz、.zip三种类型文件。

-

-

version

含义:模型文件版本

类型:string

取值:格式符合正则模式^[a-z0-9]([a-z0-9._-]{0,62}[a-z0-9]){0,1}$

-

-

active_type

含义:模型文件生效方式

类型:string

取值:

  • hot_update:热生效,不需要重启容器
  • cold_update,冷生效,需要重启容器

边侧收到消息后返回响应

{
    "header":{
    "msg_id":"ea3116aa-fd5c-446d-8c5a-2793dd09402e",
    "parent_msg_id":"706cd361-5b54-4d32-8771-550633378db4",
    "timestamp":1652182722100,
    "sync": true,
    "resourceversion": "1.0"
    },
    "route":{
        "source":"controller",
        "group":"hardware",
        "operation":"REPORT",
        "resource":"websocket/container_info"
    },
    "content":"OK"
}

此外,边侧还会向云侧发送返回配置结果消息,上报进度

{
    "header": {
        "msg_id": "bf93c5ee-065c-4da6-b6fa-65073d29fc3f",
        "parent_msg_id": "",
        "timestamp": 1683623267,
        "sync": false
    },
    "route": {
        "source": "hardware",
        "group": "hub",
        "resource": "websocket/config_result",
        "operation": "update"
    },
    "content": "{\"topic\": \"container_info\", \"percentage\": \"100%\", \"result\": \"success\", \"reason\": \"\"}"
}