सामग्री पर जाएँ
साइन इन करें
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 की एक पेजिनेटेड सूची प्राप्त करने की अनुमति देता है। डिफ़ॉल्ट रूप से, प्रति पृष्ठ अधिकतम दस AI Rule दिखाए जाते हैं।

वैकल्पिक क्वेरी पैरामीटर

  • Limit
    limit
    प्रकार
    number
    विवरण
    लाने के लिए ऑब्जेक्ट्स की संख्या। डिफ़ॉल्ट रूप से 10, आप इस गणना को 100 तक बढ़ा सकते हैं
  • Skip
    skip
    प्रकार
    number
    विवरण
    छोड़ने के लिए ऑब्जेक्ट्स की संख्या। यह पेजिनेशन में उपयोगी हो सकता है

वैकल्पिक अनुरोध बॉडी

  • Query
    query
    प्रकार
    query
    विवरण
    यदि आप AI Rule पर फ़िल्टर करना चाहते हैं। आप यहाँ एक क्वेरी निर्दिष्ट कर सकते हैं। अधिक जानकारी के लिए, कृपया यहाँ क्वेरी लिखने की जाँच करें।
  • Select
    select
    प्रकार
    select
    विवरण
    डिफ़ॉल्ट रूप से आप केवल ऑब्जेक्ट्स की ID पुनः प्राप्त करेंगे, अधिक फ़ील्ड पुनः प्राप्त करने के लिए आपको उन्हें चुनना होगा। अधिक जानकारी के लिए, कृपया देखें कि यहाँ कैसे चुनें।
  • Sort
    sort
    प्रकार
    sort
    विवरण
    ऑब्जेक्ट्स को डिफ़ॉल्ट रूप से बनाई गई तिथि के आधार पर क्रमबद्ध किया जाएगा। आप पास करके क्रमबद्धता का क्रम बदल सकते हैं कृपया देखें कि यहाँ कैसे चुनें।

सूची अनुरोध

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": "7822c8c5-b465-4814-bc9e-ac6941577417",
            "fixes": true,
            "investigates": true,
            "openCodeFixPullRequests": true,
            "openTelemetryPullRequests": true,
            "onlyIfOpenAfterMinutes": 10
        },
        {
            "_id": "6d36de47-b4f4-4a5f-a002-f16f417aa00d",
            "fixes": true,
            "investigates": true,
            "openCodeFixPullRequests": true,
            "openTelemetryPullRequests": true,
            "onlyIfOpenAfterMinutes": 10
        },
        {
            "_id": "96101a93-4f4b-4140-b85f-397ef591fda3",
            "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 पुनः प्राप्त करेंगे, अधिक फ़ील्ड पुनः प्राप्त करने के लिए आपको उन्हें चुनना होगा। अधिक जानकारी के लिए, कृपया देखें कि यहाँ कैसे चुनें।

आइटम प्राप्त करें अनुरोध

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": "7822c8c5-b465-4814-bc9e-ac6941577417",
    "fixes": true,
    "investigates": true,
    "openCodeFixPullRequests": true,
    "openTelemetryPullRequests": true,
    "onlyIfOpenAfterMinutes": 10
}
POST
/api/auto-remediation-rule/count

गणना

यह एंडपॉइंट आपको अपने सभी AI Rule की गणना पुनः प्राप्त करने की अनुमति देता है।

वैकल्पिक अनुरोध बॉडी

गणना अनुरोध

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 के रूप में बनाने के लिए ऑब्जेक्ट

बनाएँ अनुरोध

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": "7822c8c5-b465-4814-bc9e-ac6941577417",
    "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

अपडेट अनुरोध

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
/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.