All Products
Search
Document Center

SchedulerX:UpdateJob

Last Updated:Dec 10, 2024

Updates the configuration information about a job. By default, you need to call the GetJobInfo operation to obtain the original configuration of the job before you call this operation to modify the configuration as required.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
edas:ManageSchedulerxJobModifyupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
NamespacestringYes

The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

adcfc35d-e2fe-4fe9-bbaa-20e90ffc****
NamespaceSourcestringNo

The namespace source. This parameter is required only for a special third party.

schedulerx
GroupIdstringYes

The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

testSchedulerx.defaultGroup
JobIdlongYes

The job ID. You can obtain the job ID on the Task Management page in the SchedulerX console.

92583
NamestringNo

The job name.

helloword
DescriptionstringNo

The job description.

test
ExecuteModestringNo

The execution mode of the job. Valid values:

  • Stand-alone operation: standalone
  • Broadcast run: broadcatst
  • Visual MapReduce: parallel
  • MapReduce: batch
  • Shard run: shard
standalone
ClassNamestringNo

The full path of the job interface class.

This field is available only when you set the job type to java. In this case, you must enter a full path.

com.alibaba.test.helloworld
ContentstringNo

The script content. This parameter is required when you set the job type to python, shell, go, or k8s.

echo 'hello'
ParametersstringNo

The user-defined parameters that you can obtain when the job is running.

test
MaxConcurrencyintegerNo

The maximum number of concurrent instances. Default value: 1. The default value indicates that only one instance is allowed to run at a time. When an instance is running, another instance is not triggered even if the scheduled time for running the instance is reached.

1
MaxAttemptintegerNo

The maximum number of retries after a job failure. This parameter is specified based on your business requirements.

0
AttemptIntervalintegerNo

The interval of retries after a job failure. Default value: 30. Unit: seconds.

30
PageSizeintegerNo

The number of tasks that can be pulled at a time. Default value: 100. This parameter is an advanced configuration item of the MapReduce job.

100
TaskDispatchModestringNo

The job mode. Valid values: push and pull. This parameter is an advanced configuration item of the MapReduce job.

push
ConsumerSizeintegerNo

The number of threads that are triggered by a single worker at a time. Default value: 5. This parameter is an advanced configuration item of the MapReduce job.

5
QueueSizeintegerNo

The maximum number of tasks that can be queued. Default value: 10000. This parameter is an advanced configuration item of the MapReduce job.

10000
DispatcherSizeintegerNo

The number of task distribution threads. Default value: 5. This parameter is an advanced configuration item of the MapReduce job.

5
TaskMaxAttemptintegerNo

The number of retries after a task failure. This parameter is an advanced configuration item of the MapReduce job.

0
TaskAttemptIntervalintegerNo

The interval of retries after a task failure. This parameter is an advanced configuration item of the MapReduce job.

0
TimeTypeintegerNo

The time type. Valid values:

  • 1: cron
  • 3: fix_rate
  • 4: second_delay
  • 100: api
1
TimeExpressionstringNo

The time expression. Specify the time expression based on the value of TimeType:

  • If you set TimeType to 1 (cron), specify this parameter to a standard CRON expression.
  • If you set TimeType to 100 (api), no time expression is required.
  • If you set TimeType to 3 (fixed_rate), specify this parameter to a fixed frequency in seconds. For example, if you set this parameter to 30, the system triggers a job every 30 seconds.
  • If you set TimeType to 4 (second_delay), specify this parameter to a fixed delay after which the job is triggered. Valid values: 1 to 60. Unit: seconds.
30
CalendarstringNo

If you set TimeType to 1 (cron), you can specify calendar days.

Business days
DataOffsetintegerNo

If you set TimeType to 1 (cron), you can specify a time offset. Unit: seconds.

2400
TimezonestringNo

Time zone.

GMT+8
TimeoutEnablebooleanNo

Specifies whether to turn on Timeout alarm. If the switch is turned on, an alert will be generated upon a timeout. Valid values:

  • true
  • false
true
TimeoutlongNo

The timeout threshold. Unit: seconds.

7200
TimeoutKillEnablebooleanNo

Specifies whether to turn on Timeout termination. If the switch is turned on, the job will be terminated upon a timeout. Valid values:

  • true
  • false
true
FailEnablebooleanNo

Specifies whether to turn on Failure alarm. If the switch is turned on, an alert will be generated upon a failure. Valid values:

  • true
  • false
true
FailTimesintegerNo

The number of consecutive failures. An alert will be received if the number of consecutive failures reaches the value of this parameter.

1
MissWorkerEnablebooleanNo

Specifies whether to turn on No machine alarm available. If the switch is turned on, an alert will be generated when no machine is available for running the job. Valid values:

  • true
  • false
true
SuccessNoticeEnablebooleanNo

Specifies whether to turn on Successful notice. If the switch is turned on, a notice will be sent when a job succeeds.

false
SendChannelstringNo

The method that is used to send alerts. Only Short Message Service (SMS) is supported.

sms
ContactInfoarray<object>No

The information about the alert contact.

objectNo
UserPhonestringNo

The mobile phone number of the alert contact.

1381111****
UserNamestringNo

The name of the alert contact.

userA
UserMailstringNo

The email address of the alert contact.

test***@***.com
DingstringNo

The webhook URL of the DingTalk chatbot.

https://oapi.dingtalk.com/robot/send?access_token=**********
XAttrsstringNo

If you set JobType to k8s, this parameter is required. xxljob task: {"resource":"job"} shell task: {"image":"busybox","resource":"shell"}

{"resource":"shell","fileFormat":"unix","templateType":"customTemplate"}
TemplatestringNo

Custom task template for the k8s task type.

apiVersion: v1 kind: Pod metadata: name: schedulerx-node-{JOB_ID} namespace: {NAMESPACE} spec: containers: - name: node-job image: node:16 imagePullPolicy: IfNotPresent volumeMounts: - name: script-node mountPath: script/node command: ["node", "script/node/node-{JOB_ID}.js"] volumes: - name: script-node configMap: name: schedulerx-configmap items: - key: schedulerx-node-{JOB_ID} path: node-{JOB_ID}.js restartPolicy: Never
Note When you call the UpdateJob operation to update a scheduled job, the original parameter configurations of the job are deleted. Therefore, call the GetJobInfo operation to obtain the original configuration of the job before you configure the job based on the actual situation.

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The HTTP status code.

200
Messagestring

The additional information returned only if an error occurs.

job type is java className can not be blank
RequestIdstring

The request ID.

4F68ABED-AC31-4412-9297-D9A8F0401108
Successboolean

Indicates whether the request was successful.

true

Examples

Sample success responses

JSONformat

{
  "Code": 200,
  "Message": "job type is java className can not be blank",
  "RequestId": "4F68ABED-AC31-4412-9297-D9A8F0401108",
  "Success": true
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-10-18The response structure of the API has changedView Change Details
2023-06-07The request parameters of the API has changedView Change Details
2023-03-30The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-12-26The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-09-28The internal configuration of the API is changed, but the call is not affectedView Change Details