IOT边缘 IOTEDGE-添加应用配置模板:请求示例

时间:2024-06-20 17:14:27

请求示例

POST https://{endpoint}/v2/{project_id}/templates/apps/configs

{
  "tpl_id" : "general_app_tpl",
  "name" : "general_app_tpl",
  "description" : "通用应用配置模板",
  "config_tabs" : [ {
    "key" : "connection_info",
    "name" : "连接信息",
    "description" : "连接信息",
    "config_items" : [ {
      "key" : "endpoint",
      "name" : "服务端点",
      "description" : "服务完整URL",
      "data_type" : "string",
      "required" : true,
      "crypted" : false,
      "max_length" : 128,
      "example" : "opc.tcp://127.0.0.1:53530/OPCUA"
    }, {
      "key" : "username",
      "name" : "用户名",
      "description" : "OPCUA服务器认证用户名",
      "data_type" : "string",
      "required" : false,
      "crypted" : false,
      "max_length" : 128,
      "example" : "admin"
    }, {
      "key" : "password",
      "name" : "密码",
      "description" : "OPCUA服务器认证密码",
      "data_type" : "string",
      "required" : false,
      "crypted" : true,
      "max_length" : 512,
      "example" : "******"
    } ]
  }, {
    "key" : "collection_paras",
    "name" : "连接附加参数",
    "description" : "连接附加参数",
    "config_items" : [ {
      "key" : "default_cycle",
      "name" : "采集周期",
      "description" : "采集周期",
      "data_type" : "int",
      "required" : true,
      "crypted" : false,
      "max_length" : 65535,
      "example" : 10000
    } ]
  } ],
  "default_values" : {
    "appname" : "LINK"
  }
}
support.huaweicloud.com/api-iotedge/AddAppConfigsTemplates.html