Creates a job.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The cluster ID. |
xxljob-b6ec1xxxx |
| AppName |
string |
Yes |
The application name. |
test-app |
| Name |
string |
Yes |
The job name. |
test-job |
| Description |
string |
No |
The job description. |
test |
| JobType |
string |
Yes |
The job type. |
xxljob |
| RouteStrategy |
integer |
No |
The routing strategy. Valid values:
|
1 |
| Parameters |
string |
No |
The job parameters. |
test |
| MaxConcurrency |
integer |
No |
The maximum concurrency. |
1 |
| MaxAttempt |
integer |
No |
The maximum number of retries on error. Set this based on your business requirements. |
3 |
| AttemptInterval |
integer |
No |
The retry interval on error, in seconds. Default value: 30. |
3 |
| JobHandler |
string |
No |
The name of the job handler. |
testJobVoidHandler |
| Script |
string |
No |
For non-BEAN job types, pass the script content through this field. |
echo "hello world" |
| TimeType |
integer |
Yes |
The time type:
|
-1 |
| TimeExpression |
string |
No |
The time expression. Set the time expression based on the selected time type.
|
0 0 4 ? * Mon/1 |
| Calendar |
string |
No |
The custom calendar. You can specify a custom calendar for the cron type. |
workday |
| Timezone |
string |
No |
The time zone. |
GMT+8 |
| StartTimeType |
integer |
No |
The start time type. |
1 |
| StartTime |
integer |
No |
The start time. |
1701310327000 |
| XAttrs |
string |
No |
For K8s job types, this parameter must be configured. Job task: {"resource":"job"} Shell task: {"image":"busybox","resource":"shell"} |
{"resource":"job"} |
| Priority |
integer |
No |
The priority:
|
5 |
| NoticeConfig |
object |
No |
The notification configuration. |
1 |
| TimeoutEnable |
boolean |
No |
Specifies whether to enable timeout alerts. Valid values:
|
true |
| Timeout |
integer |
No |
The timeout period, in seconds. |
30 |
| TimeoutKillEnable |
boolean |
No |
Specifies whether to enable timeout termination. Valid values:
|
true |
| SuccessNotice |
boolean |
No |
Specifies whether to enable success notifications. Valid values:
|
true |
| FailEnable |
boolean |
No |
Specifies whether to enable failure alerts. Valid values:
|
true |
| FailLimitTimes |
integer |
No |
The number of consecutive failures. Note
An alert is sent only when the number of consecutive failures exceeds the configured value. |
1 |
| MissWorkerEnable |
boolean |
No |
Specifies whether to enable alerts for no available workers.
|
true |
| SendChannel |
string |
No |
The notification channel. Valid values:
Note
To configure multiple notification channels, separate them with commas. |
|
| EndEarlyEnable |
boolean |
No |
||
| EndEarly |
integer |
No |
30 |
|
| NoticeContacts |
array<object> |
No |
The notification contact configuration. |
|
|
object |
No |
. |
||
| ContactType |
integer |
No |
The notification contact type. Valid values:
|
1 |
| Name |
string |
No |
The name of the alert contact or alert contact group. |
xiaoming |
| ExecutorBlockStrategy |
integer |
No |
The client-side blocking strategy.
|
1 |
| Status |
integer |
No |
The job status. Default value: enabled.
|
1 |
| ChildJobId |
string |
No |
The IDs of child jobs, separated by commas. |
1,2 |
| Weight |
integer |
No |
The job weight. |
1 |
| DependentStrategy |
integer |
No |
The dependency strategy. |
1 |
| Coordinate |
object |
No |
The coordinates of the node in the workflow. |
|
| X |
number |
No |
The X coordinate. |
100.0 |
| Y |
number |
No |
The Y coordinate. |
100.0 |
| Width |
number |
No |
The width. |
100.0 |
| Height |
number |
No |
The height. |
50.0 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| Code |
integer |
The response code. |
200 |
| Message |
string |
The error message. |
Parameter error: content is null. |
| RequestId |
string |
The request ID, which is a unique identifier generated by Alibaba Cloud for this request. You can use it to troubleshoot issues. |
3835AA29-2298-5434-BC53-9CC377CDFD2C |
| Success |
boolean |
Indicates whether the call was successful.
|
true |
| Data |
object |
|
|
| JobId |
integer |
The job ID. |
74 |
Examples
Success response
JSON format
{
"Code": 200,
"Message": "Parameter error: content is null.",
"RequestId": "3835AA29-2298-5434-BC53-9CC377CDFD2C",
"Success": true,
"Data": {
"JobId": 74
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | Parameter error: %s. | Parameter error: %s |
| 401 | IllegalRequest | IllegalRequest: %s. | Illegal request:%s |
| 500 | InternalError | InternalError: %s. | System Internal Error: %s |
| 403 | NoPermission | No permission to perform this operation: %s. | No permission to perform this operation: %s |
| 404 | NotFound | Not found: %s. | The resource does not exist: %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.