Skip to content

Commit cab7b38

Browse files
authored
Merge pull request #3 from opsdis/batch_endpoints
Fix name of endpoints from graph to graphs
2 parents fe8c596 + 2d52ded commit cab7b38

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,14 @@ The api endpoints will operate on a complete graph. The POST will first
132132
delete before create. For a client that have the full "picture" of the graph
133133
model, this is the most effective endpoint to use.
134134

135-
POST /api/graph/{graph_schema}
136-
DELETE /api/graph/{graph_schema}
135+
POST /api/graphs/{graph_schema}
136+
DELETE /api/graphs/{graph_schema}
137+
138+
> The graph endpoints in singulars are deprecated:
139+
>
140+
> POST /api/graphs/{graph_schema}
141+
>
142+
> DELETE /api/graphs/{graph_schema}
137143

138144
The POST endpoint requiere a body of a list of nodes and edges, e.g.
139145
```json

nodeprovider.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ func setupRoutes(handler *HandlerInit, promHandler *PrometheusInit) {
244244
rtr.HandleFunc("/api/edges/{graph:.+}/{source_id:.+}/{target_id:.+}", handler.edges).Methods("GET")
245245

246246
// Graph
247+
rtr.HandleFunc("/api/graphs/{graph:.+}", handler.createGraph).Methods("POST")
248+
rtr.HandleFunc("/api/graphs/{graph:.+}", handler.deleteGraph).Methods("DELETE")
249+
250+
// The following is deprecated
247251
rtr.HandleFunc("/api/graph/{graph:.+}", handler.createGraph).Methods("POST")
248252
rtr.HandleFunc("/api/graph/{graph:.+}", handler.deleteGraph).Methods("DELETE")
249-
250-
// Controller
251253
rtr.HandleFunc("/api/controller/{graph:.+}/delete-all", handler.deleteGraph).Methods("POST")
252254

253255
rtr.Use(logcall)

0 commit comments

Comments
 (0)