Skip to content

Modify



POST /api/v1/slo/{slo_uuid}/modify

Overview

Route Parameters

Parameter Type Required Description
slo_uuid string Y Checker UUID
Nullable: False

Request Body Parameters

Parameter Type Required Description
status integer Status, 0 enabled (default), 2 disabled
Nullable: False
Allowed values: [0, 2]
sliType string SLI type, monitor (default) or metric; cannot be modified after creation
Nullable: False
Allowed values: ['monitor', 'metric']
checkRange integer Statistics period in seconds, only 7/30 days; default 604800
Nullable: False
Allowed values: [604800, 2592000]
metricQueries object Required for metric type; total/good each contain dql, queryType (dql/promql), promqlType (for PromQL, instantQuery/rangeQuery can be passed, actually unified to instantQuery), editor (echo object); editing allowed, queries and permissions are re-validated on save
Nullable: False
name string Only the original name can be submitted
Nullable: False
goal float Only the original goal can be submitted
Nullable: False
minGoal float Only the original minimum goal can be submitted
Nullable: False
interval string Detection frequency
Nullable: False
Allowed values: ['5m', '10m']
Example: 5m
sliUUIDs array List of SLI UUIDs
Nullable: False
Example: ['rul-aaaaaa', 'rul-bbbbbb']
describe string SLO description
Example: This is an example
Nullable: False
Empty string allowed: True
Maximum length: 3000
alertPolicyUUIDs array Alert Policy UUIDs
Nullable: False
tags array Tag names used for filtering
Nullable: False
Example: ['xx', 'yy']
groupBy array SLO computation dimensions, only project, env, service are supported; the DQL by dimension is kept consistent with this field, default []
Nullable: False
Example: ['service']
ignoreBadGroupEvents boolean Whether to ignore bad group events when groupBy is configured on the SLO, default true; does not take effect when groupBy is not configured
Nullable: False
Example: True

Additional Parameter Notes

Request Example

curl 'https://openapi.guance.com/api/v1/slo/monitor_xxxx32/modify' \
-H 'DF-API-KEY:  <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data '{
  "describe": "desc1",
  "alertPolicyUUIDs": ["altpl_xxxx"],
  "tags": [
    "Test"
  ]
}'

Response

{
    "code": 200,
    "content": {
        "config": {
            "checkRange": 604800,
            "describe": "desc1",
            "goal": 90.0,
            "interval": "10m",
            "minGoal": 60.0,
            "sli_infos": [
                {
                    "id": "rul_7a88b8xxxx",
                    "name": "lml-tes",
                    "status": 0
                },
                {
                    "id": "rul_9eb74xxxx",
                    "name": "whytest-Feedback Problem Verification",
                    "status": 2
                }
            ]
        },
        "createAt": 1722913524,
        "creator": "wsak_a2d55c91bxxxxx",
        "declaration": {
            "asd": "aa,bb,cc,1,True",
            "asdasd": "dawdawd",
            "business": "aaa",
            "fawf": "afawf",
            "organization": "64fe7b4062f74d0007b46676"
        },
        "deleteAt": -1,
        "id": 4901,
        "name": "LWC-Test-2024-08-06-002",
        "score": 0,
        "status": 0,
        "type": "slo",
        "updateAt": 1722914612.4453554,
        "updator": "wsak_a2d55c91bxxxxx",
        "uuid": "monitor_5ebbd15cxxxxxx",
        "workspaceUUID": "wksp_4b57c7bab3xxxxxx"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "12244323272853598406"
} 

Feedback

Is this page helpful?