@@ -80,6 +80,8 @@ The schema defines the different fields and the type, string or number, that are
8080
8181# API endpoints
8282
83+ All endpoint expects the header "Content-Type" set to "application/json"
84+
8385# # Data source API
8486
8587 GET /{graph_schema}/api/graph/data
@@ -98,10 +100,6 @@ The schema defines the different fields and the type, string or number, that are
98100 GET /api/edges/{graph_schema}/{source_id}/{target_id}
99101 PUT /api/edges/{graph_schema}/{source_id}/{target_id}
100102 DELETE /api/edges/{graph_schema}/{source_id}/{target_id}
101-
102- POST /api/controller/{graph_schema}/delete-all
103-
104- All endpoint expects the header "Content-Type" set to "application/json"
105103
106104POST operations expect a json body. The content should only include the field names in the graph schema.
107105
@@ -129,8 +127,56 @@ DELETE and GET do not have any query parameters.
129127curl -s -i -H "Content-Type: application/json" -X PUT "localhost:9393/api/nodes/micro/lb-01?arc__failed=0.1?arc__passed=0.9"
130128` ` `
131129
130+ # # Manage a complete graph
131+ The api endpoints will operate on a complete graph. The POST will first
132+ delete before create. For a client that have the full "picture" of the graph
133+ model, this is the most effective endpoint to use.
134+
135+ POST /api/graph/{graph_schema}
136+ DELETE /api/graph/{graph_schema}
132137
133- # ## Return status
138+ The POST endpoint requiere a body of a list of nodes and edges, e.g.
139+ ` ` ` json
140+ {
141+ "nodes": [
142+ {
143+ "id": "lb-1",
144+ "title": "lb",
145+ "subTitle": "instance:#01",
146+ "detail__role": "load",
147+ "arc__failed": 0,
148+ "arc__passed": 1,
149+ "mainStat": 0,
150+ "secondaryStat": 0
151+ },
152+ ....
153+
154+ ],
155+ "edges": [
156+ {
157+ "source": "lb-1",
158+ "target": "cust-svc-1",
159+ "mainStat": 0,
160+ "secondaryStat": 0
161+ },
162+ ....
163+ ]
164+ }
165+ ` ` `
166+
167+ Please see the `examples/graph.json` and `examples/setup_graph.sh` for a
168+ complete example.
169+
170+ # # Deprecated API
171+ The following api are deprecated :
172+
173+ POST /api/controller/{graph_schema}/delete-all
174+
175+
176+
177+
178+
179+ # # Return status
134180
135181- 200
136182 - Successful - PUT, DELETE, GET
@@ -172,9 +218,13 @@ Name it to `Micro`.
172218
173219Create a dashboard and select the "Node Graph" plugin. Select the data source `Micro`.
174220
175- Load the simple graph model
221+ Load the simple graph model by create nodes and edges :
176222
177223 ./examples/setup_test.sh
224+
225+ Or run the example to create a complete graph :
226+
227+ ./examples/setup_graph.sh
178228
179229In Grafana you should now see this.
180230
0 commit comments