List¶
GET /api/v1/slo/list
Overview¶
List SLOs in the current workspace with pagination. You can filter by name, UUID, associated monitors, and tags.
Before You Call and Usage Steps¶
The first page starts at 1. Results are returned in descending order of record ID. After obtaining content.data[].uuid, query Details, Daily Availability, or runtime status. The list includes monitor-based and metric-based SLOs; select the subsequent API based on config.sliType.
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI Key of the current workspace. Example: <DF-API-KEY>How to obtain or enter: Obtain the calling credential from API Key Management in the target workspace. |
Query Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| refSli | string | Return SLOs associated with this monitor. Allows null: True Example: rul_exampleHow to obtain or enter: Obtain the monitor UUID from content.data[].uuid in the Monitor List response or from content.config.sli_infos[].id in the SLO details. |
|
| search | string | Perform a contains match on name or UUID. Allows null: True Example: 结账How to obtain or enter: Use a known SLO name or UUID in the workspace; you can also enter only part of it. |
|
| tags | string | Filter by tag name. Allows null: True Example: team:checkoutHow to obtain or enter: Obtain tag names from SLO tags or content.tagInfo[].name in details, and separate them with commas. |
|
| tagMode | string | Matching mode for multiple tags. Default: and. Allows null: False Allowed values: ['and', 'or'] Example: andHow to obtain or enter: Select and to match all tags, or or to match any tag, as needed. |
|
| pageIndex | integer | Current page. Default: 1. Minimum: 1. Allows null: False $minValue: 1 Example: 1How to obtain or enter: Start at 1 and increment by page. |
|
| pageSize | integer | Number of entries per page. Default: 100. Valid range: 1 to 10000. Allows null: False $minValue: 1 $maxValue: 10000 Example: 100How to obtain or enter: Set a positive integer based on the number of results needed. |
Additional Parameter Notes¶
Read SLOs in the workspace to which the current API Key belongs.
Request Example¶
curl --get -H "DF-API-KEY: <DF-API-KEY>" \
'https://openapi.guance.com/api/v1/slo/list' \
--data-urlencode "search=服务" \
--data-urlencode "pageIndex=1" \
--data-urlencode "pageSize=100"
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content.data | array<object> |
SLO list. This is an empty array when there are no records. |
| content.data[].uuid | string | SLO UUID. Used for reading SLOs and querying availability and runtime status. |
| content.data[].workspaceUUID | string | Workspace to which the SLO belongs. |
| content.data[].name | string | SLO name. |
| content.data[].id | integer | Record ID. |
| content.data[].type | string | Fixed to slo. |
| content.data[].score | number | Score field of the SLO record. |
| content.data[].status | integer | 0 indicates enabled; 2 indicates disabled. |
| content.data[].creator | string | Creator identifier. |
| content.data[].updator | string | Last updater identifier. |
| content.data[].createAt | number | Creation time, in Unix seconds. |
| content.data[].updateAt | number | Last update time, in Unix seconds. |
| content.data[].deleteAt | number | Deletion time; usually -1 when not deleted. |
| content.data[].creatorInfo | object | Creator information; {} if not found. |
| content.data[].updatorInfo | object | Last updater information; {} if not found. |
| content.data[].config | object | SLO configuration. |
| content.data[].config.sliType | string | monitor indicates monitor-based; metric indicates metric-based. For old records without this configuration, monitor is returned. |
| content.data[].config.checkRange | integer | Statistics period, in seconds. Supports 604800 (7 days) and 2592000 (30 days). If omitted, 604800 is returned. |
| content.data[].config.goal | number | Target availability percentage. |
| content.data[].config.minGoal | number | Minimum availability target percentage. |
| content.data[].config.describe | string | SLO description. |
| content.data[].config.interval | string | Detection frequency, for example 5m or 10m. |
| content.data[].config.groupBy | array<string> |
Group-by fields. |
| content.data[].config.ignoreBadGroupEvents | boolean | Whether to ignore abnormal group events. |
| content.data[].config.sli_infos | array<object> |
List of associated monitors; empty when none are associated. |
| content.data[].config.sli_infos[].id | string | Associated monitor UUID. |
| content.data[].config.sli_infos[].name | string | Associated monitor name. |
| content.data[].config.sli_infos[].status | integer | Associated monitor status. |
| content.data[].config.metricQueries | object | Metric-based SLOs only. total and good are the query configurations for total volume and successful volume, respectively. Each key contains dql, queryType, and editor; PromQL can also include promqlType. |
| content.data[].metricQueryInfo | object | Metric-based SLOs only. Used to select collected data. |
| content.data[].metricQueryInfo.measurement | string | Fixed to slo_metric. |
| content.data[].metricQueryInfo.sloId | string | Identifier used for collected data. Its purpose differs from that of the business UUID in this API. |
| content.data[].metricQueryInfo.validAfter | integer or null | Effective calculation start time, in Unix milliseconds. |
| content.data[].metricQueryInfo.stoppedAt | integer or null | Collection stop time, in Unix milliseconds. |
| content.data[].tagInfo | array<object> |
Associated tags. This is an empty array when none are associated. |
| content.data[].tagInfo[].id | integer | Tag record ID. |
| content.data[].tagInfo[].uuid | string | Tag identifier. |
| content.data[].tagInfo[].name | string | Tag name, used for tag queries. |
| content.data[].tagInfo[].description | string | Tag description. |
| content.data[].tagInfo[].colour | string | Tag color. |
| content.data[].tagInfo[].scope | string | Tag scope. |
| content.data[].alertPolicyInfos | array<object> |
Associated alert policies. This is an empty array when none are associated. |
| content.data[].alertPolicyInfos[].uuid | string | Alert policy UUID. |
| content.data[].alertPolicyInfos[].name | string | Alert policy name. |
| pageInfo | object | Pagination object at the top level of the response. |
| pageInfo.pageIndex | integer | Current page number. |
| pageInfo.pageSize | integer | Number of entries per page. |
| pageInfo.count | integer | Number of entries on the current page. |
| pageInfo.totalCount | integer | Total number of matching entries. |
| content.declaration | object or null | Workspace declaration. |
{
"code": 200,
"content": {
"data": [
{
"id": 1,
"uuid": "monitor_example",
"workspaceUUID": "wksp_example",
"name": "服务可用率",
"type": "slo",
"score": 0,
"status": 0,
"config": {
"sliType": "monitor",
"checkRange": 604800,
"goal": 99.9,
"minGoal": 99.5,
"describe": "结账服务",
"interval": "5m",
"sli_infos": [
{
"id": "rul_example",
"name": "结账检查",
"status": 0
}
]
},
"tagInfo": [],
"alertPolicyInfos": [],
"creatorInfo": {},
"updatorInfo": {},
"creator": "wsak_example",
"updator": "wsak_example",
"createAt": 1785427200,
"updateAt": 1785430800,
"deleteAt": -1
}
],
"declaration": null
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE",
"pageInfo": {
"pageIndex": 1,
"pageSize": 100,
"count": 1,
"totalCount": 1
}
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | A Query field is not declared, a pagination value exceeds the constraint, or tagMode is not among the allowed values | Request field validation failed. | Verify the filter criteria and pagination range, and use positive integers for pageIndex/pageSize. |
| 500 | ft.InternalServerError | pageIndex or pageSize is passed in decimal form and passes the preceding range validation | Internal error. | Use a decimal integer string. |
| 404 | ft.NotFoundSLO | The matching metric-based SLO is missing an associated collector | The specified SLO was not found. | Verify the collection configuration of the selected metric-based SLO. |