Class: KafkaCommand::BrokersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- KafkaCommand::BrokersController
- Defined in:
- app/controllers/kafka_command/brokers_controller.rb
Instance Method Summary collapse
-
#index ⇒ Object
GET /clusters/:cluster_id/brokers.
-
#show ⇒ Object
GET /clusters/:cluster_id/brokers/:id.
Instance Method Details
#index ⇒ Object
GET /clusters/:cluster_id/brokers
8 9 10 11 12 |
# File 'app/controllers/kafka_command/brokers_controller.rb', line 8 def index @cluster = Cluster.find(params[:cluster_id]) @brokers = @cluster.brokers render_success(@brokers) end |
#show ⇒ Object
GET /clusters/:cluster_id/brokers/:id
15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/kafka_command/brokers_controller.rb', line 15 def show cluster = Cluster.find(params[:cluster_id]) @broker = cluster.brokers.find { |b| b.node_id == params[:id].to_i } if @broker.present? render_success(@broker) else record_not_found end end |