函数:add_category 创建分类

函数名称:创建分类

函数功能:创建新的分类

函数方法

local ok,ret1,ret2 = ts_enterprise_lib:plugin_api_call("DataCenter","add_category",category)

参数 类型 必填 说明
category string 需要创建的数据中心分类名
返回值 类型 说明
ok boolean 操作结果,成功返回 true,失败返回 false
ret1 string/boolean 当 ok 等 于 true,创建成功
当 ok 等于 false,创建失败
ret2 string 当 ret1 等 true,返回成功
当 ret1 等于 false,返回失败原因

函数用例

--企业版库为企业版专用库请勿在除企业版外的产品使用,此库已内置,无需下载
--如果提示没有 ts_enterprise_lib 库请重启企业版客户端服务再试
ts_enterprise_lib = require("ts_enterprise_lib")
assert(ts_enterprise_lib,"无法引入企业专用库")
local category = "要创建的数据中心分类名"
local ok,ret1,ret2 = ts_enterprise_lib:plugin_api_call("DataCenter","add_category",category)
if ok then
    dialog("分类创建成功")
else
    dialog("分类创建失败,失败原因:" .. ret1)
end

注意事项

  • 错误返回 timeout 请在创建分类名前增加代码 ts_enterprise_lib.timeout = 20,如果仍返回 timeout 请修改为 20 以上的数字
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""