CreateJob
Creates a job and returns the job ID.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
edas:CreateSchedulerxJobCreate |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| Namespace |
string |
Yes |
The namespace ID. You can obtain the ID on the Namespaces page in the console. |
adcfc35d-e2fe-4fe9-bbaa-20e90ffc**** |
| NamespaceSource |
string |
No |
The namespace source. This parameter is required only for specific third-party services. |
schedulerx |
| GroupId |
string |
Yes |
The application ID. You can obtain the ID on the Application Management page in the console. |
testSchedulerx.defaultGroup |
| JobType |
string |
Yes |
The job type. Valid values:
Valid values:
|
java |
| Name |
string |
Yes |
The job name. |
helloworld |
| Description |
string |
No |
The job description. |
Test |
| ExecuteMode |
string |
Yes |
The job execution mode. Valid values:
Valid values:
|
standalone |
| ClassName |
string |
No |
The full path of the job interface class. This parameter is required and must be a full path only when the job type is set to Java. |
com.alibaba.schedulerx.test.helloworld |
| Content |
string |
No |
|
echo 'hello' |
| Parameters |
string |
No |
The custom parameters. These parameters can be obtained during runtime. |
test |
| MaxConcurrency |
integer |
No |
The maximum number of concurrently running instances. Default value: 1. If the previous triggered instance has not finished running, the next instance is not triggered even if the scheduled time is reached. |
1 |
| MaxAttempt |
integer |
No |
The maximum number of retries allowed upon errors. Set this parameter based on your business requirements. Default value: 0. |
0 |
| AttemptInterval |
integer |
No |
The retry interval upon errors. Unit: seconds. Default value: 30. |
30 |
| PageSize |
integer |
No |
The advanced configuration for parallel grid jobs. The number of subtasks pulled at a time. Default value: 100. |
100 |
| ConsumerSize |
integer |
No |
The advanced configuration for parallel grid jobs. The number of execution threads triggered on a single machine at a time. Default value: 5. |
5 |
| QueueSize |
integer |
No |
The advanced configuration for parallel grid jobs. The maximum cache size of the subtask queue. Default value: 10000. |
10000 |
| DispatcherSize |
integer |
No |
The advanced configuration for parallel grid jobs. The number of subtask dispatch threads. Default value: 5. |
5 |
| TimeType |
integer |
Yes |
The scheduling time type. This parameter specifies the scheduling type, not a specific date, time, or timestamp. Valid values:
Valid values:
|
1 |
| TimeExpression |
string |
No |
The time expression. Set the time expression based on the selected time type.
|
0 0/10 * * * ? |
| Calendar |
string |
No |
The custom calendar. This parameter is optional for the cron type. |
workday |
| DataOffset |
integer |
No |
The time offset. Unit: seconds. This parameter is optional for the cron type. |
2400 |
| Timezone |
string |
No |
The time zone. |
GMT+8 |
| TimeoutEnable |
boolean |
No |
Specifies whether to enable the timeout alert. Valid values:
Valid values:
|
false |
| Timeout |
integer |
No |
The timeout threshold. Unit: seconds. Default value: 7200. |
7200 |
| TimeoutKillEnable |
boolean |
No |
Specifies whether to enable the timeout termination feature. Valid values:
Valid values:
|
false |
| FailEnable |
boolean |
No |
Specifies whether to enable the failure alert. Valid values:
Valid values:
|
false |
| FailTimes |
integer |
No |
The number of consecutive failures that trigger an alert. |
2 |
| MissWorkerEnable |
boolean |
No |
Specifies whether to enable the alert for no available workers. Valid values:
|
false |
| SuccessNoticeEnable |
boolean |
No |
Specifies whether to enable the success notification. |
false |
| SendChannel |
string |
No |
The alert notification channel. Valid values:
Valid values:
|
sms |
| TaskMaxAttempt |
integer |
No |
The advanced configuration for parallel grid jobs. The number of retries allowed for a failed subtask. Default value: 0. |
0 |
| TaskAttemptInterval |
integer |
No |
The advanced configuration for parallel grid jobs. The retry interval for a failed subtask. Default value: 0. |
0 |
| ContactInfo |
array<object> |
No |
[Deprecated] The job contact information. |
|
|
object |
No |
The job contact information. |
||
| Ding |
string |
No |
The webhook URL of the DingTalk group chatbot for the alert contact. References: DingTalk development documentation. |
https://oapi.dingtalk.com/robot/send?access_token=********** |
| UserMail |
string |
No |
The email address of the alert contact. |
test***@***.com |
| UserName |
string |
No |
The name of the alert contact. |
John Smith |
| UserPhone |
string |
No |
The mobile phone number of the alert contact. |
1381111**** |
| Status |
integer |
No |
The job status. Valid values:
Valid values:
|
1 |
| XAttrs |
string |
No |
The extended attributes. This parameter is required if the job type is k8s.
|
{"resource":"job"} |
| Priority |
integer |
No |
The job priority. Valid values:
|
5 |
| StartTime |
integer |
No |
The start timestamp. Unit: milliseconds. The value must be later than the current time. A value of -1 indicates that the job starts immediately. |
1789454134000 |
| EndTime |
integer |
No |
The expiration timestamp of the job. Unit: milliseconds. The value must be later than the current time and the start time. A value of -1 indicates that the job never expires. |
1789454134000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
integer |
The return code. |
200 |
| Data |
object |
The job details. |
|
| JobId |
integer |
The job ID. |
92583 |
| Message |
string |
The additional information. |
message |
| RequestId |
string |
The request ID. |
39090022-1F3B-4797-8518-6B61095F1AF0 |
| Success |
boolean |
Indicates whether the job was created. Valid values:
|
true |
Examples
Success response
JSON format
{
"Code": 200,
"Data": {
"JobId": 92583
},
"Message": "message",
"RequestId": "39090022-1F3B-4797-8518-6B61095F1AF0",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.