Skip to content

Commit

Permalink
Merge pull request #3 from opsdis/batch_endpoints
Browse files Browse the repository at this point in the history
Fix name of endpoints from graph to graphs
  • Loading branch information
thenodon authored Apr 17, 2022
2 parents fe8c596 + 2d52ded commit cab7b38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,14 @@ The api endpoints will operate on a complete graph. The POST will first
delete before create. For a client that have the full "picture" of the graph
model, this is the most effective endpoint to use.

POST /api/graph/{graph_schema}
DELETE /api/graph/{graph_schema}
POST /api/graphs/{graph_schema}
DELETE /api/graphs/{graph_schema}

> The graph endpoints in singulars are deprecated:
>
> POST /api/graphs/{graph_schema}
>
> DELETE /api/graphs/{graph_schema}

The POST endpoint requiere a body of a list of nodes and edges, e.g.
```json
Expand Down
6 changes: 4 additions & 2 deletions nodeprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ func setupRoutes(handler *HandlerInit, promHandler *PrometheusInit) {
rtr.HandleFunc("/api/edges/{graph:.+}/{source_id:.+}/{target_id:.+}", handler.edges).Methods("GET")

// Graph
rtr.HandleFunc("/api/graphs/{graph:.+}", handler.createGraph).Methods("POST")
rtr.HandleFunc("/api/graphs/{graph:.+}", handler.deleteGraph).Methods("DELETE")

// The following is deprecated
rtr.HandleFunc("/api/graph/{graph:.+}", handler.createGraph).Methods("POST")
rtr.HandleFunc("/api/graph/{graph:.+}", handler.deleteGraph).Methods("DELETE")

// Controller
rtr.HandleFunc("/api/controller/{graph:.+}/delete-all", handler.deleteGraph).Methods("POST")

rtr.Use(logcall)
Expand Down

0 comments on commit cab7b38

Please sign in to comment.