All Products
Search
Document Center

SchedulerX:GetJobInfo

Last Updated:Dec 10, 2024

Queries the details of a job based on the job ID. In most cases, the obtained information is used to update jobs.

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:ReadSchedulerxJobQueryget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
JobIdlongYes

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

92583
GroupIdstringYes

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

testSchedulerx.defaultGroup
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
RegionIdstringYes

The region ID.

cn-hangzhou
JobNamestringNo

The job name.

simpleJob

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The HTTP status code.

200
Messagestring

The error message returned only if an error occurs.

jobid: 92583 not match groupId: testSchedulerx.defaultGroup
RequestIdstring

The request ID.

4F68ABED-AC31-4412-9297-D9A8F0401108
Successboolean

Indicates whether the job details were obtained. Valid values:

  • true
  • false
true
Dataobject

The details of the job.

JobConfigInfoobject

The configurations of the job.

JobIdlong

The job ID.

538039
Statusinteger

Indicates whether the job was enabled. Valid values:

  • 1: The job was enabled and could be triggered.
  • 0: The job was disabled and could not be triggered.
1
Parametersstring

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

test
Descriptionstring

The description of the job.

test
ExecuteModestring

The execution mode of the job. Valid values:

  • Stand-alone operation
  • Broadcast run
  • Visual MapReduce
  • MapReduce
  • Shard run
standalone
MaxConcurrencystring

The maximum number of concurrent instances. Default value: 1. The default value indicates that if the last triggered instance is running, the next instance is not triggered even if the scheduled point in time for running the next instance is reached.

1
Namestring

The job name.

helloworld
MaxAttemptinteger

The maximum number of retries after a job failure. This parameter was specified based on your business requirements. Default value: 0.

0
Contentstring

The script of a script job.

echo "clear" > /home/admin/edas-container/logs/catalina.out
JarUrlstring

The full path used to upload files to Object Storage Service (OSS).

If you use a JAR package, you can upload the JAR package to this OSS path.

https://test.oss-cn-hangzhou.aliyuncs.com/schedulerX/test.jar
ClassNamestring

The full path of the job interface class. This parameter is returned only for jobs whose job type is Java.

com.alibaba.test.helloword
JobTypestring

The job type.

java
AttemptIntervalinteger

The interval at which the system retried to run the job after a job failure. Default value: 30. Unit: seconds.

30
MapTaskXAttrsobject

The advanced configurations of the job.

TaskMaxAttemptinteger

The number of retries after a task failure.

0
TaskAttemptIntervalinteger

The interval at which the system retried to run the task after a task failure.

0
ConsumerSizeinteger

The number of threads that were triggered by a single worker at a time. Default value: 5.

5
QueueSizeinteger

The maximum number of tasks that can be queued. Default value: 10000.

10000
DispatcherSizeinteger

The number of task distribution threads. Default value: 5.

5
PageSizeinteger

The number of tasks that were pulled by a parallel job at a time. Default value: 100.

100
TimeConfigobject

The time configurations.

Calendarstring

Custom calendar days specified if TimeType is set to 1 (cron).

Business days
TimeTypeinteger

The time type. Valid values:

  • 1: cron
  • 3: fix_rate
  • 4: second_delay
  • 5: one_time
  • 100: api
1
DataOffsetinteger

The time offset specified if TimeType is set to 1 (cron). Unit: seconds.

0
TimeExpressionstring

The time expression specified based on the value of TimeType:

  • If TimeType is set to 100 (api), no time expression is required.
  • If TimeType is set to 3 (fix_rate), this parameter value indicates the specific and fixed frequency. For example, if the value is 30, the system triggers a job every 30 seconds.
  • If TimeType is set to 1 (cron), this parameter value indicates the standard CRON expression used to specify the time when to schedule the job.
  • If TimeType is set to 4 (second_delay), this parameter value indicates the fixed delay after which the job is triggered. Valid values: 1 to 60. Unit: seconds.
0 0/10 * * * ?
JobMonitorInfoobject

The monitoring information of the job.

ContactInfoarray<object>

The alert contact Information.

ContactInfoobject
UserPhonestring

The mobile phone number of the alert contact.

1381111****
UserNamestring

The name of the alert contact.

userA
UserMailstring

The email address of the alert contact.

user@demo.com
Dingstring

The webhook URL of the DingTalk chatbot.

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

The configurations of the alerting features and the alert thresholds.

Timeoutlong

The timeout threshold. Default value: 7200. Unit: seconds.

12300
SendChannelstring

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

sms
TimeoutKillEnableboolean

Indicates whether the Timeout termination switch was turned on. The switch is turned off by default.

true
TimeoutEnableboolean

Indicates whether the Timeout alarm switch was turned on. Valid values:

  • true
  • false
true
FailEnableboolean

Indicates whether the Failure alarm switch was turned on. Valid values:

  • true
  • false
true
MissWorkerEnableboolean

Indicates whether the No machine alarm available switch was turned on.

true
XAttrsstring

The extended fields.

{"pageSize":5,"queueSize":10,"consumerSize":5,"dispatcherSize":5,"taskMaxAttempt":0,"taskAttemptInterval":0,"globalConsumerSize":1000,"taskDispatchMode":"push"}

Examples

Sample success responses

JSONformat

{
  "Code": 200,
  "Message": "jobid: 92583 not match groupId: testSchedulerx.defaultGroup",
  "RequestId": "4F68ABED-AC31-4412-9297-D9A8F0401108",
  "Success": true,
  "Data": {
    "JobConfigInfo": {
      "JobId": 538039,
      "Status": 1,
      "Parameters": "test",
      "Description": "test",
      "ExecuteMode": "standalone",
      "MaxConcurrency": "1",
      "Name": "helloworld",
      "MaxAttempt": 0,
      "Content": "echo \"clear\" > /home/admin/edas-container/logs/catalina.out ",
      "JarUrl": "https://test.oss-cn-hangzhou.aliyuncs.com/schedulerX/test.jar",
      "ClassName": "com.alibaba.test.helloword",
      "JobType": "java",
      "AttemptInterval": 30,
      "MapTaskXAttrs": {
        "TaskMaxAttempt": 0,
        "TaskAttemptInterval": 0,
        "ConsumerSize": 5,
        "QueueSize": 10000,
        "DispatcherSize": 5,
        "PageSize": 100
      },
      "TimeConfig": {
        "Calendar": "Business days\n",
        "TimeType": 1,
        "DataOffset": 0,
        "TimeExpression": "0 0/10 * * * ?"
      },
      "JobMonitorInfo": {
        "ContactInfo": [
          {
            "UserPhone": "1381111****",
            "UserName": "userA",
            "UserMail": "user@demo.com",
            "Ding": "https://oapi.dingtalk.com/robot/send?access_token=XXXXXX"
          }
        ],
        "MonitorConfig": {
          "Timeout": 12300,
          "SendChannel": "sms",
          "TimeoutKillEnable": true,
          "TimeoutEnable": true,
          "FailEnable": true,
          "MissWorkerEnable": true
        }
      },
      "XAttrs": "{\"pageSize\":5,\"queueSize\":10,\"consumerSize\":5,\"dispatcherSize\":5,\"taskMaxAttempt\":0,\"taskAttemptInterval\":0,\"globalConsumerSize\":1000,\"taskDispatchMode\":\"push\"}"
    }
  }
}

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
2022-12-26The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-11-02The response structure of the API has changedView Change Details
2022-01-13The request parameters of the API has changedView Change Details