Setting the Host Name

Message instance

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

Parameter description

{
    "hostname": "g000121002000220010-ipc01"
}

Level-1 Resource

Description

Type

Value Range

hostname

Host name

string

Only one host name can be configured. The new configuration overwrites the old configuration. The value contains 1 to 63 bytes and cannot be empty.

The host name must meet the following rules:

  • The host name can contain only digits (0-9), letters (a-z and A-Z), and hyphens (-) in ASCII characters. For example, other punctuation marks, spaces, underscores, and Chinese characters are not allowed.
  • The host name cannot start or end with a hyphen (-).
  • It is recommended that the host name do not start with a digit or contain a string that can be interpreted as hexadecimal characters, for example, "beef".
  • Do not use special words in the computer field, such as "up".

After the host name is configured, the result is returned through the common interface, and a static information report is actively triggered.

Result returned

{
    "header":{
        "msg_id":"5d7f1e5f-2e8d-41dc-b620-5318eb6a7962",
        "parent_msg_id": "",
        "timestamp":1652261771062,
        "sync": false
    },
    "route":{
        "source":"hardware",
        "group":"hub",
        "operation":"update",
        "resource":"websocket/config_result"
    },
    "content":"{"topic": "config_hostname", "percentage": "100%", "result": "success", "reason": ""}"
}