Class: Api::V2::DiscoveryRulesController
- Inherits:
-
BaseController
- Object
- BaseController
- Api::V2::DiscoveryRulesController
- Includes:
- Foreman::Controller::Parameters::DiscoveryRule
- Defined in:
- app/controllers/api/v2/discovery_rules_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
47 48 49 50 51 |
# File 'app/controllers/api/v2/discovery_rules_controller.rb', line 47 def create @discovery_rule = DiscoveryRule.new(discovery_rule_params) @discovery_rule.priority = DiscoveryRule.suggest_priority if discovery_rule_params[:priority].blank? process_response @discovery_rule.save end |
#destroy ⇒ Object
64 65 66 |
# File 'app/controllers/api/v2/discovery_rules_controller.rb', line 64 def destroy process_response @discovery_rule.destroy end |
#index ⇒ Object
20 21 22 |
# File 'app/controllers/api/v2/discovery_rules_controller.rb', line 20 def index @discovery_rules = resource_scope.search_for(*).paginate() end |
#show ⇒ Object
27 28 |
# File 'app/controllers/api/v2/discovery_rules_controller.rb', line 27 def show end |
#update ⇒ Object
57 58 59 |
# File 'app/controllers/api/v2/discovery_rules_controller.rb', line 57 def update process_response @discovery_rule.update(discovery_rule_params) end |