这些参数及对应仪表板小部件字段objects的可选属性值,可用于配置dashboard.create
和dashboard.update
方法中的SLA report部件。
小部件fields
属性在仪表板创建或更新时不会进行验证。这使得用户可以修改built-in widgets并创建开发模块,但也存在错误创建或更新部件的风险。为确保成功创建或更新SLA报告部件,请参考下文表格中列出的参数要求。
SLA报表小部件支持以下参数。
参数 | 仪表板小部件字段 | 名称 | 值 |
---|---|---|---|
Refresh interval | 0 | rf_rate | 0 - (默认) 不刷新; 10 - 10 秒; 30 - 30 秒; 60 - 1 分钟; 120 - 2 分钟; 600 - 10 分钟; 900 - 15 分钟。 |
SLA (required) |
10 | slaid | SLA ID。 |
Service | 9 | serviceid | Service ID。 |
Show periods | 0 | show_periods | 有效值范围为 1-100。 默认值:20。 |
From | 1 | date_from | 有效日期 string,格式为 YYYY-MM-DD 。支持 时间段选择器 修饰符 d 、w 、M 、y (例如 now 、now/d 、now/w-1w 等)。 |
To | 1 | date_to | 有效日期 string,格式为 YYYY-MM-DD 。支持 时间段选择器 修饰符 d 、w 、M 、y (例如 now 、now/d 、now/w-1w 等)。 |
以下示例仅针对SLA报告小部件的仪表板小部件字段objects的配置进行说明。 有关配置仪表板的更多信息,请参阅dashboard.create
。
配置一个SLA报表部件,用于显示服务"2"的SLA"4"在过去30天内的SLA报表。
请求:
{
"jsonrpc": "2.0",
"method": "dashboard.create",
"params": {
"name": "My dashboard",
"display_period": 30,
"auto_start": 1,
"pages": [
{
"widgets": [
{
"type": "slareport",
"name": "SLA report",
"x": 0,
"y": 0,
"width": 12,
"height": 5,
"view_mode": 0,
"fields": [
{
"type": 10,
"name": "slaid",
"value": 4
},
{
"type": 9,
"name": "serviceid",
"value": 2
},
{
"type": 1,
"name": "date_from",
"value": "now-30d"
},
{
"type": 1,
"name": "date_to",
"value": "now"
}
]
}
]
}
],
"userGroups": [
{
"usrgrpid": 7,
"permission": 2
}
],
"users": [
{
"userid": 1,
"permission": 3
}
]
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
响应: