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
| 
        Parameter  | 
      
        Mandatory  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|---|
| 
        project_id  | 
      
        Yes  | 
      
        String  | 
      
        Project ID. For details, see Obtaining a Project ID and Name.  | 
     
| 
        pool_name  | 
      
        Yes  | 
      
        String  | 
      
        ID of the resource pool to which a job belongs. The value is the metadata.name field in the resource pool details.  | 
     
| 
        Parameter  | 
      
        Mandatory  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|---|
| 
        type  | 
      
        No  | 
      
        Array of strings  | 
      
        Service type of a job. Options: 
  | 
     
| 
        status  | 
      
        No  | 
      
        String  | 
      
        Job status. Options: 
  | 
     
| 
        sort  | 
      
        No  | 
      
        String  | 
      
        Sorting field. Options: 
  | 
     
| 
        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
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        apiVersion  | 
      
        String  | 
      
        API version. Options: 
  | 
     
| 
        kind  | 
      
        String  | 
      
        Resource type. Options: 
  | 
     
| 
        items  | 
      
        Array of Workload objects  | 
      
        Job list  | 
     
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        apiVersion  | 
      
        String  | 
      
        Resource version. Options: 
  | 
     
| 
        kind  | 
      
        String  | 
      
        Resource type. Options: 
  | 
     
| 
        type  | 
      
        String  | 
      
        Service type of a job. The options are as follows: 
  | 
     
| 
        namespace  | 
      
        String  | 
      
        ID 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  | 
      
        Array of ResourceRequirement objects  | 
      
        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 (,).  | 
     
| 
        nodes  | 
      
        WorkloadNodeVO object  | 
      
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        cpu  | 
      
        String  | 
      
        CPU usage.  | 
     
| 
        memory  | 
      
        String  | 
      
        Memory usage.  | 
     
| 
        nvidia.com/gpu  | 
      
        String  | 
      
        GPU usage.  | 
     
| 
        huawei.com/ascend-snt3  | 
      
        String  | 
      
        Ascend snt3 resource usage.  | 
     
| 
        huawei.com/ascend-snt9  | 
      
        String  | 
      
        Ascend snt9 resource usage.  | 
     
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        hostIp  | 
      
        String  | 
      
        Node IP address.  | 
     
| 
        npuTopologyPlacement  | 
      
        String  | 
      
        Topology of the 910 card placement. The bits are numbered from 0 to 15 from right to left. Bit 1 indicates that the card is occupied.  | 
     
| 
        resourceRequirement  | 
      
        ResourceRequirementVO object  | 
      
        Requested resources.  | 
     
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        cpu  | 
      
        String  | 
      
        CPU usage.  | 
     
| 
        memory  | 
      
        String  | 
      
        Memory usage.  | 
     
| 
        nvidia.com/gpu  | 
      
        String  | 
      
        nvidia.com/gpu usage.  | 
     
| 
        huawei.com/ascend-310  | 
      
        String  | 
      
        huawei.com/ascend-310 usage.  | 
     
| 
        huawei.com/ascend-1980  | 
      
        String  | 
      
        huawei.com/ascend-1980 usage.  | 
     
Status code: 400
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        Error code  | 
     
| 
        error_msg  | 
      
        String  | 
      
        Error message  | 
     
Status code: 404
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        Error code  | 
     
| 
        error_msg  | 
      
        String  | 
      
        Error message  | 
     
Example Requests
Obtain jobs in a resource pool.
GET https://{endpoint}/v2/{project_id}/pools/{pool_name}/workloads?offset=0&limit=10&sort=create_time&ascend=false&type=train&type=infer
 Example Responses
