All Products
Search
Document Center

SchedulerX:GetJobInstance

Last Updated:Dec 10, 2024

Queries the information about a job instance. You can view the status and progress of the job instance.

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

Request parameters

ParameterTypeRequiredDescriptionExample
NamespacestringYes

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

adcfc35d-e2fe-4fe9-bbaa-20e90ffc****
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.

92583
JobInstanceIdlongYes

The job instance ID.

11111111
NamespaceSourcestringNo

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

schedulerx

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The HTTP status code.

200
Messagestring

The error message that is returned only if the corresponding error occurs.

jobid: 92583 not match groupId: testSchedulerx.defaultGroup
RequestIdstring

The request ID.

4F68ABED-AC31-4412-9297-D9A8F0401108
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Dataobject

The information about the job instance.

JobInstanceDetailobject

The details of the job instance.

Statusinteger

The state of the job instance. Valid values:

  • 1: The job instance is waiting for execution.
  • 3: The job instance is running.
  • 4: The job instance is successful.
  • 5: The job instance failed.
  • 9: The job instance is rejected.

Enumeration class: com.alibaba.schedulerx.common.domain.InstanceStatus

4
Progressstring

The progress of the job instance.

complete
Resultstring

The execution results of the job instance.

success
InstanceIdlong

The job instance ID.

11111111
TimeTypeinteger

The method that is used to specify the time when to schedule the job instance. Valid values:

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

Enumeration class: com.alibaba.schedulerx.common.domain.TimeType

1
TriggerTypeinteger

The trigger type of the job instance. Valid values:

  • 1: The job instance was triggered at the scheduled time.
  • 2: The job instance was triggered due to data update.
  • 3: The job instance was triggered by an API call.
  • 4: The job instance was triggered because it is manually rerun.
  • 5: The job instance was triggered because the system automatically reruns the job instance upon a system exception, such as a database exception.

Enumeration class: com.alibaba.schedulerx.common.domain.TriggerType

3
EndTimestring

The end time of the job execution.

2020-07-27 11:52:10
StartTimestring

The start time of the job execution.

2020-07-27 11:52:10
Executorstring

The user who executes the job.

A
JobIdlong

The job ID.

92583
ScheduleTimestring

The time when the job was scheduled to run.

2020-07-27 11:52:10
DataTimestring

The data timestamp of the job instance.

2020-07-27 11:52:10
WorkAddrstring

The endpoint of the triggered client. The value is in the IP address:Port number format.

192.168.0.0:16
Parametersstring

The parameters of the job instance.

{\"alertId\":11111}
JobNamestring

The job name.

ManualJob
TraceIdstring

The trace ID, which can be used to query trace details.

210e845016596663430048015d0a2c

Examples

Sample success responses

JSONformat

{
  "Code": 200,
  "Message": "jobid: 92583 not match groupId: testSchedulerx.defaultGroup",
  "RequestId": "4F68ABED-AC31-4412-9297-D9A8F0401108",
  "Success": true,
  "Data": {
    "JobInstanceDetail": {
      "Status": 4,
      "Progress": "complete",
      "Result": "success",
      "InstanceId": 11111111,
      "TimeType": 1,
      "TriggerType": 3,
      "EndTime": "2020-07-27 11:52:10",
      "StartTime": "2020-07-27 11:52:10",
      "Executor": "A",
      "JobId": 92583,
      "ScheduleTime": "2020-07-27 11:52:10",
      "DataTime": "2020-07-27 11:52:10",
      "WorkAddr": "192.168.0.0:16",
      "Parameters": "{\\\"alertId\\\":11111}",
      "JobName": "ManualJob",
      "TraceId": "210e845016596663430048015d0a2c"
    }
  }
}

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-07-17The response structure 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