---
title: "更新任务"
method: PUT
path: "/api/v1/task/update"
tags: ["任务中心"]
---

# 更新任务

`PUT /api/v1/task/update`

更新任务信息

## Request body

- ModelTask
  - `created_at` string
  - `cron_expr` string
  - `duration` integer
  - `end_time` string
  - `execute_count` integer
  - `host_ids` string
  - `id` integer
  - `name` string
  - `next_run_time` string
  - `remark` string
  - `shell` string
  - `start_time` string
  - `status` integer
  - `task_count` integer
  - `tasklog` string
  - `type` integer

## Response `200`

OK

- ResultResult
  - `code` integer — 状态码
  - `data` unknown
  - `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/revisions/25cac8835c4c/schema)
