コンテンツへスキップ
サインイン
APIリファレンス
リソース

AI Rule

Which new incidents or alerts OneUptime AI investigates and fixes, and how. A rule investigates what it matches (right away, or only if still open after a wait), and fixes it or not, asking first or not. A fix may run the project's runbooks (only the rule's, when it names some), Bash commands on a Runner the rule picks, the tools of the project's external MCP servers (only the rule's, when it names some), and open fix and telemetry pull requests in the project's code repositories (only the rule's, when it names some). With no rule, OneUptime AI investigates every one, and fixes every one while automatic fixing is on. These were auto remediation rules, and investigation rules are AI rules now too.

AI Ruleモデル

プロパティ

  • 名前
    _id
    タイプ
    Object ID
    説明

    ID of this object

  • 名前
    createdAt
    タイプ
    Date
    説明

    Date and Time when the object was created.

  • 名前
    updatedAt
    タイプ
    Date
    説明

    Date and Time when the object was updated.

  • 名前
    criteria
    タイプ
    JSON
    説明

    Versioned conditions that determine whether this rule matches a resource.

  • 名前
    project
    タイプ
    Project
    説明

    Relation to Project Resource in which this object belongs

  • 名前
    projectId
    タイプ
    Object ID 必須
    説明

    ID of your OneUptime Project in which this object belongs

  • 名前
    name
    タイプ
    Text 必須
    説明

    Name of this AI rule.

  • 名前
    description
    タイプ
    Long Text
    説明

    Description of this AI rule.

  • 名前
    isEnabled
    タイプ
    Boolean 必須
    説明

    Whether this rule is enabled.

  • 名前
    triggerEntityType
    タイプ
    Text 必須
    説明

    Which kind of new signal this rule decides about: Incident or Alert.

  • 名前
    investigates
    タイプ
    Boolean 必須
    説明

    Whether OneUptime AI investigates the incidents or alerts this rule matches. With enabled rules that investigate, only their matches are investigated. Off, the rule only fixes, and does not change which incidents are investigated. The dashboard turns it on for every rule; left out of an API write, it is off.

  • 名前
    onlyIfOpenAfterMinutes
    タイプ
    Number
    説明

    Investigate only incidents or alerts still open this many minutes after they were created: OneUptime AI waits that long, then investigates if it is still open. Leave empty to investigate right away. When several rules match, the shortest wait decides. At most 1440 minutes (a day).

  • 名前
    fixes
    タイプ
    Boolean 必須
    説明

    Whether OneUptime AI fixes the incidents or alerts this rule matches, the way its Execution Mode says. Off, the rule only investigates them. With enabled rules, an incident is fixed only when a rule that fixes matches it. On by default.

  • 名前
    executionMode
    タイプ
    Text 必須
    説明

    How a rule that fixes asks. Suggest asks before fixing: every fix the rule starts waits for one-click human approval. FullAuto fixes without asking: OneUptime AI fixes on its own where the cluster's or resource's AI agent page allows, a runbook it picks from the ones the rule names starts right away (one it picks from all of the project's runbooks still waits for approval), a change through an MCP server the rule names is made right away (through any of the project's MCP servers, it still waits for approval), and a rule that runs its runbooks every time starts them immediately.

  • 名前
    remediationAction
    タイプ
    Text 必須
    説明

    OneUptimeAI (the default): OneUptime AI fixes the matched incident or alert - on the Kubernetes clusters and infrastructure it is linked to, the way each one's AI agent page allows, with the project's runbooks (only the rule's Runbooks when it names some) and with commands on the rule's Runner when it picks one. Runbooks: the rule starts every one of its Runbooks for every match, without OneUptime AI deciding. Whether a person approves first is the rule's Execution Mode.

  • 名前
    aiSelectsRunbook
    タイプ
    Boolean 必須
    説明

    Kept for rules saved before rules were simplified: an AI planning run reads the incident/alert context and picks the most applicable runbook (from the attached candidates, or all enabled runbooks when none are attached), always proposing it for approval, and the rule does nothing else. Every OneUptime AI rule now lets AI pick a runbook on its own, so new rules leave this off.

  • 名前
    aiComposesCommands
    タイプ
    Boolean 必須
    説明

    Kept for rules saved before rules were simplified: the AI investigates the incident/alert and composes Bash commands for the rule's Runner and Command Runners, and the rule does nothing else. Suggest mode proposes a command plan for one-click approval; FullAuto mode may execute commands inline, but only ones matching the command allowlist. A OneUptime AI rule now composes commands on its Runner when it picks one, so new rules leave this off.

  • 名前
    commandAllowlist
    タイプ
    JSON
    説明

    Glob patterns for commands the AI may execute WITHOUT human approval under FullAuto (for example: systemctl restart *). Commands that do not match are proposed for one-click approval instead. Destructive commands are always refused by the built-in policy.

  • 名前
    commandRunners
    タイプ
    Runner
    説明

    Kept for rules saved before rules were simplified: more Runners the AI may target with composed commands, besides the rule's Runner. A Runner runs a rule's commands only when the rule names it.

  • 名前
    monitors
    タイプ
    Monitor
    説明

    Only trigger for incidents/alerts from these monitors. Leave empty to match any monitor.

  • 名前
    incidentSeverities
    タイプ
    Incident Severity
    説明

    Only trigger for incidents with these severities (incident rules only). Leave empty to match any severity.

  • 名前
    alertSeverities
    タイプ
    Alert Severity
    説明

    Only trigger for alerts with these severities (alert rules only). Leave empty to match any severity.

  • 名前
    labels
    タイプ
    Label
    説明

    Only trigger for incidents/alerts that carry at least one of these labels. Leave empty to match any label.

  • 名前
    monitorLabels
    タイプ
    Label
    説明

    Only trigger when the incident/alert's monitor carries at least one of these labels — the natural way to scope rules to environments (e.g. staging vs production). Leave empty to match any monitor label.

  • 名前
    titlePattern
    タイプ
    Long Text
    説明

    Case-insensitive regex matched against the entity's title. Leave empty to match any title.

  • 名前
    descriptionPattern
    タイプ
    Long Text
    説明

    Case-insensitive regex matched against the entity's description. Leave empty to match any description.

  • 名前
    runbooks
    タイプ
    Runbook
    説明

    The runbooks OneUptime AI may pick and run for this rule. Leave empty to let it pick any of the project's runbooks. A rule whose Fix With is Runbooks starts every one of them for every match instead.

  • 名前
    externalMcpServers
    タイプ
    External MCP Server
    説明

    The external MCP servers OneUptime AI may use while it investigates and fixes what this rule matches (an investigation uses only their tools that read). Leave empty to let it use all of the project's MCP servers; changes through them are then always proposed for approval first.

  • 名前
    runner
    タイプ
    Runner
    説明

    The Runner OneUptime AI runs this rule's Bash commands on, inside your network. Empty means none: OneUptime AI runs no commands of its own for the rule. Commands on the affected Kubernetes cluster or host always go through its AI agent.

  • 名前
    runnerId
    タイプ
    Object ID
    説明

    ID of the Runner OneUptime AI runs this rule's Bash commands on: one of the project's own Runners. Empty means none: OneUptime AI runs no commands of its own for the rule. Commands on the affected Kubernetes cluster or host always go through its AI agent.

  • 名前
    codeRepositories
    タイプ
    Code Repository
    説明

    The code repositories OneUptime AI may read while it investigates and fixes what this rule matches, and open the rule's pull requests in. Leave empty to let it use every repository the project has connected.

  • 名前
    llmProvider
    タイプ
    LLM Provider
    説明

    The LLM provider OneUptime AI uses for everything this rule starts: one of the project's providers or a global one. Empty: the project's default provider, else the global one.

  • 名前
    llmProviderId
    タイプ
    Object ID
    説明

    ID of the LLM provider OneUptime AI uses for everything this rule starts. Empty: the project's default provider, else the global one.

  • 名前
    openCodeFixPullRequests
    タイプ
    Boolean 必須
    説明

    When an investigation of an incident or alert this rule matches finds the cause in your code, OneUptime AI opens a pull request with the fix, for review. Nothing is merged. Acts only while fixing new incidents (or alerts) automatically is on. On by default.

  • 名前
    openTelemetryPullRequests
    タイプ
    Boolean 必須
    説明

    When missing logs, traces or metrics stop an investigation of an incident or alert this rule matches, OneUptime AI opens a pull request that adds them, for review. Nothing is merged. Acts only while fixing new incidents (or alerts) automatically is on. On by default.

  • 名前
    verificationWindowMinutes
    タイプ
    Number
    説明

    How long after the runbook starts the subject's monitors get to recover before verification fails. Defaults to 15 minutes.

  • 名前
    autoResolveOnVerifiedRecovery
    タイプ
    Boolean 必須
    説明

    When verification confirms the monitors recovered inside the window, automatically resolve the incident/alert. Off by default — the timeline note is posted either way.

  • 名前
    createdByUser
    タイプ
    User
    説明

    Relation to User who created this object (if this object was created by a User)

  • 名前
    createdByUserId
    タイプ
    Object ID
    説明

    User ID who created this object.

GET または POST
/api/auto-remediation-rule/get-list

一覧

このエンドポイントを使用すると、すべてのAI Ruleのページ分割されたリストを取得できます。デフォルトでは、ページごとに最大10件のAI Ruleが表示されます。

オプションのクエリパラメータ

  • Limit
    limit
    タイプ
    number
    説明
    取得するオブジェクトの数。デフォルトは10で、この数を最大100まで増やすことができます
  • Skip
    skip
    タイプ
    number
    説明
    スキップするオブジェクトの数。これはページネーションで便利です

オプションのリクエストボディ

Listリクエスト

POST
/api/auto-remediation-rule/get-list?skip=0&limit=10
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "select": {
    "fixes": true,
    "investigates": true,
    "openCodeFixPullRequests": true,
    "openTelemetryPullRequests": true,
    "onlyIfOpenAfterMinutes": true
  },
  "query": {
    "executionMode": "Example execution mode"
  },
  "sort": {
    "createdAt": -1
  }
}

