You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+119-4Lines changed: 119 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -36,11 +36,83 @@ for example, if you are using Grafana with containers, add:
36
36
37
37
You REST API application should return data in the following format:
38
38
39
-
### Fetch Graph
39
+
> Note: You API application should handle CORS policy. Otherwise you will face CORS-Policy error in Grafana.
40
40
41
-
This route returns the graph which is intended to visualize.
41
+
### Fetch Graph Fields
42
42
43
-
endpoint: `/api/fetchgraph`
43
+
This route returns the nodes and edges fields defined in the [parameter tables](https://grafana.com/docs/grafana/latest/visualizations/node-graph/#data-api).
44
+
This would help the plugin to create desired parameters for the graph.
45
+
For nodes, `id` and for edges, `id`, `source` and `target` fields are required and the other fields are optional.
46
+
47
+
endpoint: `/api/graph/fields`
48
+
49
+
method: `GET`
50
+
51
+
content type: `application/json`
52
+
53
+
content format example:
54
+
55
+
```json
56
+
{
57
+
"edges_fields": [
58
+
{
59
+
"field_name": "id",
60
+
"type": "string"
61
+
},
62
+
{
63
+
"field_name": "source",
64
+
"type": "string"
65
+
},
66
+
{
67
+
"field_name": "target",
68
+
"type": "string"
69
+
},
70
+
{
71
+
"field_name": "mainStat",
72
+
"type": "number"
73
+
}
74
+
],
75
+
"nodes_fields": [
76
+
{
77
+
"field_name": "id",
78
+
"type": "string"
79
+
},
80
+
{
81
+
"field_name": "title",
82
+
"type": "string"
83
+
},
84
+
{
85
+
"field_name": "mainStat",
86
+
"type": "string"
87
+
},
88
+
{
89
+
"field_name": "secondaryStat",
90
+
"type": "number"
91
+
},
92
+
{
93
+
"color": "red",
94
+
"field_name": "arc__failed",
95
+
"type": "number"
96
+
},
97
+
{
98
+
"color": "green",
99
+
"field_name": "arc__passed",
100
+
"type": "number"
101
+
},
102
+
{
103
+
"displayName": "Role",
104
+
"field_name": "detail__role",
105
+
"type": "string"
106
+
}
107
+
]
108
+
}
109
+
```
110
+
111
+
### Fetch Graph Data
112
+
113
+
This route returns the graph data which is intended to visualize.
0 commit comments