Skip to content

修改定时任务

接口地址:/v2/cep/enduserapi/v2/setCronJob

请求方式:PUT

请求数据类型:application/json

响应数据类型:*/*

接口描述:

修改定时任务

请求示例:

javascript
{
  "cacheTime": 0,
  "dayOfWeek": "",
  "dk": "",
  "enabled": true,
  "pk": "",
  "ruleId": "",
  "timeZone": "",
  "timers": [
    {
      "action": "",
      "cacheTime": 0,
      "delay": 0,
      "taskLogo": "",
      "taskName": "",
      "time": ""
    }
  ],
  "type": ""
}

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
cmdcmdbodytrue修改定时任务修改定时任务
  cacheTime下行缓存时间,单位秒,值范围:0-7776000falseinteger(int32)
  dayOfWeek重复周期:1:周一,2:周二,3:周三,4:周四,5:周五,6:周六,7:周日,多个使用英文逗号分隔,当 type = custom-repeatmulti-sectionrandom 时必填
  dkDevice Keytruestring
  enabled定时任务状态,启动:true,停止:falsefalseboolean
  pkProduct Keytruestring
  ruleId定时任务IDtruestring
  timeZone时区。格式:+-HH:mmfalsestring
  timers定时任务列表,当 type = multi-section 时,定时任务数量限制为 2-5 个truearray定时任务Req
    action定时任务执行的命令,格式:物模型JSON字符串truestring
    cacheTime下行缓存时间,单位秒,值范围:0-7776000falseinteger
    delay延迟执行时间,单位秒,当 type = delay 时必填falseinteger
    taskLogo任务图标falsestring
    taskName任务名称falsestring
    time执行时间,格式:HH:mm:ss,当 type = onceday-repeatcustom-repeat
  type定时任务类型,once:执行一次,day-repeat:每天重复,custom-repeat:每周重复,multi-section:多段执行,delay:倒计时truestring
Authorizationheaderfalsestring

响应状态:

状态码说明schema
200OKApiResult«Void»
201Created
401Unauthorized
403Forbidden
404Not Found
5066请输入Product Key
5067请输入Device Key
5107请输入开始时间
5108请输入结束时间
5109开始时间格式不正确
5110结束时间格式不正确
5587请输入定时任务类型
5588定时任务类型参数值超出范围
5589请输入定时任务执行的命令
5590请输入周几执行
5591周几执行参数值超出范围
5593请输入定时任务ID
5598请输入执行时间
5599执行时间参数值超出范围
5600开始时间必须小于结束时间
5601请输入延迟执行时间
5602延迟执行时间参数值超出范围
5603修改定时任务失败

响应参数:

参数名称参数说明类型schema
codeinteger(int32)integer(int32)
extMsgstring
msgstring

响应示例:

javascript
{
	"code": 0,
	"extMsg": "",
	"msg": ""
}