Obtain Jobs in a Resource Pool
Function
This API is used to query the dedicated resource pool job list.
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}/pools/{pool_name}/workloads
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
pool_name |
Yes |
String |
Definition: Resource pool ID. The value is obtained from the metadata.name field in the resource pool details. Constraints: N/A *Range: The value can contain 36 to 63 characters. It must start with a lowercase letter and cannot end with a hyphen (-). Digits and hyphens (-) are allowed. Default Value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
No |
String |
Definition: Job types based on which the resource pool job list is queried Constraints: N/A Range: The options are as follows:
Default Value: N/A |
status |
No |
String |
Definition: Job statuses based on which the resource pool job list is queried Constraints: N/A Range: The options are as follows:
Default Value: N/A |
sort |
No |
String |
Definition: Sorting criteria for querying jobs in a resource pool Constraints: N/A Range: The options are as follows:
Default Value: N/A |
ascend |
No |
Boolean |
Definition: Whether jobs in a resource pool to be queried are sorted in ascending order Constraints: This parameter must be used with the sort query parameter. Range: The options are as follows:
Default Value: false |
offset |
No |
String |
Definition: Offset of pagination query Constraints: N/A Range: 0 to 2147483647 Default Value: 0 |
limit |
No |
Integer |
Definition: Number of resources returned in a single pagination query Constraints: N/A Range: 0 to 500 Default Value: 500 |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
Definition: API version of the resource Range: The options are as follows:
|
kind |
String |
Definition: Resource type Range: The options are as follows:
|
items |
Array of Workload objects |
Definition: Job list in the resource pool Range: N/A |
Parameter |
Type |
Description |
---|---|---|
apiVersion |
String |
Definition: API version of the resource Range: The options are as follows:
|
kind |
String |
Definition: Resource type Range: The options are as follows:
|
type |
String |
Definition: Service type of a job in the resource pool Range: The options are as follows:
|
namespace |
String |
Definition: Namespace to which a job in a cluster belongs Range: N/A |
name |
String |
Definition: Job name Range: N/A |
jobName |
String |
Definition: Name of the upper-layer service to which a job belongs Range: N/A |
uid |
String |
Definition: Job ID Range: N/A |
jobUUID |
String |
Definition: ID of the upper-layer service to which a job belongs Range: N/A |
flavor |
String |
Definition: Resource specifications of a job Range: N/A |
status |
String |
Definition: Resource specifications of a job Range: N/A |
resourceRequirement |
resourceRequirement object |
Definition: Resource volume requested for job running Range: N/A |
priority |
String |
Definition: Job priority Range: N/A |
runningDuration |
Integer |
Definition: Duration of job running, in seconds Range: N/A |
pendingDuration |
Integer |
Definition: Queue time of a job, in seconds Range: N/A |
pendingPosition |
Integer |
Definition: Position of a job in the queue Range: N/A |
createTime |
Integer |
Definition: Unix timestamp of the job creation, in milliseconds Range: N/A |
gvk |
String |
Definition: Kubernetes resource type, group, and version of a job Range: N/A |
hostIps |
String |
Definition: IP addresses of the nodes where a job is running. The values are separated with commas (,). Range: N/A |
nodes |
Array of WorkloadNodeVO objects |
Definition: Node resource information occupied by a running job Range: N/A |
Parameter |
Type |
Description |
---|---|---|
cpu |
String |
Definition: CPU resources used for job running Range: N/A |
memory |
String |
Definition: Memory resources used for job running Range: N/A |
nvidia.com/gpu |
String |
Definition: GPU resources used for job running Range: N/A |
huawei.com/ascend-snt3 |
String |
Definition: snt3 NPU resources used for job running Range: N/A |
huawei.com/ascend-snt9 |
String |
Definition: snt9 NPU resources used for job running Range: N/A |
Parameter |
Type |
Description |
---|---|---|
hostIp |
String |
Definition: IP address of the node where a job runs Range: N/A |
npuTopologyPlacement |
String |
Definition: Topology of the NPU card resource usage. The value is a 16-bit binary number, where the first bit from the right indicates card 1. 1 indicates occupied, and 0 indicates idle. For example, if cards 1 and 15 are occupied in a 16-card model, the value is 0100000000000001. If cards 1 and 7 are occupied in an 8-card model, the returned value is 0000000001000001. Range: N/A |
resourceRequirement |
ResourceRequirementVO object |
Definition: Resources used for job running Range: N/A |
Parameter |
Type |
Description |
---|---|---|
cpu |
String |
Definition: CPU resources used for job running. Range: N/A |
memory |
String |
Definition: Memory resources used for job running. Range: N/A |
nvidia.com/gpu |
String |
Definition: GPU resources used for job running. Range: N/A |
huawei.com/ascend-310 |
String |
Definition: snt3 NPU resources used for job running. Range: N/A |
huawei.com/ascend-1980 |
String |
Definition: snt9 NPU resources used for job running. Range: N/A |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Range: N/A |
error_msg |
String |
Definition: Error message. Range: N/A |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Range: N/A |
error_msg |
String |
Definition: Error message. Range: N/A |
Example Requests
GET https://{endpoint}/v2/{project_id}/pools/{pool_name}/workloads
Example Responses
Status code: 200
OK.
{ "kind" : "WorkloadList", "apiVersion" : "v1", "items" : [ { "kind" : "Workload", "apiVersion" : "v1", "uid" : "837ad51b-7c39-41f7-82e9-ea904cbb8ed6", "jobUUID" : "19d05662-0f87-43c7-8426-1ccf4b30179b", "name" : "ma-job-19d05662-0f87-43c7-8426-1ccf4b30179b", "jobName" : "DI-job-202412022313-hlyh5", "type" : "train", "namespace" : "os-pool-train-dSnt9b-memarts1-1ccf4b30179b", "status" : "Running", "resourceRequirement" : { "cpu" : "360 Cores", "memory" : "2.36 TiB" }, "priority" : "1", "createTime" : 1733152598000, "runningDuration" : 1857065, "pendingPosition" : -1, "gvk" : "batch.volcano.sh/v1alpha1, Kind=Job", "hostIps" : "192.168.81.93,192.168.73.217", "nodes" : [ { "hostIp" : "192.168.81.93", "npuTopologyPlacement" : "0x00ff", "resourceRequirement" : { "cpu" : "180 Cores", "memory" : "1.18 TiB", "huawei.com/ascend-1980" : "8" } }, { "hostIp" : "192.168.73.217", "npuTopologyPlacement" : "0x00ff", "resourceRequirement" : { "cpu" : "180 Cores", "memory" : "1.18 TiB", "huawei.com/ascend-1980" : "8" } } ] } ] }
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot