Configuring Container Attributes
Before deploying a container using FusionDirector, you can use this message to configure container attributes.
Message instance
{
"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": {
}
}
Parameter description
The content message is described as follows:
{
"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"
}]
}]
}
Level-1 Resource |
Level-2 Resource |
Level-3 Resource |
Description |
|---|---|---|---|
operation |
- |
- |
Meaning: operation type Type: string The value is update, indicating that the model file is updated. |
source |
- |
- |
Meaning: target type Type: string The value is all, indicating that all model files in the delivered message are operated. |
pod_name |
- |
- |
Meaning: name of a pod Type: string Value: The format complies with the regular expression ^[0-9a-z][0-9a-z-]{1,128}$. |
pod_uid |
- |
- |
Meaning: ID of the Kubernetes pod Type: string Value: The format complies with the regular expression ^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$. |
uuid |
- |
- |
Meaning: service ID Type: string Value: The format complies with the regular expression ^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$. |
container |
- |
- |
Meaning: container information Type: list Value range: 1 to 10 |
- |
modelfile |
- |
Meaning: model file information Type: list Value range: 0–256 |
- |
- |
name |
Meaning: model file name Type: string Value: a string of 1 to 256 bytes. The value must comply with the regular expression ^[a-zA-Z0-9_.-]{1,256}$ and cannot contain two periods (..). Only .om, .tar.gz, and .zip files are supported. |
- |
- |
version |
Meaning: model file version Type: string Value: matching the regular expression ^[a-z0-9]([a-z0-9._-]{0,62}[a-z0-9]){0,1}$ |
- |
- |
active_type |
Meaning: model file activation mode Type: string Value:
|
A response is returned by the edge side after the message is received.
{
"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"
}
In addition, the edge side sends a configuration result message to the cloud and reports the progress. For details about the result, see Returning Configuration Result.
{
"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\": \"\"}"
}