---
title: "获取Ansible任务详情"
method: GET
path: "/api/v1/task/ansible/{id}"
tags: ["任务作业"]
---

# 获取Ansible任务详情

`GET /api/v1/task/ansible/{id}`

获取Ansible任务详情

## Path parameters

- `id` integer, required

## Response `200`

OK

- object
  - `code` integer — 状态码
  - `data` object — 返回的数据
    - `allHostIDs` string
    - `createdAt` string
    - `description` string
    - `errorMsg` string
    - `gitRepo` string
    - `globalVars` string
    - `hostGroups` string
    - `id` integer
    - `name` string
    - `status` integer
    - `taskCount` integer
    - `totalDuration` integer
    - `type` integer
    - `updatedAt` string
    - `works` ModelTaskAnsibleWork[]
      - `duration` integer
      - `endTime` string
      - `entryFileName` string
      - `entryFilePath` string
      - `errorMsg` string
      - `exitCode` integer
      - `id` integer
      - `logPath` string
      - `startTime` string
      - `status` integer
      - `task` ModelTaskAnsible
        - `allHostIDs` string
        - `createdAt` string
        - `description` string
        - `errorMsg` string
        - `gitRepo` string
        - `globalVars` string
        - `hostGroups` string
        - `id` integer
        - `name` string
        - `status` integer
        - `taskCount` integer
        - `totalDuration` integer
        - `type` integer
        - `updatedAt` string
        - `works` ModelTaskAnsibleWork[]
      - `taskID` integer
  - `message` string — 提示信息

---

[API](https://skmtc.net/opsre/apis/devops.md) · [All operations](https://skmtc.net/opsre/apis/devops/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opsre/devops/versions/25cac8835c4c/schema)
