Skip to content

Create



POST /api/v1/slo/add

Overview

Body Request Parameters

Parameter Name Type Required Description
name string Y SLO name
Nullable: False
Maximum length: 256
interval string Y Detection frequency
Nullable: False
Optional values: ['5m', '10m']
Example: 5m
goal float Y SLO expected target, value range: 0-100, excluding 0, 100
Nullable: False
Greater than: 0
Less than: 100
Example: 90.0
minGoal float Y SLO minimum target, value range: 0-100, excluding 0, 100, and less than goal
Nullable: False
Greater than: 0
Less than: 100
Example: 85.0
sliUUIDs array Y List of SLI UUIDs
Nullable: False
Example: ['rul-aaaaaa', 'rul-bbbbbb']
describe string SLO group description information
Example: This is an example
Nullable: False
Nullable empty string: True
Maximum length: 3000
alertPolicyUUIDs array Alert policy UUID
Nullable: False
tags array Tag names used for filtering
Nullable: False
Example: ['xx', 'yy']

Additional Parameter Notes

  • sliUUIDs, the list of SLI uuids reference: Monitoring - Monitors - Get monitor list (can specify search parameter to search by monitor name, other parameters omitted) take the monitor uuid field
  • alertOpt[#].alertTarget, notification targets for alerts reference: Monitoring - Notification Targets - Get notification targets list

Request Example

curl 'https://openapi.guance.com/api/v1/slo/add' \
-H 'Content-Type: application/json' \
-H 'DF-API-KEY:  <DF-API-KEY>' \
--data '{"name":"LWC-Test-2024-08-06-002","interval":"10m","goal":90,"minGoal":60,"sliUUIDs":["rul_xxxxx","rul_9eb745xx"],"describe":"LWC testing OpenAPI","tags":[],"alertPolicyUUIDs":["altpl_d8db4xxxx"]}'

Response

{
    "code": 200,
    "content": {
        "alertOpt": {},
        "config": {
            "checkRange": 604800,
            "describe": "LWC testing OpenAPI",
            "goal": 90,
            "interval": "10m",
            "minGoal": 60,
            "sli_infos": [
                {
                    "id": "rul_7xxxx",
                    "name": "lml-tes",
                    "status": 0
                },
                {
                    "id": "rul_9xxxx",
                    "name": "whytest-feedback issue verification",
                    "status": 2
                }
            ]
        },
        "createAt": 1722913524,
        "creator": "wsak_a2d5xxx",
        "creatorInfo": {
            "uuid": "xx",
            "status": 0,
            "username": "xx",
            "name": "xx",
            "iconUrl": "",
            "email": "xx",
            "acntWsNickname": "xx"
        },
        "declaration": {
            "asd": "aa,bb,cc,1,True",
            "asdasd": "dawdawd",
            "business": "aaa",
            "fawf": "afawf",
            "organization": "64fe7b4062f74d0007b46676"
        },
        "deleteAt": -1,
        "id": null,
        "name": "LWC-Test-2024-08-06-002",
        "score": 0,
        "status": 0,
        "type": "slo",
        "updateAt": 1706152340,
        "updator": "xx",
        "updatorInfo": {
            "uuid": "xx",
            "status": 0,
            "username": "xx",
            "name": "xx",
            "iconUrl": "",
            "email": "xx",
            "acntWsNickname": "xx"
        },
        "uuid": "monitor_5exxxxx",
        "workspaceUUID": "wksp_4b57cxxxx"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "12912524534614287758"
} 

Feedback

Is this page helpful? ×