Class GraphResource


  • @RestController
    @RequestMapping("/api")
    public class GraphResource
    extends Object
    REST controller for managing Graph.
    • Method Detail

      • createGraph

        @PostMapping("/graphs")
        @Timed
        public org.springframework.http.ResponseEntity<Graph> createGraph​(@Valid @RequestBody
                                                                          @Valid Graph graph)
                                                                   throws URISyntaxException
        POST /graphs : Create a new graph.
        Parameters:
        graph - the graph to create
        Returns:
        the ResponseEntity with status 201 (Created) and with body the new graph, or with status 400 (Bad Request) if the graph has already an ID
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect
      • updateGraph

        @PutMapping("/graphs")
        @Timed
        public org.springframework.http.ResponseEntity<Graph> updateGraph​(@Valid @RequestBody
                                                                          @Valid Graph graph)
                                                                   throws URISyntaxException
        PUT /graphs : Updates an existing graph.
        Parameters:
        graph - the graph to update
        Returns:
        the ResponseEntity with status 200 (OK) and with body the updated graph, or with status 400 (Bad Request) if the graph is not valid, or with status 500 (Internal Server Error) if the graph couldnt be updated
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect
      • getAllGraphs

        @GetMapping("/graphs")
        @Timed
        public org.springframework.http.ResponseEntity<List<Graph>> getAllGraphs​(org.springframework.data.domain.Pageable pageable)
                                                                          throws URISyntaxException
        GET /graphs : get all the graphs.
        Parameters:
        pageable - the pagination information
        Returns:
        the ResponseEntity with status 200 (OK) and the list of graphs in body
        Throws:
        URISyntaxException - if there is an error to generate the pagination HTTP headers
      • getGraph

        @GetMapping("/graphs/{id}")
        @Timed
        public org.springframework.http.ResponseEntity<Graph> getGraph​(@PathVariable
                                                                       Long id)
        GET /graphs/:id : get the "id" graph.
        Parameters:
        id - the id of the graph to retrieve
        Returns:
        the ResponseEntity with status 200 (OK) and with body the graph, or with status 404 (Not Found)
      • deleteGraph

        @DeleteMapping("/graphs/{id}")
        @Timed
        public org.springframework.http.ResponseEntity<Void> deleteGraph​(@PathVariable
                                                                         Long id)
        DELETE /graphs/:id : delete the "id" graph.
        Parameters:
        id - the id of the graph to delete
        Returns:
        the ResponseEntity with status 200 (OK)
      • getMyGraphs

        @GetMapping("/mygraphs")
        @Timed
        public org.springframework.http.ResponseEntity<List<Graph>> getMyGraphs()
                                                                         throws URISyntaxException
        Get all graphs owned by logged in user, plus all shared graphs.
        Throws:
        URISyntaxException