示例#1
0
 /**
  * Delete Node
  *
  * @Delete("/nodes/{id}")
  * @Versions({"v1"})
  * @Parameters({
  *      @Parameter("id", type="integer", required=true, description="The ID of the node."),
  * })
  * @Response(204)
  */
 public function delete(Request $request, $id)
 {
     try {
         $node = new NodeRepository();
         $node->delete($id);
         return $this->response->noContent();
     } catch (DisplayException $ex) {
         throw new ResourceException($ex->getMessage());
     } catch (\Exception $e) {
         throw new ServiceUnavailableHttpException('An error occured while attempting to delete this node.');
     }
 }