GetJobInstance

更新时间:
复制 MD 格式

Returns the information of a job instance, allowing you to view 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

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****

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.

92583

JobInstanceId

integer

Yes

The job instance ID.

1685883418

NamespaceSource

string

No

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

schedulerx

Response elements

Element

Type

Description

Example

object

Code

integer

The HTTP status code.

200

Message

string

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

jobId=xxx is not existed

RequestId

string

The request ID.

4F68ABED-AC31-4412-9297-D9A8F0401108

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Data

object

The information about the job instance.

JobInstanceDetail

object

The details of the job instance.

Status

integer

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

Progress

string

The progress of the job 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 results of the job instance.

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

InstanceId

integer

The job instance ID.

1189853849

TimeType

integer

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

TriggerType

integer

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

1

EndTime

string

The end time of the job execution.

2020-07-27 11:52:10

StartTime

string

The start time of the job execution.

2020-07-27 11:52:10

Executor

string

The user who executes the job.

John Smith

JobId

integer

The job ID.

92583

ScheduleTime

string

The time when the job was scheduled to run.

2020-07-27 11:52:10

DataTime

string

The data timestamp of the job instance.

2020-07-27 11:52:10

WorkAddr

string

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

192.168.0.0:16

Parameters

string

The parameters of the job instance.

{\"alertId\":11111}

JobName

string

The job name.

ManualJob

TraceId

string

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

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.