Class: Orchestrator::Api::ZonesController
- Inherits:
-
Orchestrator::ApiController
- Object
- AcaEngineBase
- Orchestrator::ApiController
- Orchestrator::Api::ZonesController
- Defined in:
- app/controllers/orchestrator/api/zones_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
29 30 31 32 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 29 def create zone = Zone.new(safe_params) save_and_respond zone end |
#destroy ⇒ Object
34 35 36 37 38 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 34 def destroy # delete will update CS and zone caches @zone.delete render :nothing => true end |
#index ⇒ Object
13 14 15 16 17 18 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 13 def index query = @@elastic.query(params) query.sort = [{name: "asc"}] respond_with @@elastic.search(query) end |
#show ⇒ Object
20 21 22 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 20 def show respond_with @zone end |
#update ⇒ Object
24 25 26 27 |
# File 'app/controllers/orchestrator/api/zones_controller.rb', line 24 def update @zone.update_attributes(safe_params) save_and_respond @zone end |