> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veadk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 读取调度状态

> 查看处理本次请求的副本是否在调度、当前运行数及最近扫描结果

需要使用 AgentKit CLI 0.54.0 部署并[启用定时任务](/productions/api-reference/preview/zh/harness-runtime/cronjobs/overview)的 Harness Runtime

本接口仅描述处理本次请求的单个运行副本，多副本部署时不同请求可能返回不同结果。`last_error` 是最近记录的调度错误，即使后续扫描成功，也不保证立即清空


## OpenAPI

````yaml productions/api-reference/openapi/zh/harness-runtime.json GET /harness/cronjobs/status
openapi: 3.1.0
info:
  title: Harness Runtime
  version: agentkit-cli 0.54.0 / SDK 0.8.0 / ADK 2.2.0
  description: >-
    AgentKit CLI 0.54.0 部署的 Harness Runtime，基于 VeADK 1.0.8、AgentKit SDK 0.8.0 与
    Google ADK 2.2.0 核验；定时任务另需启用配置
servers:
  - url: http://localhost:8000
    description: 本地服务
security:
  - {}
  - RuntimeBearer: []
tags:
  - name: 服务与应用
  - name: 会话
  - name: 智能体运行
  - name: 制品
  - name: 记忆
  - name: 评测 · 开发服务
  - name: 调试 · 开发服务
  - name: 兼容接口
  - name: Harness 定时任务
paths:
  /harness/cronjobs/status:
    get:
      tags:
        - Harness Runtime cronjobs
      summary: 读取调度状态
      description: 查看处理本次请求的副本是否在调度、当前运行数及最近扫描结果
      operationId: harness_cronjob_status
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CronjobStatus'
              example:
                replica_id: replica-1
                running: 0
                concurrency: 8
                last_scan_at: null
                last_error: null
                active: false
        '401':
          description: 部署网关要求的服务访问凭证缺失或无效，具体响应由网关决定
      security:
        - HarnessServiceAuth: []
      x-codeSamples:
        - lang: cURL
          source: |-
            curl --request GET "${HARNESS_URL}/harness/cronjobs/status" \
              --header "Authorization: Bearer ${HARNESS_TOKEN}"
        - lang: Python
          source: >-
            import json

            import os

            from urllib.request import Request, urlopen


            base_url = os.environ["HARNESS_URL"]

            headers = {"Authorization": "Bearer " + os.environ["HARNESS_TOKEN"]}


            request = Request(base_url + f"/harness/cronjobs/status",
            headers=headers, method="GET")

            with urlopen(request) as response:
                print(json.load(response))
        - lang: JavaScript
          source: >-
            const baseUrl = process.env.HARNESS_URL;

            const headers = { Authorization: `Bearer
            ${process.env.HARNESS_TOKEN}` };

            const response = await fetch(`${baseUrl}/harness/cronjobs/status`, {
              method: "GET",
              headers,
            });

            if (!response.ok) throw new Error(await response.text());

            console.log(await response.json());
components:
  schemas:
    CronjobStatus:
      type: object
      properties:
        replica_id:
          type: string
          description: 处理本次请求的副本标识
        running:
          type: integer
          description: 该副本当前执行的任务数量
        concurrency:
          type: integer
          description: 该副本的并发上限
        last_scan_at:
          anyOf:
            - type: string
              description: 该副本最近完成扫描的时间，UTC；尚未扫描时为 null
              format: date-time
            - type: 'null'
        last_error:
          anyOf:
            - type: string
              description: 该副本最近记录的调度错误标识；没有记录时为 null
            - type: 'null'
        active:
          type: boolean
          description: 该副本的后台调度是否仍在运行，不代表全服务集群健康状态
      required:
        - replica_id
        - running
        - concurrency
        - last_scan_at
        - last_error
        - active
  securitySchemes:
    RuntimeBearer:
      type: http
      scheme: bearer
      description: 本地未配置网关时可不提供；云部署使用 Runtime API Key 或部署要求的用户池 JWT，不能使用模型 API Key
    HarnessServiceAuth:
      type: http
      scheme: bearer
      description: 服务鉴权 Harness 的 Runtime 访问凭证，例如 Runtime API Key；共享 OAuth 部署不支持后台定时任务

````