Updated on 2025-11-19 GMT+08:00

Querying Tasks

Function

This API is used to obtain the jobs of the current user.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/jobs

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: User project ID. For details, see Obtaining a Project ID and Name.

Constraints: N/A

Range: N/A

Default Value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

type

No

String

Task type. Options:

  • replace-node: faulty node replacement task

  • reboot-node: node restart task

  • reset-nodes: node reset task

limit

No

Integer

Maximum number of records on each page. If this parameter is left blank, 100 records are returned by default. A maximum of 500 records are allowed on each page.

offset

No

Integer

Offset of the pagination query. This parameter is left blank when the first page is queried.

since

No

Long

Start time of the query, in milliseconds. By default, the query starts from 30 days ago.

until

No

Long

End time of the query, in milliseconds. The current time is used by default.

resource

No

String

Type of the resource associated with the job. Options:

  • pools: resource pool

name

No

String

Name of the associated resource. This parameter is used together with resource.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

count

Integer

Total number of results.

items

Array of PoolJob objects

Job list.

Table 4 PoolJob

Parameter

Type

Description

startTimestamp

Long

Time when a job starts to be processed, in milliseconds.

endTimestamp

Long

Job end time, in milliseconds.

jobId

String

Task ID.

jobName

String

Task name.

involvedObjects

String

Resources associated with a job, for example, resource pool description.

inputs

String

Job input parameters.

phase

String

Job status. Options:

  • Running: The job is running.

  • Success: The task has been executed.

  • Failed: The task failed to be executed.

suspend

Boolean

Indicates whether the job is suspended.

type

String

Job type.

conditions

String

Job execution process information.

message

String

Execution information returned when a job fails to be executed.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Example Requests

Query the node restart task list.

GET https://{endpoint}/v2/{project_id}/jobs?type=reboot-node

{ }

Example Responses

Status code: 200

Job list response body.

{
  "count" : 22,
  "items" : [ {
    "startTimestamp" : 1757935854000,
    "endTimestamp" : 1757935891000,
    "jobId" : "8777d6bc-fee5-4c47-b46d-884189898ecb",
    "jobName" : "reboot-node-pool-b15e-6f5da086876d4cd084d36f8bd3346036-tbl97",
    "inputs" : "[{\"name\":\"PoolName\",\"value\":\"pool-b15e-6f5da086876d4cd084d36f8bd3346036\"},{\"name\":\"NodeName\",\"value\":\"os-node-created-4n6s7\"}]",
    "involvedObjects" : "[{\"kind\":\"Pool\",\"name\":\"pool-b15e-6f5da086876d4cd084d36f8bd3346036\",\"uid\":\"df88e877-08fa-44ab-9f0c-2926c4814ea2\",\"apiVersion\":\"os.modelarts.huaweicloud/v1\",\"resourceVersion\":\"1804287231\"}]",
    "type" : "reboot-node",
    "phase" : "Success",
    "conditions" : "[{\"type\":\"Complete\",\"status\":\"True\",\"lastTransitionTime\":\"2025-09-15T11:31:31Z\",\"reason\":\"Success\",\"message\":\"reboot progress: total: 1, completd: 1, rebooting: 0, failed: 0\"}]"
  }, {
    "startTimestamp" : 1757934802000,
    "endTimestamp" : 1757934803000,
    "jobId" : "52cf3c70-4e3a-4a28-8e03-3ce075482a0c",
    "jobName" : "reboot-node-pool-b15e-6f5da086876d4cd084d36f8bd3346036-mn4vh",
    "inputs" : "[{\"name\":\"PoolName\",\"value\":\"pool-b15e-6f5da086876d4cd084d36f8bd3346036\"},{\"name\":\"NodeName\",\"value\":\"os-node-created-62g8b\"}]",
    "involvedObjects" : "[{\"kind\":\"Pool\",\"name\":\"pool-b15e-6f5da086876d4cd084d36f8bd3346036\",\"uid\":\"df88e877-08fa-44ab-9f0c-2926c4814ea2\",\"apiVersion\":\"os.modelarts.huaweicloud/v1\",\"resourceVersion\":\"1804282251\"}]",
    "type" : "reboot-node",
    "phase" : "Failed",
    "conditions" : "[{\"type\":\"Complete\",\"status\":\"False\",\"lastTransitionTime\":\"2025-09-15T11:13:22Z\",\"reason\":\"Failed\",\"message\":\"reboot progress: total: 1, completd: 0, rebooting: 0, failed: 1, failedNodes[os-node-created-62g8b: duration must between 900 seconds(15 minutes) and 43200 seconds(12 hours)]\"}]",
    "message" : "os-node-created-62g8b: duration must between 900 seconds(15 minutes) and 43200 seconds(12 hours)"
  } ]
}

Status Codes

Status Code

Description

200

Job list response body.

400

Error response

Error Codes

See Error Codes.