Class: Dbwatcher::Api::V1::SessionsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Dbwatcher::Api::V1::SessionsController
- Defined in:
- app/controllers/dbwatcher/api/v1/sessions_controller.rb
Instance Method Summary collapse
- #diagram_data ⇒ Object
- #diagram_types ⇒ Object
- #summary_data ⇒ Object
- #tables_data ⇒ Object
- #timeline_data ⇒ Object
Instance Method Details
#diagram_data ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/dbwatcher/api/v1/sessions_controller.rb', line 21 def diagram_data Rails.logger.info "API::V1::SessionsController#diagram_data: Getting diagram for session #{@session.id}" service = Dbwatcher::Services::Api::DiagramDataService.new(@session, params[:type], diagram_params) result = service.call if result[:error] render_error(result[:error]) else render json: result end end |
#diagram_types ⇒ Object
45 46 47 48 49 50 51 |
# File 'app/controllers/dbwatcher/api/v1/sessions_controller.rb', line 45 def diagram_types Rails.logger.info "API::V1::SessionsController#diagram_types: Getting available diagram types" render json: { types: Dbwatcher::Services::Api::DiagramDataService., default_type: "database_tables" } end |
#summary_data ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/dbwatcher/api/v1/sessions_controller.rb', line 15 def summary_data Rails.logger.info "API::V1::SessionsController#summary_data: Getting summary for session #{@session.id}" service = Dbwatcher::Services::Api::SummaryDataService.new(@session) render json: service.call end |
#tables_data ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/dbwatcher/api/v1/sessions_controller.rb', line 9 def tables_data Rails.logger.info "API::V1::SessionsController#tables_data: Getting tables for session #{@session.id}" service = Dbwatcher::Services::Api::TablesDataService.new(@session, tables_data_params) render json: service.call end |
#timeline_data ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/dbwatcher/api/v1/sessions_controller.rb', line 33 def timeline_data Rails.logger.info "API::V1::SessionsController#timeline_data: Getting timeline for session #{@session.id}" service = Dbwatcher::Services::TimelineDataService.new(@session) result = service.call if result[:errors].any? render_error(result[:errors].first[:message]) else render json: result end end |