レスポンス

{
    "count": 10,
    "limit": 10,
    "skip": 0,
    "data": [
        {
            "_id": "1efb1314-a1e9-4c23-9133-859692d8e959",
            "fixes": true,
            "investigates": true,
            "openCodeFixPullRequests": true,
            "openTelemetryPullRequests": true,
            "onlyIfOpenAfterMinutes": 10
        },
        {
            "_id": "4994569c-1751-4f1f-a5ef-5cdad51c4eaa",
            "fixes": true,
            "investigates": true,
            "openCodeFixPullRequests": true,
            "openTelemetryPullRequests": true,
            "onlyIfOpenAfterMinutes": 10
        },
        {
            "_id": "dab4f305-b707-4190-9380-b3fb7b1673bb",
            "fixes": true,
            "investigates": true,
            "openCodeFixPullRequests": true,
            "openTelemetryPullRequests": true,
            "onlyIfOpenAfterMinutes": 10
        }
    ]
}
GET または POST
/api/auto-remediation-rule/:id/get-item

IDで項目を取得

このエンドポイントを使用すると、IDでAI Ruleを取得できます。

必須のクエリパラメータ

  • ID
    id
    タイプ
    text
    説明
    オブジェクトのID

オプションのリクエストボディ

  • Select
    select
    タイプ
    select
    説明
    デフォルトでは、オブジェクトのIDのみが取得されます。より多くのフィールドを取得するには、それらを選択する必要があります。詳細については、 こちらでselectの方法をご確認ください。

