Skip to content

Export User View



GET /api/v1/dashboard/{dashboard_uuid}/export

Overview

Export a single user view

Route Parameters

Parameter Type Required Description
dashboard_uuid string Y View UUID

Query Request Parameters

Parameter Type Required Description
title string Template name
Allow empty: False

Parameter Additional Explanation

Response Body Structure Explanation

Parameter Type Description
chartGroupPos list Chart group position information
chartPos list Chart position information
createdWay string The built-in view creation method, manually created:manual, imported:import
dashboardBidding dict Dashboard binding information
name string Dashboard name

Request Example

curl 'https://openapi.truewatch.com/api/v1/dashboard/dsbd_xxxx32/export' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--compressed

Response

{
    "code": 200,
    "content": {
        "dashboardBindSet": [],
        "dashboardExtend": {},
        "dashboardMapping": [],
        "dashboardOwnerType": "inner",
        "dashboardType": "CUSTOM",
        "iconSet": {
            "icon": "http://testing-static-res.dataflux.cn/dataflux-template/dashboard/zh/mysql_activity/icon.svg",
            "url": "http://testing-static-res.dataflux.cn/dataflux-template/dashboard/zh/mysql_activity/mysql_activity.png"
        },
        "main": {
            "charts": [
                {
                    "extend": {
                        "fixedTime": "",
                        "isRefresh": false,
                        "settings": {
                            "alias": [],
                            "bgColor": "",
                            "colors": [],
                            "compareTitle": "",
                            "compareType": "",
                            "currentChartType": "singlestat",
                            "downsample": "last",
                            "fixedTime": "",
                            "fontColor": "",
                            "isTimeInterval": false,
                            "levels": [],
                            "lineColor": "#3AB8FF",
                            "mappings": [],
                            "openCompare": false,
                            "precision": "2",
                            "showFieldMapping": false,
                            "showLine": false,
                            "showLineAxis": false,
                            "showTitle": true,
                            "timeInterval": "default",
                            "titleDesc": "",
                            "units": []
                        }
                    },
                    "group": {
                        "name": null
                    },
                    "name": "processing SQL",
                    "pos": {
                        "h": 8,
                        "w": 6,
                        "x": 0,
                        "y": 0
                    },
                    "queries": [
                        {
                            "color": "",
                            "datasource": "dataflux",
                            "name": "",
                            "qtype": "dql",
                            "query": {
                                "alias": "",
                                "code": "A",
                                "dataSource": "mysql_dbm_activity",
                                "field": "*",
                                "fieldFunc": "count",
                                "fieldType": "",
                                "fill": "",
                                "filters": [
                                    {
                                        "id": "f2c11510-334a-11ed-988f-912dd8df7487",
                                        "logic": "and",
                                        "name": "host",
                                        "op": "=",
                                        "type": "keyword",
                                        "value": "#{host}"
                                    }
                                ],
                                "funcList": [],
                                "groupBy": [
                                    "query_signature"
                                ],
                                "groupByTime": "",
                                "namespace": "logging",
                                "q": "SERIES_SUM(\\\"L::`mysql_dbm_activity`:(COUNT(`*`)) { `host` = '#{host}' } BY `query_signature`\\\")",
                                "queryFuncs": [
                                    {
                                        "args": [],
                                        "name": "series_sum"
                                    }
                                ],
                                "search": "",
                                "type": "simple"
                            },
                            "type": "singlestat",
                            "unit": ""
                        }
                    ],
                    "type": "singlestat"
                },
                {
                    "extend": {
                        "fixedTime": "",
                        "isRefresh": false,
                        "settings": {
                            "alias": [],
                            "bar": {
                                "direction": "horizontal",
                                "xAxisShowType": "groupBy"
                            },
                            "chartType": "bar",
                            "color": "",
                            "colors": [],
                            "currentChartType": "toplist",
                            "fixedTime": "",
                            "isTimeInterval": false,
                            "levels": [],
                            "openCompare": false,
                            "showFieldMapping": false,
                            "showTableHead": true,
                            "showTitle": true,
                            "showTopSize": true,
                            "table": {
                                "queryMode": "toGroupColumn"
                            },
                            "tableSortMetricName": "",
                            "tableSortType": "top",
                            "timeInterval": "default",
                            "titleDesc": "",
                            "topSize": 10,
                            "units": []
                        }
                    },
                    "group": {
                        "name": null
                    },
                    "name": "Processing SQLDistribution",
                    "pos": {
                        "h": 17,
                        "w": 12,
                        "x": 12,
                        "y": 16
                    },
                    "queries": [
                        {
                            "color": "",
                            "datasource": "dataflux",
                            "name": "",
                            "qtype": "dql",
                            "query": {
                                "alias": "",
                                "code": "A",
                                "dataSource": "mysql_dbm_activity",
                                "field": "*",
                                "fieldFunc": "count",
                                "fieldType": "",
                                "fill": "",
                                "filters": [
                                    {
                                        "id": "77936be0-334a-11ed-988f-912dd8df7487",
                                        "logic": "and",
                                        "name": "host",
                                        "op": "=",
                                        "type": "keyword",
                                        "value": "#{host}"
                                    }
                                ],
                                "funcList": [
                                    "last",
                                    "top:10"
                                ],
                                "groupBy": [
                                    "processlist_db"
                                ],
                                "groupByTime": "",
                                "namespace": "logging",
                                "q": "L::`mysql_dbm_activity`:(COUNT(`*`)) { `host` = '#{host}' } BY `processlist_db`",
                                "queryFuncs": [],
                                "search": "",
                                "type": "simple"
                            },
                            "type": "toplist",
                            "unit": ""
                        }
                    ],
                    "type": "toplist"
                },
                {
                    "extend": {
                        "fixedTime": "",
                        "isRefresh": false,
                        "settings": {
                            "alias": [],
                            "chartType": "areaLine",
                            "colors": [],
                            "compareTitle": "",
                            "compareType": "",
                            "currentChartType": "sequence",
                            "density": "medium",
                            "fixedTime": "",
                            "isPercent": false,
                            "isTimeInterval": true,
                            "legendPostion": "bottom",
                            "legendValues": [
                                "sum"
                            ],
                            "levels": [],
                            "openCompare": false,
                            "openStack": false,
                            "showFieldMapping": false,
                            "showLine": false,
                            "showTitle": true,
                            "stackType": "time",
                            "timeInterval": "default",
                            "titleDesc": "",
                            "units": [],
                            "xAxisShowType": "time"
                        }
                    },
                    "group": {
                        "name": null
                    },
                    "name": "Process by db",
                    "pos": {
                        "h": 17,
                        "w": 12,
        "extend": {
            "fixedTime": "",
            "isRefresh": false,
            "settings": {
                "alias": [],
                "chartType": "doughnut",
                "colors": [],
                "currentChartType": "pie",
                "fixedTime": "",
                "isTimeInterval": false,
                "legendPostion": "bottom",
                "levels": [],
                "showFieldMapping": false,
                "showTitle": true,
                "timeInterval": "default",
                "titleDesc": "",
                "units": []
            }
        },
        "group": {
            "name": null
        },
        "name": "Event Command type Distribution",
        "pos": {
            "h": 16,
            "w": 6,
            "x": 18,
            "y": 0
        },
        "queries": [
            {
                "color": "",
                "datasource": "dataflux",
                "name": "",
                "qtype": "dql",
                "query": {
                    "alias": "",
                    "code": "A",
                    "dataSource": "mysql_dbm_activity",
                    "field": "*",
                    "fieldFunc": "count",
                    "fieldType": "",
                    "fill": "",
                    "filters": [
                        {
                            "id": "3dbd9ce0-336a-11ed-a6f0-d37c49910681",
                            "logic": "and",
                            "name": "host",
                            "op": "=",
                            "type": "keyword",
                            "value": "#{host}"
                        }
                    ],
                    "funcList": [
                        "last"
                    ],
                    "groupBy": [
                        "processlist_command",
                        "host"
                    ],
                    "groupByTime": "",
                    "namespace": "logging",
                    "q": "L::`mysql_dbm_activity`:(COUNT(`*`)) { `host` = '#{host}' } BY `processlist_command`, `host`",
                    "queryFuncs": [],
                    "search": "",
                    "type": "simple"
                },
                "type": "pie",
                "unit": ""
            }
        ],
        "type": "pie"
    },
    {
        "extend": {
            "fixedTime": "",
            "isRefresh": true,
            "settings": {
                "alias": [],
                "bgColor": "",
                "colors": [],
                "compareTitle": "",
                "compareType": "",
                "currentChartType": "singlestat",
                "downsample": "last",
                "fixedTime": "",
                "fontColor": "",
                "isTimeInterval": false,
                "levels": [],
                "lineColor": "#3AB8FF",
                "mappings": [],
                "openCompare": false,
                "precision": "2",
                "showFieldMapping": false,
                "showLine": false,
                "showLineAxis": false,
                "showTitle": true,
                "timeInterval": "default",
                "titleDesc": "",
                "units": [
                    {
                        "key": "max(event_timer_wait)",
                        "name": "max(event_timer_wait)",
                        "unit": "",
                        "units": [
                            "time",
                            "ns"
                        ]
                    }
                ]
            }
        },
        "group": {
            "name": null
        },
        "name": "Event Maximum Execution Time",
        "pos": {
            "h": 8,
            "w": 6,
            "x": 0,
            "y": 8
        },
        "queries": [
            {
                "color": "",
                "datasource": "dataflux",
                "name": "",
                "qtype": "dql",
                "query": {
                    "alias": "",
                    "code": "A",
                    "dataSource": "mysql_dbm_activity",
                    "field": "event_timer_wait",
                    "fieldFunc": "max",
                    "fieldType": "long",
                    "fill": null,
                    "fillNum": null,
                    "filters": [
                        {
                            "id": "9a5b29b0-33e0-11ed-a6f0-d37c49910681",
                            "logic": "and",
                            "name": "host",
                            "op": "=",
                            "value": "#{host}"
                        }
                    ],
                    "funcList": [],
                    "groupBy": [],
                    "groupByTime": "",
                    "namespace": "logging",
                    "q": "L::`mysql_dbm_activity`:(MAX(`event_timer_wait`)) { `host` = '#{host}' }",
                    "queryFuncs": [],
                    "type": "simple",
                    "withLabels": []
                },
                "type": "singlestat",
                "unit": ""
            }
        ],
        "type": "singlestat"
    }
],
"groups": [],
"type": "template",
"vars": [
    {
        "code": "host",
        "datasource": "dataflux",
        "definition": {
            "defaultVal": {
                "label": "*",
                "value": "re(`.*`)"
            },
            "field": "",
            "metric": "",
            "object": "",
            "tag": "",
            "value": "show_tag_value(from=['mysql'],keyin=['host'])"
        },
        "hide": 0,
        "isHiddenAsterisk": 0,
        "name": "host",
        "seq": 0,
        "type": "QUERY",
        "valueSort": "default"
    }
]
},
"summary": "",
"tagInfo": [],
"thumbnail": "",
"title": "Mysql Activity Monitor View111111"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-A35365F3-6744-4C2B-8817-AAFDD8D55758"
}