Status code: 200
OK
{
  "kind" : "WorkloadList",
  "apiVersion" : "v1",
  "metadata" : { },
  "items" : [ {
    "kind" : "Workload",
    "apiVersion" : "v1",
    "uid" : "6715ceb5-df65-456f-b185-07e047c9745c",
    "jobUUID" : "c237e9e1-50e7-4c4d-97ba-f4a5e0f62f70",
    "name" : "modelarts-job-c237e9e1-50e7-4c4d-97ba-f4a5e0f62f70",
    "jobName" : "autotest_b82d17",
    "type" : "train",
    "namespace" : "pool-train-dev-cpu-public-fab2c5cf438b4f0c851fdcdf08704898",
    "status" : "Queue",
    "resourceRequirement" : {
      "cpu" : "1 Cores",
      "memory" : "6.52 GiB"
    },
    "priority" : "0",
    "createTime" : 1727254947000,
    "pendingDuration" : 1918236,
    "pendingPosition" : -1,
    "gvk" : "batch.volcano.sh/v1alpha1, Kind=Job",
    "isDeleted" : "false"
  }, {
    "kind" : "Workload",
    "apiVersion" : "v1",
    "uid" : "1c65790f-dd05-4ae8-b39f-a8c27eb798be",
    "jobUUID" : "3b6fb671-155e-4769-81b9-cdebfade9276",
    "name" : "modelarts-job-3b6fb671-155e-4769-81b9-cdebfade9276",
    "jobName" : "autotest_626a6a",
    "type" : "train",
    "namespace" : "pool-train-dev-cpu-public-fab2c5cf438b4f0c851fdcdf08704898",
    "status" : "Queue",
    "resourceRequirement" : {
      "cpu" : "1 Cores",
      "memory" : "6.52 GiB"
    },
    "priority" : "0",
    "createTime" : 1727253353000,
    "pendingDuration" : 1919830,
    "pendingPosition" : -1,
    "gvk" : "batch.volcano.sh/v1alpha1, Kind=Job",
    "isDeleted" : "false"
  }, {
    "kind" : "Workload",
    "apiVersion" : "v1",
    "uid" : "27ee2204-d4e1-48be-90ba-6fdf86dbde5c",
    "jobUUID" : "50fad3c2-3704-43d3-9d7b-d989e684b83d",
    "name" : "modelarts-job-50fad3c2-3704-43d3-9d7b-d989e684b83d",
    "jobName" : "autotest_12fk8l",
    "type" : "train",
    "namespace" : "pool-train-dev-cpu-public-fab2c5cf438b4f0c851fdcdf08704898",
    "status" : "Queue",
    "resourceRequirement" : {
      "cpu" : "1 Cores",
      "memory" : "6.52 GiB"
    },
    "priority" : "0",
    "createTime" : 1721980860000,
    "pendingDuration" : 7192323,
    "pendingPosition" : -1,
    "gvk" : "batch.volcano.sh/v1alpha1, Kind=Job",
    "isDeleted" : "false"
  }, {
    "kind" : "Workload",
    "apiVersion" : "v1",
    "uid" : "77f9fb8f-2c26-474d-acf3-421c3538fbfa",
    "jobUUID" : "674a754c-9dad-4fa7-b3cf-f00065b9283a",
    "name" : "modelarts-job-674a754c-9dad-4fa7-b3cf-f00065b9283a",
    "jobName" : "autotest_64395q",
    "type" : "train",
    "namespace" : "pool-train-dev-cpu-public-fab2c5cf438b4f0c851fdcdf08704898",
    "status" : "Queue",
    "resourceRequirement" : {
      "cpu" : "1 Cores",
      "memory" : "6.52 GiB"
    },
    "priority" : "0",
    "createTime" : 1721975001000,
    "pendingDuration" : 7198182,
    "pendingPosition" : -1,
    "gvk" : "batch.volcano.sh/v1alpha1, Kind=Job",
    "isDeleted" : "false"
  }, {
    "kind" : "Workload",
    "apiVersion" : "v1",
    "uid" : "4bac907d-43a4-44f0-98ee-a802b8e0558d",
    "jobUUID" : "a36ac88b-e54d-49ba-9869-d1fd3b71691c",
    "name" : "modelarts-job-a36ac88b-e54d-49ba-9869-d1fd3b71691c",
    "jobName" : "autotest_949870",
    "type" : "train",
    "namespace" : "pool-train-dev-cpu-public-fab2c5cf438b4f0c851fdcdf08704898",
    "status" : "Queue",
    "resourceRequirement" : {
      "cpu" : "1 Cores",
      "memory" : "6.52 GiB"
    },
    "priority" : "0",
    "createTime" : 1720700120000,
    "pendingDuration" : 8473063,
    "pendingPosition" : -1,
    "gvk" : "batch.volcano.sh/v1alpha1, Kind=Job",
    "isDeleted" : "false"
  } ],
  "total" : 234
}
  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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.