Create an SLO¶
POST /api/v1/slo/add
Overview¶
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
name | string | Y | SLO name Allow null: False Maximum length: 256 |
interval | string | Y | Detection frequency Allow null: False Possible values: ['5m', '10m'] Example: 5m |
goal | float | Y | Expected SLO target, range: 0-100, excluding 0 and 100 Allow null: False Possible value greater than: 0 Possible value less than: 100 Example: 90.0 |
minGoal | float | Y | Minimum SLO target, range: 0-100, excluding 0 and 100, and less than goal Allow null: False Possible value greater than: 0 Possible value less than: 100 Example: 85.0 |
sliUUIDs | array | Y | List of SLI UUIDs Allow null: False Example: ['rul-aaaaaa', 'rul-bbbbbb'] |
describe | string | SLO group description Example: This is an example Allow null: False Allow empty string: True Maximum length: 3000 |
|
alertPolicyUUIDs | array | Alert policy UUID Allow null: False |
|
tags | array | Tag names for filtering Allow null: False Example: ['xx', 'yy'] |
Additional Parameter Notes¶
- sliUUIDs, list of SLI UUIDs. Reference: Monitoring - Monitors - Get monitor list (you can specify the search parameter to search by monitor name, other parameters omitted) take the uuid field of the monitor.
- alertOpt[#].alertTarget, notification targets for alerts. Reference: Monitoring - Notification Targets Management - 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 Test OpenAPI","tags":[],"alertPolicyUUIDs":["altpl_d8db4xxxx"]}'
Response¶
{
"code": 200,
"content": {
"alertOpt": {},
"config": {
"checkRange": 604800,
"describe": "LWC Test 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"
}