---
title: "根据名称模糊查询Ansible任务"
method: GET
path: "/api/v1/task/ansible/query/name"
tags: ["任务作业"]
---

# 根据名称模糊查询Ansible任务

`GET /api/v1/task/ansible/query/name`

根据任务名称进行模糊查询

## Query parameters

- `name` string, required

## Response `200`

OK

- object
  - `code` integer — 状态码
  - `data` 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[]
      - `duration` integer
      - `endTime` string
      - `entryFileName` string
      - `entryFilePath` string
      - `errorMsg` string
      - `exitCode` integer
      - `id` integer
      - `logPath` string
      - `startTime` string
      - `status` integer
      - `task` ModelTaskAnsible — recursive
      - `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)
