UpdateJob

更新时间:
复制 MD 格式

Update job configuration information. By default, the system first invokes the operation to retrieve the job and locate the corresponding field for modification.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

edas:ManageSchedulerxJobModify

update

*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 namespace ID on the Namespace page in the SchedulerX console.

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

NamespaceSource

string

No

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

schedulerx

GroupId

string

Yes

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

testSchedulerx.defaultGroup

JobId

integer

Yes

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

92583

Name

string

No

The job name.

helloword

Description

string

No

The job description.

test

ExecuteMode

string

No

The execution mode of the job. Valid values:

  • Stand-alone operation: standalone

  • Broadcast run: broadcatst

  • Visual MapReduce: parallel

  • MapReduce: batch

  • Shard run: shard

standalone

ClassName

string

No

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

Content

string

No

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

echo 'hello'

Parameters

string

No

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

test

MaxConcurrency

integer

No

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

MaxAttempt

integer

No

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

0

AttemptInterval

integer

No

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

30

PageSize

integer

No

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

TaskDispatchMode

string

No

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

Valid values:

  • pull :

    pull

  • push :

    push

push

ConsumerSize

integer

No

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

QueueSize

integer

No

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

10000

DispatcherSize

integer

No

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

5

TaskMaxAttempt

integer

No

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

0

TaskAttemptInterval

integer

No

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

0

TimeType

integer

No

The time type. Valid values:

  • 1: cron

  • 3: fix_rate

  • 4: second_delay

  • 100: api

1

TimeExpression

string

No

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

Calendar

string

No

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

workday

DataOffset

integer

No

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

2400

Timezone

string

No

Time zone.

GMT+8

TimeoutEnable

boolean

No

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

Timeout

integer

No

The timeout threshold. Unit: seconds.

7200

TimeoutKillEnable

boolean

No

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

FailEnable

boolean

No

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

FailTimes

integer

No

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

1

MissWorkerEnable

boolean

No

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

SuccessNoticeEnable

boolean

No

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

false

SendChannel

string

No

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

sms

ContactInfo

array<object>

No

The information about the alert contact.

object

No

UserPhone

string

No

The mobile phone number of the alert contact.

1381111****

UserName

string

No

The name of the alert contact.

userA

UserMail

string

No

The email address of the alert contact.

test***@***.com

Ding

string

No

The webhook URL of the DingTalk chatbot.

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

XAttrs

string

No

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"}

Template

string

No

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

Priority

integer

No

Task Priority. Valid values:

  • 1: Low

  • 5: Medium

  • 10: High

  • 15: Very High

5

Note

When you invoke UpdateJob to update a scheduling task, the system deletes the previous configuration of the corresponding parameter instead of retaining it. Therefore, you must first invoke GetJobInfo to obtain the previous configuration of the target task, and then configure it based on your actual requirements.

Response elements

Element

Type

Description

Example

object

Code

integer

The HTTP status code.

200

Message

string

The additional information returned only if an error occurs.

job type is java className can not be blank

RequestId

string

The request ID.

4F68ABED-AC31-4412-9297-D9A8F0401108

Success

boolean

Indicates whether the request was successful.

true

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.