{"base_path":null,"components":null,"consumes":"[\"application/json\",\"application/json;charset=utf-8\"]","definitions":{"ApplyObject":{"description":"定时任务应用对象。","properties":{"object_id":{"description":"对象ID。","example":"2b31e-d520xxxx-xxebedb6-e57xxxxxx","maxLength":255,"minLength":1,"type":"string"},"object_name":{"description":"对象名称。","example":"测试桌面","readOnly":true,"type":"string"},"object_type":{"description":"对象类型,可选值为:\n- DESKTOP:桌面。\n- DESKTOP_POOL:桌面池。\n- ALL_DESKTOPS: 所有桌面。\n- DESKTOP_TAG:桌面标签。","enum":["DESKTOP","DESKTOP_POOL","ALL_DESKTOPS","DESKTOP_TAG"],"example":"DESKTOP","maxLength":255,"minLength":1,"type":"string"}},"type":"object"},"BaseResponse":{"description":"API响应基类。","properties":{"encoded_authorization_message":{"description":"加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。","readOnly":true,"type":"string"},"error_code":{"description":"错误码。","maxLength":12,"minLength":0,"type":"string"},"error_msg":{"description":"错误描述。","maxLength":1000,"minLength":0,"type":"string"}}},"CreateScheduledTasksReq":{"allOf":[{"$ref":"#/definitions/ScheduledTaskConfig"},{},{"properties":{"apply_objects":{"description":"定时任务应用的对象列表。","items":{"$ref":"#/definitions/ApplyObject"},"maxItems":1000,"minItems":0,"type":"array"},"description":{"description":"描述。","example":"一个描述","maxLength":255,"minLength":0,"type":"string"},"extra_params":{"description":"扩展参数,json格式。","example":"{ \"notify_message\": \"测试\" }","maxLength":2000,"minLength":0,"type":"string"},"force_execute":{"default":false,"description":"是否强制执行,true表示强制执行,false表示不强制执行。","example":false,"type":"boolean"},"task_name":{"description":"任务名称。","example":"测试任务","maxLength":255,"minLength":1,"type":"string"},"task_type":{"description":"任务类型,可选值为:\n- START:开机。\n- STOP:关机。\n- REBOOT:重启。\n- HIBERNATE:休眠。\n- REBUILD:重建系统盘。\n- EXECUTE_SCRIPT:执行脚本。\n- CREATE_SNAPSHOT:创建快照。","enum":["START","STOP","REBOOT","HIBERNATE","REBUILD","EXECUTE_SCRIPT","CREATE_SNAPSHOT"],"example":"START","maxLength":255,"minLength":1,"type":"string"},"wait_time":{"default":0,"description":"触发式任务触发后,等待时长。","format":"int32","maximum":43200,"minimum":0,"type":"integer"}},"type":"object"}],"description":"创建定时任务请求体。"},"ScheduledTaskConfig":{"description":"定时任务时间配置。","properties":{"date_list":{"description":"周期按月时:取值1~31及L(代表当月最后一天),英文逗号分隔,如1,2,28,L。","example":"1,2,28,L","maxLength":255,"minLength":0,"type":"string"},"day_interval":{"description":"周期按天时:按x天间隔执行。","example":1,"format":"int32","maximum":31,"minimum":1,"type":"integer"},"expire_time":{"description":"到期时间,格式为yyyy-MM-dd HH:mm:ss。","example":"2022-12-31 09:00:00","maxLength":255,"minLength":0,"type":"string"},"gray_count":{"description":"灰度对象数量,优先级高于gray_desktop_ids。只支持脚本执行。","format":"int32","maximum":1000,"minimum":0,"type":"integer"},"gray_desktop_ids":{"description":"灰度执行的桌面id列表,优先级低于gray_count。只支持脚本执行。","items":{"maxLength":255,"minLength":0,"type":"string"},"maxItems":1000,"minItems":0,"type":"array","x-maxLength":1000,"x-minLength":0},"gray_fail_threshold":{"description":"灰度失败阈值,灰度执行失败次数达到该值时,不执行下一批任务。只支持脚本执行。","format":"int32","maximum":1000,"minimum":1,"type":"integer"},"life_cycle_type":{"description":"触发场景。POST_CREATE_DESKTOP_SUCCESS:创建桌面成功后,POST_REBUILD_DESKTOP_SUCCESS:重建桌面成功后,POST_REATTACH_DESKTOP_SUCCESS:触发重建的分配用户任务成功后,POST_DESKTOP_DISCONNECTED:桌面断开连接后。","maxLength":255,"minLength":0,"type":"string"},"month_list":{"description":"周期按月时:取值1~12,英文逗号分隔,如1,3,12。","example":"1,3,12","maxLength":255,"minLength":0,"type":"string"},"scheduled_date":{"description":"周期指定时间时:表示指定的日期,格式为yyyy-MM-dd。","example":"2022-12-23","maxLength":255,"minLength":0,"type":"string"},"scheduled_time":{"description":"指定的执行时间点,格式为HH:mm:ss。","example":"09:00:00","maxLength":255,"minLength":0,"type":"string"},"scheduled_type":{"description":"执行周期类型,可选值为:\n- FIXED_TIME:指定时间。\n- DAY:按天。\n- WEEK:按周。\n- MONTH:按月。\n- LIFE_CYCLE:指定场景下触发。","enum":["FIXED_TIME","DAY","WEEK","MONTH","LIFE_CYCLE"],"example":"FIXED_TIME","maxLength":255,"minLength":1,"type":"string"},"time_zone":{"description":"时区。","example":"Asia/Shanghai","maxLength":2000,"minLength":0,"type":"string"},"week_list":{"description":"周期按周时:取值1~7,分别对应周日~周六,英文逗号分隔,如1,2,7。","example":"1,2,7","maxLength":255,"minLength":0,"type":"string"}},"type":"object"}},"description":null,"group_id":"7383c32d5d5e4d0481c071faeb994404","host":"workspace.cn-north-4.myhuaweicloud.com","id":"20d9acefe9d846f6b5edc85d50920031","info_version":"v2","method":"post","name":"CreateScheduledTasks","parameters":{},"paths":{"/v2/{project_id}/scheduled-tasks":{"post":{"description":"创建定时任务。\n注:需通过开通委托功能接口先对云服务进行授权才可以使用该功能","operationId":"CreateScheduledTasks","parameters":[{"description":"项目ID。","in":"path","maxLength":255,"minLength":1,"name":"project_id","required":true,"type":"string","x-annotations":"@Size(max = 255, min = 1)","x-example":"2b31ed520xxxxxxebedb6e57xxxxxxxx"},{"description":"用户Token。\n\n通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。","in":"header","maxLength":40000,"minLength":1,"name":"X-Auth-Token","required":false,"type":"string","x-annotations":"@Size(max = 40000, min = 1)","x-example":"MIIDkgYJKoZIhvcNAQcCoIIDgzCCXXXXXX...","x-is-registered":"N"},{"description":"请求参数。","in":"body","name":"CreateScheduledTasksRequestBody","required":true,"schema":{"$ref":"#/definitions/CreateScheduledTasksReq"}}],"responses":{"200":{"description":"正常。"},"400":{"description":"由于包含语法错误,当前请求无法被服务器理解。","schema":{"$ref":"#/definitions/BaseResponse"}},"500":{"description":"服务内部错误,具体返回错误码请参见错误码说明。","schema":{"$ref":"#/definitions/BaseResponse"}}},"summary":"创建定时任务","tags":["ScheduledTask"],"x-api-type":"open-api","x-apiexplorer-hide":"N","x-apig-group":"public,internal_token","x-apigateway-request-type":"public","x-is-registered":"Y","x-methodAnnotations":["@EnableAuth","@WksIamAuthMeta(resourceType=ResourceType.SCHEDULED_TASK)","@IamAuthMeta(authLevel = IamAuthLevel.INSTANCE_LIST, abacAction = \"workspace:scheduledTasks:create\", needApigwJwtAuthCheck = false, authContextInitializerName = \"createScheduledTasksAuthContextInitializer\", needRbacCheck = false, needAbacResourceCheck = true)","@CtsMeta(serviceType = \"Workspace\", resourceType = \"workspace\", traceName = \"createScheduledTasks\")"],"x-request-examples-1":{"apply_objects":[{"object_id":"2b31e-d520xxxx-xxebedb6-e57xxxxxx","object_type":"DESKTOP"}],"date_list":"1,2,28,L","day_interval":1,"description":"一个描述。","expire_time":"2022-12-31 09:00:00","extra_params":"{ \"notify_message\": \"测试\" }","force_execute":false,"gray_count":1000,"gray_desktop_ids":["string"],"gray_fail_threshold":1000,"life_cycle_type":"string","month_list":"1,3,12","scheduled_date":"2022-12-23","scheduled_time":"09:00:00","scheduled_type":"FIXED_TIME","task_name":"测试任务","task_type":"START","time_zone":"Asia/Shanghai","wait_time":0,"week_list":"1,2,7"},"x-request-examples-text-1":{"apply_objects":[{"object_id":"2b31e-d520xxxx-xxebedb6-e57xxxxxx","object_type":"DESKTOP"}],"date_list":"1,2,28,L","day_interval":1,"description":"一个描述。","expire_time":"2022-12-31 09:00:00","extra_params":"{ \"notify_message\": \"测试\" }","force_execute":false,"gray_count":1000,"gray_desktop_ids":["string"],"gray_fail_threshold":1000,"life_cycle_type":"string","month_list":"1,3,12","scheduled_date":"2022-12-23","scheduled_time":"09:00:00","scheduled_type":"FIXED_TIME","task_name":"测试任务","task_type":"START","time_zone":"Asia/Shanghai","wait_time":0,"week_list":"1,2,7"},"x-support-sdk":"Y"}}},"product_short":"Workspace","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":{"apig-auth-app":{"in":"header","name":"Authorization","type":"apiKey","x-apigateway-auth-type":"AppSigv1"},"apig-auth-iam":{"in":"header","name":"unused","type":"apiKey","x-apigateway-auth-type":"IAM"},"apig-auth-iam-used-authn5":{"in":"header","name":"unused","type":"apiKey","x-apigateway-auth-opt":{"inner-auth-type":"iam_auth_n5"},"x-apigateway-auth-type":"IAM"}},"summary":"创建定时任务","tags":"定时任务","uri":null,"version":"2.0"}