Help Center> ModelArts> API Reference> Resource Management> Resource Pool Job Management> Obtaining Jobs in a Dedicated Resource Pool
Updated on 2024-06-13 GMT+08:00

Obtaining Jobs in a Dedicated Resource Pool

Function

This API is used to obtain jobs in a dedicated resource pool.

URI

GET /v2/{project_id}/pools/{pool_name}/workloads

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

Minimum: 32

Maximum: 36

pool_name

Yes

String

Namespace to which a job belongs

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

type

No

String

Service type of a job. Options:

  • train: training job

  • infer: inference job

  • notebook: notebook job

status

No

String

Job status. Options:

  • Queue: The job is queuing.

  • Pending: The job is pending.

  • Abnormal: The job is abnormal.

  • Terminating: The job is being terminated.

  • Creating: The job is being created.

  • Running: The job is running.

  • Completed: The job has been completed.

  • Terminated: The job has been terminated.

  • Failed: The job failed to be run.

sort

No

String

Sorting field. Options:

  • create_time: Sort jobs by creation time.

ascend

No

Boolean

Whether the results are sorted in ascending order

offset

No

String

Start position for pagination query

limit

No

Integer

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

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

apiVersion

String

API version. Options:

  • v1

kind

String

Resource type. Options:

  • WorkloadList: job list

items

Array of Workload objects

Job list

Table 4 Workload

Parameter

Type

Description

apiVersion

String

Resource version. Options:

  • v1

kind

String

Resource type. Options:

  • Workload

type

String

Service type of a job. Options:

  • train: training job

namespace

String

Name of the resource pool to which a job belongs

name

String

Job name

jobName

String

Upper-layer service job name

uid

String

Job UID

jobUUID

String

Upper-layer service job ID

flavor

String

Job specifications

status

String

Job status

resourceRequirement

resourceRequirement object

Number of resources requested for running a job

priority

String

Job priority

runningDuration

Integer

Running duration of a job

pendingDuration

Integer

Queuing duration of a job

pendingPosition

Integer

Queuing position of a job

createTime

Integer

Job creation time

gvk

String

GVK of a job

hostIps

String

IP addresses of the nodes where a job is running. The values are separated with commas (,).

Table 5 resourceRequirement

Parameter

Type

Description

cpu

String

CPU usage

memory

String

Memory usage

nvidia.com/gpu

String

GPU usage

huawei.com/ascend-310

String

Ascend D310 usage

huawei.com/ascend-1980

String

Ascend snt9 usage

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 8

Maximum: 36

error_msg

String

Error message

Minimum: 2

Maximum: 512

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 8

Maximum: 36

error_msg

String

Error message

Minimum: 2

Maximum: 512

Example Requests

None

Example Responses

Status code: 400

Bad request

{
  "error_code" : "ModelArts.50004000",
  "error_msg" : "Bad request."
}

Status code: 404

Not found

{
  "error_code" : "ModelArts.50015001",
  "error_msg" : "Pool {name} not found."
}

Status Codes

Status Code

Description

200

OK

400

Bad request

404

Not found

Error Codes

See Error Codes.