Get Itemリクエスト

POST
/api/auto-remediation-rule/:id/get-item
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "select": {
    "fixes": true,
    "investigates": true,
    "openCodeFixPullRequests": true,
    "openTelemetryPullRequests": true,
    "onlyIfOpenAfterMinutes": true
  }
}

レスポンス

{
    "_id": "1efb1314-a1e9-4c23-9133-859692d8e959",
    "fixes": true,
    "investigates": true,
    "openCodeFixPullRequests": true,
    "openTelemetryPullRequests": true,
    "onlyIfOpenAfterMinutes": 10
}
POST
/api/auto-remediation-rule/count

カウント

このエンドポイントを使用すると、すべてのAI Ruleのカウントを取得できます。

オプションのリクエストボディ

Countリクエスト

POST
/api/auto-remediation-rule/count
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "query": {
    "executionMode": "Example execution mode"
  }
}

レスポンス

{
    "count": 107
}
POST
/api/auto-remediation-rule

AI Ruleを作成

このエンドポイントを使用すると、新しいオブジェクトを作成できます。

リクエストボディ

  • Data
    data
    タイプ
    JSON
    説明
    JSONとして作成するオブジェクト

Createリクエスト

POST
/api/auto-remediation-rule
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "data": {
    "fixes": true,
    "investigates": true,
    "openCodeFixPullRequests": true,
    "openTelemetryPullRequests": true,
    "onlyIfOpenAfterMinutes": 10
  }
}

