POST /api/logic/oos/v2/template
{"description":"这是一段描述","name":"test_oos_template1","operators":[{"name":"stop_bcc","description":"停止BCC实例","operator":"BCE::BCC::StopInstance","label":"停止BCC实例","retries":0,"retryInterval":60000,"timeout":3600000,// 指定需要开机的BCC实例"properties":{"instanceId":[{"id":"d8293318-****-****-****-b0e72cb3f3ba","shortId":"i-pqJV5P**"}]}},{"name":"start_bcc","description":"启动BCC实例","operator":"BCE::BCC::StartInstance","label":"启动BCC实例","retries":0,"retryInterval":60000,"timeout":3600000,// 指定需要开机的BCC实例"properties":{"instanceId":[{"id":"d8293318-****-****-****-b0e72cb3f3ba","shortId":"i-pqJV5P**"}]}}],"linear":true}
请求示例2
POST /api/logic/oos/v2/template
{"description":"这是一段描述","name":"test_oos_template2","operators":[{"name":"stop_bcc","description":"停止BCC实例","operator":"BCE::BCC::StopInstance","label":"停止BCC实例","retryInterval":60000,"timeout":3600000,// 引用全局参数中的instanceId1"properties":{"instanceId":{"Ref":"instanceId1"}}},{"name":"start_bcc","description":"启动BCC实例","operator":"BCE::BCC::StartInstance","label":"启动BCC实例","retryInterval":60000,"timeout":3600000,// 引用全局参数中的instanceId2"properties":{"instanceId":{"Ref":"instanceId2"}}}],// 指定全局参数"properties":[{"required":true,"type":"bccInstance","name":"instanceId1"},{"required":true,"type":"bccInstance","name":"instanceId2"}],"linear":true}
POST /api/logic/oos/v2/template/check
// 参考创建运维模板接口
响应示例
成功响应示例
{"success":true,"msg":"","code":200}
失败响应示例
{"success":false,"requestId":"62e96041-****-****-****-bb442548e54c","code":"ExecutionException","message":{"global":"template is invalid: duplicated op name start_bcc"}}