GetJobInstance

Updated at:
Copy as MD

Retrieves the details of a task instance, including its status and progress.

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:ReadSchedulerxJobInstanceQuery

get

*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 ID from the Namespaces page in the console.

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

GroupId

string

Yes

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

testSchedulerx.defaultGroup

JobId

integer

Yes

The job ID. You can obtain the ID from the Job Management page in the console.

92583

JobInstanceId

integer

Yes

The job instance ID.

1685883418

NamespaceSource

string

No

The namespace source. This parameter is required only for specific third parties.

schedulerx

Response elements

Element

Type

Description

Example

object

Code

integer

The return code.

200

Message

string

The error message.

jobId=xxx is not existed

RequestId

string

The unique ID of the request.

4F68ABED-AC31-4412-9297-D9A8F0401108

Success

boolean

Indicates whether the task instance details were retrieved. Valid values:

  • true: The task instance details were retrieved.

  • false: The task instance details failed to be retrieved.

true

Data

object

The instance information.

JobInstanceDetail

object

The detailed information about the task instance.

Status

integer

The instance status. Valid values:

  • 1: Waiting.

  • 3: Running.

  • 4: Succeeded.

  • 5: Failed.

  • 9: Rejected.

Corresponding enum class: com.alibaba.schedulerx.common.domain.InstanceStatus.

4

Progress

string

The progress details of the instance.

{"taskProgress":[{"name":"MAP_TASK_ROOT","total":1,"pulled":1,"running":0,"success":0,"failed":0}],"workerProgress":[{"workerAddr":"11.122.241.245:34865","total":1,"pulled":1,"running":0,"success":0,"failed":0}]}

Result

string

The execution result of the instance.

{'TotalSize': 31, 'CurrentPage': 5, 'PageSize': 10}

InstanceId

integer

The instance ID.

1189853849

TimeType

integer

The scheduling time type of the instance. Valid values:

  • cron: 1.

  • fix_rate: 3.

  • second_delay: 4.

  • api: 100.

Corresponding enum class: com.alibaba.schedulerx.common.domain.TimeType.

1

TriggerType

integer

The trigger type. Valid values:

  • 1: Normal trigger of timed scheduling.

  • 2: Data backfill.

  • 3: API trigger.

  • 4: Manual rerun.

  • 5: System retry (triggered by system exceptions, such as database exceptions).

Corresponding enum class: com.alibaba.schedulerx.common.domain.TriggerType.

1

EndTime

string

The end time of the job execution. The time is in the yyyy-MM-dd HH:mm:ss format.

2020-07-27 11:52:10

StartTime

string

The start time of the job execution. The time is in the yyyy-MM-dd HH:mm:ss format.

2020-07-27 11:52:10

Executor

string

The executor.

John Smith

JobId

integer

The job ID.

92583

ScheduleTime

string

The scheduled time. The time is in the yyyy-MM-dd HH:mm:ss format.

2020-07-27 11:52:10

DataTime

string

The data timestamp of the node. The time is in the yyyy-MM-dd HH:mm:ss format.

2020-07-27 11:52:10

WorkAddr

string

The IP address and port of the triggered client in the IP:port format.

192.168.0.0:16

Parameters

string

The parameter information of the job instance.

{\"alertId\":11111}

JobName

string

The job name.

ManualJob

TraceId

string

The trace ID. You can use this ID to precisely query invocation information.

210e845016596663430048015d0a2c

Examples

Success response

JSON format

{
  "Code": 200,
  "Message": "jobId=xxx is not existed",
  "RequestId": "4F68ABED-AC31-4412-9297-D9A8F0401108",
  "Success": true,
  "Data": {
    "JobInstanceDetail": {
      "Status": 4,
      "Progress": "{\"taskProgress\":[{\"name\":\"MAP_TASK_ROOT\",\"total\":1,\"pulled\":1,\"running\":0,\"success\":0,\"failed\":0}],\"workerProgress\":[{\"workerAddr\":\"11.122.241.245:34865\",\"total\":1,\"pulled\":1,\"running\":0,\"success\":0,\"failed\":0}]}",
      "Result": "{'TotalSize': 31, 'CurrentPage': 5, 'PageSize': 10}",
      "InstanceId": 1189853849,
      "TimeType": 1,
      "TriggerType": 1,
      "EndTime": "2020-07-27 11:52:10",
      "StartTime": "2020-07-27 11:52:10",
      "Executor": "John Smith",
      "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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.