返回 Skill 列表
extension
分类: 其它无需 API Key

task-status

从AICNIC作业管理系统查询任务状态。当用户需要检查任务状态、获取作业信息或提及作业时使用此技能。

person作者: bylikaihubclawhub

Task Status Query

Overview

This skill is used to query the status of a specific task in the AICNIC job management system.

Usage

When the user needs to query a task status:

  1. Obtain the jobId parameter provided by the user
  2. Call the API to retrieve job information
  3. Parse and return the value of the jobState field

API Call

Request Format

GET http://www.aicnic.cn/jobs/api/jobs/infos/hpcai28/{jobId}

Curl Example

curl -X GET "http://www.aicnic.cn/jobs/api/jobs/infos/hpcai28/{jobId}" -H "accept: */*"

Response Format

The API returns a JSON response:

{
  "code": 0,
  "message": null,
  "data": {
    "id": 20452,
    "jobId": "15000",
    "jobState": "COMPLETED",
    ...
  }
}

Parsing Rules

Extract the following fields from the API response:

| Field Path | Description | |-----------|-------------| | data.jobState | Task status (e.g., COMPLETED, RUNNING, PENDING, etc.) | | data.jobId | Job ID | | data.jobName | Job name | | data.startTime | Start time | | data.endTime | End time |

Workflow

  1. Receive Parameter: Get the jobId provided by the user
  2. Build URL: http://www.aicnic.cn/jobs/api/jobs/infos/hpcai28/{jobId}
  3. Send Request: Send a GET request using curl or an HTTP client
  4. Parse Response: Parse the JSON response and extract the data.jobState field
  5. Return Result: Display the task status to the user

Example

Query task status for jobId 15000

curl -X GET "http://www.aicnic.cn/jobs/api/jobs/infos/hpcai28/15000" -H "accept: */*"

Response:

{
  "code": 0,
  "message": null,
  "data": {
    "jobId": "15000",
    "jobState": "COMPLETED",
    "endTime": "2024-12-09T09:30:10"
  }
}

Parsed Result: Task status is COMPLETED

Common Task States

  • COMPLETED - Completed
  • RUNNING - Running
  • PENDING - Pending
  • FAILED - Failed
  • CANCELLED - Cancelled