Queries the jobs in a cluster.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| ehpc:ListJobs | list | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ClusterId | string | Yes | The cluster ID. You can call the ListClusters operation to query the cluster ID. | ehpc-hz-csbua72*** |
| PageNumber | string | No | The page number of the page to return.
| 1 |
| PageSize | string | No | The number of entries per page.
| 10 |
| JobFilter | object | No | The job filter information. | |
| Users | array | No | The users that run the jobs. | |
| string | No | The user that runs the job. Fuzzy match is supported. You can call the ListUsers to obtain the user. | testuser1 | |
| Queues | array | No | The queues to which the jobs belong. | |
| string | No | The queue name. Fuzzy match is supported. | comp | |
| Nodes | array | No | The compute nodes that run the jobs. | |
| string | No | The hostname of the compute node. Fuzzy match is supported. | compute000 | |
| JobName | string | No | The job name. Fuzzy match is supported. | testjob |
| JobStatus | string | No | The job status. Valid values:
Default value: all. | all |
| CreateTimeStart | string | No | The time when the job started. The value is a UNIX timestamp representing the number of seconds that have elapsed since 1970-01-01T00:00:00Z. | 1724122486 |
| CreateTimeEnd | string | No | The time when the job was last updated. The value is a UNIX timestamp representing the number of seconds that have elapsed since 1970-01-01T00:00:00Z. | 1724123085 |
| SortBy | object | No | The result sorting configurations. | |
| ExecuteOrder | string | No | The order in which jobs are sorted based on their execution time. Valid values:
Default value: desc. | asc |
| SubmitOrder | string | No | The order in which jobs are sorted based on their submitting time. Valid values:
Default value: desc. | asc |
| PendOrder | string | No | The order in which jobs are sorted based on their queuing time. Valid values:
Default value: desc. | desc |
| Diagnosis | array<object> | No | Job diagnosis and analysis list. | |
| object | No | Job diagnosis and analysis details. | ||
| Option | string | No | Job diagnosis and analysis metrics | run_duration |
| Operator | string | No | Job diagnosis threshold comparator. Enumeration Value:
| greater |
| Threshold | string | No | Job diagnosis threshold. | 24 |
Response parameters
Examples
Sample success responses
JSONformat
{
"TotalCount": 10,
"RequestId": "EABFBD93-58BE-53F3-BBFE-8654BB2E****",
"PageNumber": 1,
"PageSize": 20,
"Success": true,
"Jobs": [
{
"JobName": "testjob",
"JobSpec": {
"Id": 12,
"RunasUser": "testuser1",
"Comment": "jobDescription",
"State": "Running",
"StderrPath": "./Temp",
"StdoutPath": "./Temp",
"Priority": 0,
"ArrayRequest": "1-5:2",
"LastModifyTime": 1724123085,
"NodeList": "compute[002,005,003]",
"SubmitTime": 1724122486,
"JobQueue": "comp",
"Variables": {
"PBS_O_SHELL": "/bin/bash",
"PBS_O_HOST": "manager",
"PBS_O_SYSTEM": "Linux",
"PBS_O_LANG": "en_US.UTF-8",
"PBS_O_QUEUE": "workq"
},
"Resources": {
"Nodes": 3,
"Cores": 6,
"Memory": "1536MB",
"Gpus": 0
},
"ArrayJobId": 4,
"ArrayJobSubId": 1,
"ResourcesActualOccupied": {
"Nodes": 2,
"Cores": 4,
"Memory": "982MB",
"Gpus": 0
},
"StartTime": 1724122486
}
}
]
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidParams | The specified parameter %s is invalid. | The specified parameter %s is invalid. |
| 403 | InvalidClusterStatus | The operation failed due to invalid cluster status. | The cluster status does not support the operation. |
| 404 | ClusterNotFound | The specified cluster does not exist. | The specified instance does not exist. |
| 406 | DbError | A database service error occurred. | Database request failed. |
| 406 | EcsError | An error occurred while calling the ECS API operation. | ECS API call error. %s |
| 406 | AgentError | The agent service request failed: %s | Operation unsuccessful: %s |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server | The request has failed due to a temporary failure of the server. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-12-09 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2024-09-13 | The Error code has changed | View Change Details |