レスポンス

{
    "_id": "1efb1314-a1e9-4c23-9133-859692d8e959",
    "fixes": true,
    "investigates": true,
    "openCodeFixPullRequests": true,
    "openTelemetryPullRequests": true,
    "onlyIfOpenAfterMinutes": 10
}
PUT
/api/auto-remediation-rule/:id

IDで更新

このエンドポイントを使用すると、IDでオブジェクトを更新できます。

リクエストボディ

  • Data
    data
    タイプ
    JSON
    説明
    JSONとして更新するオブジェクト

代替メソッド

PUTリクエストをサポートしないクライアントの場合、同じリクエストヘッダーとボディでPOSTまたはGETを使用できます:

POST /api/auto-remediation-rule/:id/update-item

Updateリクエスト

PUT
/api/auto-remediation-rule/:id
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY
ボディ
{
  "data": {
    "fixes": true,
    "investigates": true,
    "openCodeFixPullRequests": true
  }
}

レスポンス

{}
DELETE
/api/auto-remediation-rule/:id

IDで削除

このエンドポイントを使用すると、IDでオブジェクトを削除できます。

代替メソッド

DELETEリクエストをサポートしないクライアントの場合、同じリクエストヘッダーとボディでPOSTまたはGETを使用できます:

POST /api/auto-remediation-rule/:id/delete-item

Deleteリクエスト

DELETE
/api/auto-remediation-rule/:id
ヘッダー
Content-Type: application/json
ApiKey: YOUR_API_KEY

レスポンス

{}

権限

API Tokenでこのリソースを作成、更新、読み取り、または削除するには権限が必要です。リクエストを行う権限がない場合、レスポンスとして4xxステータスが送信されます。

読み取り権限

AI Ruleを読み取るために必要です

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • ProjectMember
    Project Member
    Member of this project. Creates, changes and deletes monitors, incidents, alerts, status pages, on-call policies, scheduled maintenance, services and infrastructure, and runs runbooks. Project settings take Project Admin: team members and permissions, API keys, labels, SSO, rules, custom fields, states, secrets, dashboards, SLOs, and changing workflows and runbooks. Does not see API keys, the audit log, invoices, secrets, session replays or security data.
  • Viewer
    Viewer
    Reads the project's resources and changes nothing. Does not see API keys, the audit log, invoices, secrets, session replays, security data, or AI conversations, insights and remediation suggestions.
  • ReadAutoRemediationRule
    Read AI Rule
    This permission can read AI Rules in this project.

作成権限

AI Ruleを作成するために必要です

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • CreateAutoRemediationRule
    Create AI Rule
    This permission can create AI Rules in this project: which incidents and alerts OneUptime AI investigates and fixes.

更新権限

AI Ruleを更新するために必要です

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • EditAutoRemediationRule
    Edit AI Rule
    This permission can edit AI Rules in this project.

削除権限

AI Ruleを削除するために必要です

  • ProjectOwner
    Project Owner
    Owner of this project. Does everything Project Admin does, and also manages billing and payment methods, sets up SCIM, and can delete the project.
  • ProjectAdmin
    Project Admin
    Admin of this project. Creates, changes and deletes everything in it, including team members and their permissions, API keys, labels, SSO, rules and custom fields, and reads the audit log. Cannot manage billing, set up SCIM or delete the project.
  • DeleteAutoRemediationRule
    Delete AI Rule
    This permission can delete AI Rules in this project.