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

# 恢复监控

> 通过重新启用计划运行来恢复暂停的监控。



## OpenAPI

````yaml zh/openapi/monitors.json POST /v1/monitors/{monitor_id}/resume
openapi: 3.0.3
info:
  title: Monitors API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/monitors/{monitor_id}/resume:
    post:
      summary: 恢复监控
      description: 重新启用监控计划并将 `status` 设置为 `active`。只有 `paused` 的监控可以恢复。
      parameters:
        - name: monitor_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^monitor_
      responses:
        '200':
          description: 监控已恢复。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Monitor'
        '400':
          description: 无效请求。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 无效的 API 密钥。
        '404':
          description: 未找到监控。
        '409':
          description: 缺少计划或监控不再暂停。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 内部服务器错误。
      security:
        - Authorization: []
components:
  schemas:
    Monitor:
      type: object
      properties:
        id:
          type: string
          description: 唯一的监控器标识符 (`monitor_…`)。
        object:
          type: string
          example: monitor
        query:
          type: string
          description: 自然语言中的监控意图。
        tracked:
          $ref: '#/components/schemas/MonitorTracked'
        source_policy:
          $ref: '#/components/schemas/MonitorSourcePolicy'
        schedule:
          $ref: '#/components/schemas/MonitorSchedule'
        notification:
          $ref: '#/components/schemas/MonitorNotification'
        webhook:
          allOf:
            - $ref: '#/components/schemas/MonitorWebhook'
          nullable: true
        output_schema:
          type: object
          additionalProperties: true
          nullable: true
          description: 可选的JSON Schema用于结构化提取输出。
        status:
          type: string
          enum:
            - provisioning
            - active
            - paused
            - failed
            - deleted
          description: 监控生命周期状态。
        error_message:
          type: string
          nullable: true
          description: 当`status`为`failed`时出现。
        last_run:
          allOf:
            - $ref: '#/components/schemas/MonitorLastRun'
          nullable: true
          description: 最新快照摘要。包含在`GET /v1/monitors/{monitor_id}`中。
        agent:
          $ref: '#/components/schemas/MonitorAgent'
        metadata:
          type: object
          additionalProperties: true
        created:
          type: integer
          description: Unix时间戳（秒）。
        updated:
          type: integer
          description: Unix时间戳（秒）。
        total_count:
          type: integer
          description: >-
            快照总数。除非`include_total_count=false`，否则包含在`GET
            /v1/monitors/{monitor_id}`中。
        mermaid_diagram:
          type: string
          description: 监控DAG的Mermaid流程图。当`include-diagram=true`时包含在获取中。
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        monitor_id:
          type: string
          description: 在某些创建/更新错误响应中出现。
    MonitorTracked:
      type: object
      description: 规划完成后监控器跟踪的已解决目标。
      properties:
        type:
          type: string
          nullable: true
          description: 跟踪的表面类型（例如 `url` 或 `web_query`）。
        urls:
          type: array
          items:
            type: string
            format: uri
          description: 正在监控的具体 URL。
        web_query:
          type: string
          nullable: true
          description: 当监控器跟踪动态结果集时使用的网页搜索查询。
    MonitorSourcePolicy:
      type: object
      description: 在规划和执行期间应用的可选 URL/域名允许和拒绝列表。
      properties:
        include_urls:
          type: array
          items:
            type: string
            format: uri
        exclude_urls:
          type: array
          items:
            type: string
            format: uri
        include_domains:
          type: array
          items:
            type: string
        exclude_domains:
          type: array
          items:
            type: string
    MonitorSchedule:
      type: object
      properties:
        frequency:
          type: string
          nullable: true
          description: 自然语言的计划文本（例如 `every hour`）。
        cron:
          type: string
          nullable: true
          description: 从 `frequency` 派生的 Cron 表达式。
        timezone:
          type: string
          example: UTC
          description: 计划时区。目前监控计划使用 `UTC`。
        next_run_at:
          type: string
          format: date-time
          nullable: true
          description: 下次计划运行时间（ISO 8601）。当监控器不是 `active` 时为 `null`。
    MonitorNotification:
      type: object
      properties:
        events:
          type: array
          items:
            type: string
            enum:
              - changed
              - first_snapshot
          description: >-
            何时通知。`changed` — 当检测到与前一个快照的变化时传递。`first_snapshot` — 当拍摄第一个基线快照时传递。当
            `channels` 非空且 `events` 为空时，默认为两者。
        channels:
          type: array
          items:
            $ref: '#/components/schemas/NotificationChannel'
          description: Email、Slack 或 SMS 传递目标。在运行时由监控管道解析。
    MonitorWebhook:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: 接收监控负载的 HTTP/HTTPS URL（与 `notification.channels` 分开）。
    MonitorLastRun:
      type: object
      properties:
        id:
          type: string
          nullable: true
          description: 最新快照的运行 ID (`run_…`)。
        status:
          type: string
          example: completed
        change_detected:
          type: boolean
          nullable: true
        ran_at:
          type: string
          format: date-time
          nullable: true
    MonitorAgent:
      type: object
      properties:
        id:
          type: string
          nullable: true
          description: 用于执行监控 DAG 的内部影子代理 ID。
    NotificationChannel:
      type: object
      required:
        - type
        - target
      properties:
        type:
          type: string
          enum:
            - email
            - slack
            - sms
          description: 传递渠道类型。
        target:
          type: string
          description: 电子邮件地址、Slack webhook URL 或 E.164 电话号码（用于 SMS）。
        events:
          type: array
          items:
            type: string
            enum:
              - changed
              - first_snapshot
          description: 可选的每渠道事件过滤器。当省略时，渠道传递遵循顶级 `notification.events`（或在设置渠道时使用默认值）。
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: Bearer认证头格式为Bearer <token>，其中<token>是你的认证令牌。

````