{"base_path":"/","components":null,"consumes":"[\"application/json;charset=UTF-8\"]","definitions":{"DataResp":{"description":"响应信息","properties":{"data":{"description":"响应数据","readOnly":true,"type":"string"}}},"ErrorRsp":{"description":"失败时返回的错误对象","properties":{"error_code":{"description":"错误码","maxLength":36,"minLength":8,"type":"string"},"error_msg":{"description":"错误描述","maxLength":512,"minLength":2,"type":"string"}},"required":["error_code","error_msg"]},"MessageNotification":{"description":"消息通知","properties":{"notification_endpoint_type":{"description":"通知对象类型","enum":["USER","ON_CALL"],"maxLength":32,"minLength":1,"type":"string"},"policy":{"description":"通知策略","example":"START_EXECUTION","maxLength":128,"minLength":0,"type":"string"},"protocol":{"description":"通知渠道","enum":["DEFAULT","NONE","SMS","EMAIL","DINGDING","LARK","WELINK","CALLNOTIFY","WECHAT"],"maxLength":32,"minLength":1,"type":"string"},"recipients":{"description":"消息接收人","maxLength":3200,"minLength":0,"type":"string"},"schedule_role_id":{"description":"排班角色ID","maxLength":128,"minLength":0,"type":"string"},"schedule_scene_id":{"description":"排班场景ID","maxLength":128,"minLength":0,"type":"string"}},"required":["notification_endpoint_type"],"type":"object","x-imports":["com.huawei.coc.scheduled.job.enums.ProtocolEnums"]},"ResourceQuery":{"description":"查询条件参数类","properties":{"key":{"description":"参数名","example":"name","maxLength":255,"minLength":1,"type":"string"},"value":{"description":"参数值","example":"张三","maxLength":255,"minLength":0,"type":"string"}},"required":["key","value"],"type":"object"},"ScheduleInstance":{"description":"保存定时任务关联的实例选择条件或实例信息","properties":{"batch_strategy":{"description":"实例分批策略(AUTO_BATCH,MANUAL_BATCH,NONE)","enum":["AUTO_BATCH","MANUAL_BATCH","NONE"],"example":"AUTO_BATCH","maxLength":32,"minLength":0,"type":"string"},"order_no":{"description":"步骤号","format":"int32","maximum":10000,"minimum":0,"type":"integer"},"sub_target_instances":{"description":"目标实例","items":{"$ref":"#/definitions/ScheduleInstance"},"maxItems":100000,"minItems":0,"type":"array","x-maxLength":100000,"x-minLength":0},"target_instances":{"description":"实例信息","maxLength":100000000,"minLength":0,"type":"string"},"target_resource":{"$ref":"#/definitions/TargetResource","description":"实例查询条件"},"target_selection":{"description":"目标选择方式,枚举值:ALL 全部实例,MANUAL 手动选择, NONE","enum":["ALL","MANUAL","NONE"],"example":"ALL","maxLength":32,"minLength":1,"type":"string"}},"required":["target_selection","order_no"],"type":"object"},"ScheduledTaskRequestBody":{"allOf":[{"$ref":"#/definitions/TicketInformation"},{"properties":{"agency_name":{"description":"委托名称","maxLength":128,"minLength":1,"type":"string"},"associated_task_enterprise_project_id":{"description":"关联任务的企业项目ID","maxLength":256,"minLength":0,"type":"string"},"associated_task_id":{"description":"关联任务ID(脚本ID/作业ID)","example":"Customization","maxLength":256,"minLength":0,"type":"string"},"associated_task_name":{"description":"关联任务名称(脚本名称/作业名称)","maxLength":256,"minLength":0,"type":"string"},"associated_task_name_en":{"description":"关联任务名称(英文)(脚本名称/作业名称)","maxLength":256,"minLength":0,"type":"string"},"associated_task_type":{"description":"关联任务的类型","enum":["COMMUNAL","CUSTOMIZATION"],"maxLength":32,"minLength":1,"type":"string"},"enable_approve":{"description":"是否开启入库人工审核","type":"boolean"},"enable_message_notification":{"description":"是否启用消息通知","type":"boolean"},"enterprise_project_id":{"description":"企业项目id","maxLength":128,"minLength":1,"type":"string"},"input_param":{"additionalProperties":{"maxLength":2147483647,"minLength":0,"type":"string"},"description":"执行参数,值为json串","type":"object","x-maxLength":2147483647,"x-minLength":0},"message_notification":{"$ref":"#/definitions/MessageNotification","description":"消息通知"},"name":{"description":"任务名称","example":"patch_scan_job","maxLength":128,"minLength":3,"type":"string","x-param-annotations":["@Pattern(regexp = \"[\\\\u4e00-\\\\u9fa5a-zA-Z0-9_-]{3,100}\", message =\"parameter name error.\")"]},"reviewer_notification":{"$ref":"#/definitions/MessageNotification","description":"审核人通知信息"},"reviewer_user_name":{"description":"审核人昵称","maxLength":3200,"minLength":0,"type":"string"},"risk_level":{"description":"风险等级","enum":["HIGH","MEDIUM","LOW"],"maxLength":32,"minLength":1,"type":"string"},"runbook_instance_mode":{"description":"作业实例模式","enum":["SAME","DIFF"],"maxLength":32,"minLength":1,"type":"string"},"target_instances":{"description":"目标实例信息","items":{"$ref":"#/definitions/ScheduleInstance"},"maxItems":1000,"minItems":1,"type":"array","x-maxLength":1000,"x-minLength":1},"task_type":{"description":"任务类型","enum":["RUNBOOK","SCRIPT"],"maxLength":32,"minLength":1,"type":"string"},"trigger_time":{"$ref":"#/definitions/TriggerTime","description":"定时设置触发时间"},"version_no":{"description":"版本号","maxLength":32,"minLength":1,"type":"string"}},"required":["name","version_no","trigger_time","task_type","associated_task_id","associated_task_type","associated_task_name","risk_level","input_param","target_instances","enable_approve","enable_message_notification","target_selection"],"type":"object"}],"description":"创建定时任务请求体"},"TargetResource":{"description":"目标资源接受类","properties":{"app_name":{"description":"应用名称(层级关系用.隔开)","example":"COC-CDR.COC-CDR_component.分组01","maxLength":1024,"minLength":0,"type":"string"},"id":{"description":"资源id","example":"cn-north-7","maxLength":1024,"minLength":0,"type":"string"},"params":{"description":"动态查询条件","items":{"$ref":"#/definitions/ResourceQuery"},"maxItems":1000,"minItems":0,"type":"array","x-maxLength":1000,"x-minLength":0},"region_id":{"description":"region(应用关联region)","example":"cn-north-7","maxLength":32,"minLength":0,"type":"string"},"type":{"description":"资源类型(REGION, APPLICATION)","enum":["REGION","APPLICATION"],"example":"region","maxLength":32,"minLength":0,"type":"string"}},"type":"object"},"TicketInfo":{"description":"requestBody中包含的,前端选择的四号单的信息","properties":{"scope_id":{"description":"region id","example":"cn-north-7","maxLength":50,"minLength":0,"type":"string"},"target_id":{"description":"四号单关联的应用id","example":"64db3cb747c26529355eb32f","maxLength":255,"minLength":0,"type":"string"},"ticket_id":{"description":"四号单id","example":"CM202405221739540119523656","maxLength":255,"minLength":0,"type":"string"},"ticket_type":{"description":"四号单类型,可选CHANGE/INCIDENT/ALARM/WARROOM","example":"CHANGE","maxLength":50,"minLength":0,"type":"string"}},"type":"object","x-ref-external":"com.huawei.coc.common.model.req.cim.TicketInfo"},"TicketInformation":{"properties":{"ticket_infos":{"description":"选择的四号提权单信息","items":{"$ref":"#/definitions/TicketInfo"},"maxItems":1000,"minItems":0,"type":"array"}},"type":"object","x-ref-external":"com.huawei.coc.common.model.req.cim.TicketInfos"},"TriggerTime":{"description":"定时任务触发时间","properties":{"cron":{"description":"cron表达式","example":"0 15 10 ? * *","maxLength":256,"minLength":0,"type":"string"},"period":{"description":"周期执行时的具体星期列表按逗号分割, 如星期日为\"1\",星期一为\"2\"","example":"1,2,3,5,6","maxLength":256,"minLength":0,"type":"string"},"periodic_scheduled_time":{"description":"周期执行的执行当天的时间 \"00:00:00\"","example":"00:00:00","maxLength":128,"minLength":0,"type":"string"},"policy":{"description":"策略","enum":["PERIODIC","ONCE","CRON"],"maxLength":32,"minLength":1,"type":"string"},"scheduled_close_time":{"description":"定时任务规则截止日期时间戳","example":1683772662000,"format":"int64","maximum":9000000000000000,"minimum":0,"type":"integer"},"single_scheduled_time":{"description":"单次执行的执行时间戳","example":1683772662000,"format":"int64","maximum":9000000000000000,"minimum":0,"type":"integer"},"time_zone":{"description":"时区","maxLength":128,"minLength":0,"type":"string"}},"required":["time_zone","policy"],"type":"object"}},"description":null,"group_id":"82af75d8fb894fc2b06ca4175859ba53","host":"coc.myhuaweicloud.com","id":"0126eb9a5bf7453cb9e236afd9ecfe7d","info_version":"v1","method":"post","name":"CreateScheduledTask","parameters":{},"paths":{"/v1/schedule/task":{"post":{"description":"Create Scheduled Task","operationId":"CreateScheduledTask","parameters":[{"description":"ScheduledTask object that needs to be created","in":"body","name":"CreateScheduledTaskRequestBody","required":true,"schema":{"$ref":"#/definitions/ScheduledTaskRequestBody"}}],"produces":["application/json"],"responses":{"200":{"description":"Scheduled Task Id","schema":{"$ref":"#/definitions/DataResp"}},"400":{"description":"Error response","schema":{"$ref":"#/definitions/ErrorRsp"}}},"summary":"新建定时运维","tags":["ScheduledTask"],"x-api-type":"open-api","x-class-annotations":["@EnableAuth"],"x-imports":["com.huawei.clouds.wushan.integration.common.auth.EnableAuth","com.huawei.clouds.wushan.auth.token.IamAuthMeta","com.huawei.clouds.wushan.auth.token.IamAuthLevel","com.huawei.coc.scheduled.job.framework.auth.ScheduleTaskQueryActionInitializer","com.huawei.coc.scheduled.job.framework.auth.ScheduleTaskActionInitializer","com.huawei.coc.scheduled.job.framework.auth.ScheduleTaskHistoryActionInitializer","com.huawei.coc.scheduled.job.framework.auth.ScheduleTaskCreateActionInitializer","com.huawei.clouds.wushan.cts.meta.CtsMeta","com.huawei.coc.common.utils.annotation.CtsExtendMeta","com.huawei.coc.scheduled.job.enums.PolicyEnum","com.huawei.coc.scheduled.job.enums.TaskType","com.huawei.coc.scheduled.job.enums.RiskLevelEnum","com.huawei.coc.scheduled.job.enums.ApproveStatusParamEnum","com.huawei.coc.common.utils.enums.RunbookOperationStatus","com.huawei.coc.common.utils.enums.TaskSource","com.huawei.coc.common.utils.annotation.CheckEnum","jakarta.servlet.http.HttpServletRequest","com.huawei.clouds.wushan.auth.token.meta.BssOpType"],"x-is-registered":"Y","x-method-annotations":["@IamAuthMeta(needApigwJwtAuthCheck = false, authLevel = IamAuthLevel.INSTANCE_LIST, abacAction = \"coc:schedule:create\",needAbacResourceCheck = true, authContextInitializer = ScheduleTaskCreateActionInitializer.class,needRbacCheck = false, supportAllGrantedEps = true, opType = BssOpType.RESOURCE)","@CtsExtendMeta(resourceId = \"#DataResp.data\", resourceName = \"ScheduledTask\", resourceIdKey = \"data\")","@CtsMeta(resourceType = \"schedule\", traceName = \"createScheduledTask\", operationId = \"CreateScheduledTask\")"],"x-request-examples-text-1":"{}","x-requestHandler":true,"x-support-sdk":"Y"}}},"product_short":"COC","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"新建定时运维","tags":"ScheduledTask","uri":null,"version":"2.0"}